Hi,
Sorry about the delay ... as these posts were migrated from the old community by API, I did not get any notification of comments here!
It seems that this broke due to some changes to the internals of the series / data. I've modified the script a bit and it seems to work (tested on 2023.4)
Hope that helps! Let me know if you still have issues.
Steve
widget.on('beforeviewloaded', function(widget, element, options) {
var chartOptions = element.options;
chartOptions.chart.type = 'waterfall';
chartOptions.legend.enabled = false;
if (chartOptions.plotOptions.series.dataLabels.enabled == true) {
chartOptions.plotOptions.series.dataLabels.verticalAlign = 'top';
}
chartOptions = consolidateSeries(chartOptions)
delete chartOptions.xAxis.categories
chartOptions.xAxis.type = 'category'
delete chartOptions.yAxis[0].max
//console.log(chartOptions)
})
function consolidateSeries(options) {
options.series.forEach((thisSeries, index, arr) => {
options.series[0].data[index] = thisSeries.data[index]
options.series[0].data[index].name = thisSeries.name
if (thisSeries.name.startsWith("*")) {
options.series[0].data[index].isSum = true;
delete options.series[0].data[index].y
}
})
options.series[0].onlyMeasuresInSeries = false
options.series.splice(1, options.series.length - 1)
return options
}