aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports/Graph.js
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-05-31 14:17:13 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-05-31 14:17:13 +0530
commit8e1bddcc608ba4e52699c30084f5ef950bd7e329 (patch)
tree540c52116542c484f74a09042d83653582b5dc77 /modern/src/reports/Graph.js
parent402b30df63f6dfafda32ae37aa2d4df9ef638fd2 (diff)
downloadetbsa-traccar-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.tar.gz
etbsa-traccar-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.tar.bz2
etbsa-traccar-web-8e1bddcc608ba4e52699c30084f5ef950bd7e329.zip
Finalizing reports implemetations
Diffstat (limited to 'modern/src/reports/Graph.js')
-rw-r--r--modern/src/reports/Graph.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/modern/src/reports/Graph.js b/modern/src/reports/Graph.js
index b785e06..990eb5d 100644
--- a/modern/src/reports/Graph.js
+++ b/modern/src/reports/Graph.js
@@ -1,9 +1,8 @@
import React from 'react';
-import { Box, Paper } from '@material-ui/core';
+import { withWidth } 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;
}
@@ -19,7 +18,7 @@ const CustomizedAxisTick = ({ x, y, payload }) =>{
const Graph = ({ type, items }) => {
return (
- <ResponsiveContainer height={400} width={500}>
+ <ResponsiveContainer height={400} width="100%" debounce={1}>
<LineChart data={items}>
<XAxis dataKey="fixTime" tick={<CustomizedAxisTick/>} height={60} />
<YAxis />
@@ -32,4 +31,4 @@ const Graph = ({ type, items }) => {
);
}
-export default Graph;
+export default withWidth()(Graph);