I am trying to create a Stacked Bar chart with the series being dynamic (unlike your example with hard coded series. I have done the following but it does not create the stacked columns for the different series
Highcharts.chart(this.chartElement.nativeElement, {
chart: {
type: 'column'
},
title: '',
xAxis: {
type: 'datetime',
categories: this.rptng_months
},
yAxis: {
title: '',
min: 0,
stackLabels: {
enabled: false,
style: {
fontWeight: 'bold'
}
}
},
credits: {
enabled: false
},
legend: {
enabled: true,
align: 'center',
verticalAlign: 'bottom',
x: 0,
y: 0
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
enabled: true,
color: 'black',
style: {
textOutline: 0
},
}
}
},
series: this.data.map(x=>x.Scheduled_Open),
});
I've also tried the Series section like this:
series: [
{
name: this.data.map(n=>n.Container),
data:this.data.map(x=>x.Scheduled_Open),
type: 'column',
cursor: 'pointer'
},
This is what my dataset looks like:
Container RPTNG_Months Scheduled_Open
Container 1 1/1/2021 40
Container 1 2/1/2021 40
Container 1 3/1/2021 40
Container 1 4/1/2021 40
Container 2 1/1/2021 117
Container 2 2/1/2021 119
Container 2 3/1/2021 119
Container 2 4/1/2021 119
Container 3 1/1/2021 359
Container 3 2/1/2021 359
Container 3 3/1/2021 358
Container 3 4/1/2021 357
Container 4 1/1/2021 237
Container 4 2/1/2021 237
Container 4 3/1/2021 238
Container 4 4/1/2021 238
In the dataset above there are 4 different containers. However there could be any number of containers. Note that I sanitized the names for this example. The names are actually meaningful.
How can I create a stacked column with dynamic series.