Code: Select all
const config : Highcharts.Options = {
title: {
text: title
},
chart: {
borderWidth: 1,
borderColor: '#AAA',
borderRadius: 5,
height: height,
},
accessibility: {
enabled: false
},
exporting: {
enabled: false
},
credits: {
enabled: false
},
time: {
useUTC: true
},scrollbar: {
enabled: false
},
rangeSelector: {
buttons: [{
type: 'minute',
count: 30,
text: '30m'
},{
type: 'hour',
count: 1,
text: '1h'
},{
type: 'hour',
count: 3,
text: '3h'
}],
selected: 0,
inputEnabled: false
},
yAxis: [{
gridLineWidth: 0,
labels: {
format: '{value} rpm'
},
softMax: 100,
opposite: true
}],
tooltip: {
split: false,
shared: true
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: false
}
}
},
series: [],
};
chart = Highcharts.stockChart( container, config);
Code: Select all
for( let index = 0; index < model.length; index ++){
if( chart.series.length - 1 < index ) {
chart.addSeries({
index: index,
yAxis: 0,
name: model[index].hostname,
type: 'column',
data: model[index].data,
threshold: null,
color: Highcharts.getOptions().colors[index]
}, false);
} else {
chart.series[index].setData(model[index].data);
}
}
chart.redraw();
This code works well for `line` chart, while for stacked column chart, it causes more and more columns stacked over existing stacks
I tried to remove all series then update, that does not help
Please what problem it is?