diff --git a/src/pages/Archive/ArchiveColumn.jsx b/src/pages/Archive/ArchiveColumn.jsx index b3e7909..0118086 100644 --- a/src/pages/Archive/ArchiveColumn.jsx +++ b/src/pages/Archive/ArchiveColumn.jsx @@ -1,14 +1,20 @@ +import { useEffect, useState } from 'react' import { Grid, GridItem } from '../../components/Grid' import { Column } from '../../components/charts/Column' export const ArchiveColumn = ({ lineGroup, data, interval, style, headerHeight, yStart }) => { - const dataLast = data?.[data.length - 1] - const pv = lineGroup.filter(line => line.showLabels).map(line => ({ - color: line.color, - label: line.label, - unit: line.units, - value: dataLast?.[line.xAccessorName] - })) + const [lineGroupWithoutShapes, setLineGroupWithoutShapes] = useState([]) + const [pv, setPV] = useState([]) + + useEffect(() => { + const lgws = lineGroup.filter(cfg => !cfg.isShape) + setLineGroupWithoutShapes(lgws) + setPV(lgws.filter(line => line.showLabels).map(line => ({ + color: line.color, + label: line.label + }))) + }, [lineGroup]) + return (