Update graphs to receive isInteractive prop

This commit is contained in:
Hristo Nedelkov 2023-09-28 23:07:04 +03:00
parent 6fff9f9feb
commit 546db1b64d
2 changed files with 7 additions and 2 deletions

View File

@ -9,9 +9,10 @@ export interface GaugeDataPoint {
interface StandardGaugeProps {
data: GaugeDataPoint[]
isInteractive?: boolean
}
const StandardGauge = ({ data }: StandardGaugeProps) => (
const StandardGauge = ({ data, isInteractive = true }: StandardGaugeProps) => (
<ResponsivePie
data={data}
margin={{ top: 0, right: 0, bottom: 0, left: 0 }}
@ -23,6 +24,7 @@ const StandardGauge = ({ data }: StandardGaugeProps) => (
legends={[]}
motionConfig="gentle"
animate={false}
isInteractive={isInteractive}
/>
)

View File

@ -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}
/>
)
}