Browse Source

Pass chart data to lines not to the graph itself

pull/1886/head
Gabe Kangas 6 years ago
parent
commit
7b2106adce
  1. 4
      web/pages/components/chart.tsx

4
web/pages/components/chart.tsx

@ -75,6 +75,7 @@ export default function Chart({ data, title, color, unit, dataCollections }: Cha
const line = data && data?.length > 0 ? ( const line = data && data?.length > 0 ? (
<Line <Line
key="line"
type="basis" type="basis"
dataKey="value" dataKey="value"
stroke={color} stroke={color}
@ -82,12 +83,13 @@ export default function Chart({ data, title, color, unit, dataCollections }: Cha
strokeWidth={3} strokeWidth={3}
legendType="square" legendType="square"
name={title} name={title}
data={data}
/> />
) : null; ) : null;
return ( return (
<div className={styles.lineChartContainer}> <div className={styles.lineChartContainer}>
<LineChart width={chartWidth} height={chartHeight} data={data}> <LineChart width={chartWidth} height={chartHeight}>
<XAxis <XAxis
dataKey="time" dataKey="time"
tickFormatter={timeFormatter} tickFormatter={timeFormatter}

Loading…
Cancel
Save