From 47b5b7d699e7f6883e7f24097b5995c973f3ea4d Mon Sep 17 00:00:00 2001 From: EBS Date: Wed, 2 Sep 2020 15:52:12 +0545 Subject: [PATCH] Show line in BarCharts --- .../views/Dashboard/GroupedBarChart/index.js | 24 +++++++++++++++---- .../SummaryContainer/TrendSummary/index.js | 2 ++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/client/src/views/Dashboard/GroupedBarChart/index.js b/client/src/views/Dashboard/GroupedBarChart/index.js index 9533401..4d5c2ed 100644 --- a/client/src/views/Dashboard/GroupedBarChart/index.js +++ b/client/src/views/Dashboard/GroupedBarChart/index.js @@ -10,17 +10,18 @@ import { Tooltip, Legend, ResponsiveContainer, + ComposedChart, + Line, } from 'recharts'; function CustomizedLabel(props) { const { x, y, width, value } = props; - return ( {value} @@ -30,6 +31,7 @@ function CustomizedLabel(props) { export default function GroupedBarChart(props) { const { data, + lineKey, } = props; if (isNotDefined(data) || isNotDefined(data.values) || data.values.length <= 0) { @@ -43,7 +45,7 @@ export default function GroupedBarChart(props) { height={250} width="100%" > - @@ -57,13 +59,25 @@ export default function GroupedBarChart(props) { key={column} fill={data.colors[column]} label={} + style={{ cursor: 'pointer' }} /> ))} - + {!!lineKey && ( + + )} + ); } +GroupedBarChart.defaultProps = { + lineKey: '', +}; + GroupedBarChart.propTypes = { data: PropTypes.object.isRequired, + lineKey: PropTypes.string, }; diff --git a/client/src/views/Dashboard/SummaryContainer/TrendSummary/index.js b/client/src/views/Dashboard/SummaryContainer/TrendSummary/index.js index 0340ba9..cdd085d 100644 --- a/client/src/views/Dashboard/SummaryContainer/TrendSummary/index.js +++ b/client/src/views/Dashboard/SummaryContainer/TrendSummary/index.js @@ -335,6 +335,7 @@ class TrendSummary extends React.PureComponent { {rcData.values.length > 0 && ( )} {/* 0 && ( )} {/*