diff --git a/src/visualizations/config/adapters/dhis_highcharts/getSortedConfig.js b/src/visualizations/config/adapters/dhis_highcharts/getSortedConfig.js index c1ab3f698..c0a6de3db 100644 --- a/src/visualizations/config/adapters/dhis_highcharts/getSortedConfig.js +++ b/src/visualizations/config/adapters/dhis_highcharts/getSortedConfig.js @@ -77,7 +77,7 @@ function getDefaultSortedConfig(config, layout, stacked) { const categories = config.xAxis?.length && config.xAxis[0].categories const series = config.series const indexOrder = getIndexOrder( - stacked ? getStackedData(series, layout) : series[0].data, + stacked ? getStackedData(series, layout) : series[0]?.data ?? [], layout ) const sortedConfig = Object.assign({}, config)