diff --git a/packages/geostreaming/src/containers/Sensor/Detail/Parameters.jsx b/packages/geostreaming/src/containers/Sensor/Detail/Parameters.jsx index e3e885cb..57cee994 100644 --- a/packages/geostreaming/src/containers/Sensor/Detail/Parameters.jsx +++ b/packages/geostreaming/src/containers/Sensor/Detail/Parameters.jsx @@ -176,7 +176,6 @@ const Parameters = (props: Props) => { break; case 'stacked_line': content = ; break; diff --git a/packages/geostreaming/src/containers/Sensor/Detail/VegaMultiLineChartWrapper.jsx b/packages/geostreaming/src/containers/Sensor/Detail/VegaMultiLineChartWrapper.jsx index f3c99dd8..7619e425 100644 --- a/packages/geostreaming/src/containers/Sensor/Detail/VegaMultiLineChartWrapper.jsx +++ b/packages/geostreaming/src/containers/Sensor/Detail/VegaMultiLineChartWrapper.jsx @@ -1,8 +1,8 @@ // @flow import * as React from 'react'; import { Grid } from '@material-ui/core'; -import MultiLineChart from '../../../components/vega/MultiLineChart' -import StackedBoxWhisker from '../../../components/vega/StackedBoxWhisker' +import MultiLineChart from '../../../components/vega/MultiLineChart'; +import StackedBoxWhisker from '../../../components/vega/StackedBoxWhisker'; import type { ParameterValue } from '../../../utils/flowtype'; @@ -10,7 +10,6 @@ type Props = { label: string; unit: string; data: ParameterValue[]; - attributes: string[]; startAtZero: Boolean, sameTimeScale: Boolean, startDate: Date, @@ -20,15 +19,17 @@ type Props = { const MultiLineChartWrapper = (props: Props) => { const { data, - attributes, label, startDate, endDate, startAtZero } = props; - const chartData = data.map(({date, average, count})=> ({average, date, count })) - + const chartData = data.map(({ date, average, count })=> ({ average, date, count })); + let attributes = []; + if (0 in Object.keys(data)) + if ('average' in data[0]) + attributes = Object.keys(data[0].average); return ( <> @@ -40,14 +41,14 @@ const MultiLineChartWrapper = (props: Props) => { startDate={startDate} endDate={endDate} startAtZero={startAtZero} - /> + /> + /> );