From 546db1b64d2b35d2366be0a89d27e2735386db2b Mon Sep 17 00:00:00 2001 From: Hristo Nedelkov Date: Thu, 28 Sep 2023 23:07:04 +0300 Subject: [PATCH] Update graphs to receive isInteractive prop --- src/components/Charts/StandardGauge.tsx | 4 +++- src/components/Charts/StandardLineChart.tsx | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Charts/StandardGauge.tsx b/src/components/Charts/StandardGauge.tsx index 99bfafb9..3fc1b8e5 100644 --- a/src/components/Charts/StandardGauge.tsx +++ b/src/components/Charts/StandardGauge.tsx @@ -9,9 +9,10 @@ export interface GaugeDataPoint { interface StandardGaugeProps { data: GaugeDataPoint[] + isInteractive?: boolean } -const StandardGauge = ({ data }: StandardGaugeProps) => ( +const StandardGauge = ({ data, isInteractive = true }: StandardGaugeProps) => ( ( legends={[]} motionConfig="gentle" animate={false} + isInteractive={isInteractive} /> ) diff --git a/src/components/Charts/StandardLineChart.tsx b/src/components/Charts/StandardLineChart.tsx index 77eed661..5d28a77e 100644 --- a/src/components/Charts/StandardLineChart.tsx +++ b/src/components/Charts/StandardLineChart.tsx @@ -13,8 +13,9 @@ interface ChartData { interface StandartLineChartProps { data: ChartData[] + isInteractive?: boolean } -const StandartLineChart = ({ data }: StandartLineChartProps) => { +const StandartLineChart = ({ data, isInteractive }: StandartLineChartProps) => { const maxMemory = data[0].maxValue || 'auto' const colors = data.map(dataset => dataset.color) @@ -30,6 +31,7 @@ const StandartLineChart = ({ data }: StandartLineChartProps) => { stacked: true, reverse: false, }} + axisTop={null} axisRight={null} axisBottom={null} @@ -42,6 +44,7 @@ const StandartLineChart = ({ data }: StandartLineChartProps) => { useMesh={true} legends={[]} colors={colors} + isInteractive={isInteractive} /> ) }