Update graphs to receive isInteractive prop
This commit is contained in:
parent
6fff9f9feb
commit
546db1b64d
|
@ -9,9 +9,10 @@ export interface GaugeDataPoint {
|
||||||
|
|
||||||
interface StandardGaugeProps {
|
interface StandardGaugeProps {
|
||||||
data: GaugeDataPoint[]
|
data: GaugeDataPoint[]
|
||||||
|
isInteractive?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const StandardGauge = ({ data }: StandardGaugeProps) => (
|
const StandardGauge = ({ data, isInteractive = true }: StandardGaugeProps) => (
|
||||||
<ResponsivePie
|
<ResponsivePie
|
||||||
data={data}
|
data={data}
|
||||||
margin={{ top: 0, right: 0, bottom: 0, left: 0 }}
|
margin={{ top: 0, right: 0, bottom: 0, left: 0 }}
|
||||||
|
@ -23,6 +24,7 @@ const StandardGauge = ({ data }: StandardGaugeProps) => (
|
||||||
legends={[]}
|
legends={[]}
|
||||||
motionConfig="gentle"
|
motionConfig="gentle"
|
||||||
animate={false}
|
animate={false}
|
||||||
|
isInteractive={isInteractive}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,9 @@ interface ChartData {
|
||||||
|
|
||||||
interface StandartLineChartProps {
|
interface StandartLineChartProps {
|
||||||
data: ChartData[]
|
data: ChartData[]
|
||||||
|
isInteractive?: boolean
|
||||||
}
|
}
|
||||||
const StandartLineChart = ({ data }: StandartLineChartProps) => {
|
const StandartLineChart = ({ data, isInteractive }: StandartLineChartProps) => {
|
||||||
const maxMemory = data[0].maxValue || 'auto'
|
const maxMemory = data[0].maxValue || 'auto'
|
||||||
const colors = data.map(dataset => dataset.color)
|
const colors = data.map(dataset => dataset.color)
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ const StandartLineChart = ({ data }: StandartLineChartProps) => {
|
||||||
stacked: true,
|
stacked: true,
|
||||||
reverse: false,
|
reverse: false,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
axisTop={null}
|
axisTop={null}
|
||||||
axisRight={null}
|
axisRight={null}
|
||||||
axisBottom={null}
|
axisBottom={null}
|
||||||
|
@ -42,6 +44,7 @@ const StandartLineChart = ({ data }: StandartLineChartProps) => {
|
||||||
useMesh={true}
|
useMesh={true}
|
||||||
legends={[]}
|
legends={[]}
|
||||||
colors={colors}
|
colors={colors}
|
||||||
|
isInteractive={isInteractive}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue