Skip to content

Commit

Permalink
Chart and Table Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanShakir committed Nov 24, 2021
1 parent 5ddcaab commit 5dcc980
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Binary file modified Web App/Frontend/Frontend.tar
Binary file not shown.
2 changes: 1 addition & 1 deletion Web App/Frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "muse-ant-design-dashboard",
"name": "smart-agri",
"version": "1.0.0",
"private": true,
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions Web App/Frontend/src/components/chart/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const LineChart = ({ enData, soilData, data }) => {
let pH = [];
let nitrogen = [];
let phosphorus = [];
let potassium = [];

let enTime = [];

Expand All @@ -41,6 +42,7 @@ const LineChart = ({ enData, soilData, data }) => {
pH.push(d.pH);
nitrogen.push(d.Nitrogen);
phosphorus.push(d.Phosphorus);
potassium.push(d.Potassium);

return 0;
});
Expand Down Expand Up @@ -165,6 +167,11 @@ const LineChart = ({ enData, soilData, data }) => {
data: phosphorus,
offsetY: 0,
},
{
name: "Potassium",
data: potassium,
offsetY: 0,
},
],

options: {
Expand Down
9 changes: 1 addition & 8 deletions Web App/Frontend/src/pages/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,14 @@ const Data = () => {
.then((res) => {
console.log("Sucess");
console.log(res.data.macAddress);
setData(res.data);
setData(res.data.reverse());
})
.catch((err) => {
console.log(err);
});
};
agriData();
}, [macAddress]);

useEffect(() => {}, [data]);
useInterval(() => {
// Make the request here
Expand Down Expand Up @@ -125,12 +124,6 @@ const Data = () => {
];

const soilCol = [
// {
// title: "Date",
// dataIndex: "Date",
// key: "Date",
// defaultSortOrder: "descend",
// },
{
title: "Date/Time",
dataIndex: "Time",
Expand Down

0 comments on commit 5dcc980

Please sign in to comment.