diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-05-24 14:47:57 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-05-24 14:47:57 +0530 |
commit | 81ad6a0e5c8ed4f35ccac0cd271b8923e686c060 (patch) | |
tree | a7207018677d99e91e3ce55a535cb48ae88afe7b /modern/src/reports/Graph.js | |
parent | 10b8e1d6f4ed63c43da2cd71bf21f34b31071cd1 (diff) | |
download | trackermap-web-81ad6a0e5c8ed4f35ccac0cd271b8923e686c060.tar.gz trackermap-web-81ad6a0e5c8ed4f35ccac0cd271b8923e686c060.tar.bz2 trackermap-web-81ad6a0e5c8ed4f35ccac0cd271b8923e686c060.zip |
Resolved some comments on the reports
Diffstat (limited to 'modern/src/reports/Graph.js')
-rw-r--r-- | modern/src/reports/Graph.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/modern/src/reports/Graph.js b/modern/src/reports/Graph.js index af54e10e..b785e06f 100644 --- a/modern/src/reports/Graph.js +++ b/modern/src/reports/Graph.js @@ -3,6 +3,10 @@ import { Box, Paper } from '@material-ui/core'; import {LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'; const CustomizedAxisTick = ({ x, y, payload }) =>{ + console.log('inside customized tick ', payload.value) + if(!payload.value) { + return payload.value; + } const parts = payload.value.split(' '); return ( <g transform={`translate(${x},${y})`}> @@ -15,20 +19,16 @@ const CustomizedAxisTick = ({ x, y, payload }) =>{ const Graph = ({ type, items }) => { return ( - <Paper> - <Box height={400}> - <ResponsiveContainer> - <LineChart data={items}> - <XAxis dataKey="fixTime" tick={<CustomizedAxisTick/>} height={60} /> - <YAxis /> - <CartesianGrid strokeDasharray="3 3" /> - <Tooltip /> - <Legend /> - <Line type="natural" dataKey={type} /> - </LineChart> - </ResponsiveContainer> - </Box> - </Paper> + <ResponsiveContainer height={400} width={500}> + <LineChart data={items}> + <XAxis dataKey="fixTime" tick={<CustomizedAxisTick/>} height={60} /> + <YAxis /> + <CartesianGrid strokeDasharray="3 3" /> + <Tooltip /> + <Legend /> + <Line type="natural" dataKey={type} /> + </LineChart> + </ResponsiveContainer> ); } |