https://ibb.co/h7tmwtr https://ibb.co/syRTyPG
For the first time, I have included 5 plot bands which looked great. However, when I added a series and toggled it on a stacked bar graph, the plot bands' width started increasing. I want to maintain the same width as in the initial setting, without altering the graph or plot band width.
Below is the code snippet I'm using:
chart.yAxis.plotBands = [];
var compaserlen = chart.series.length - 1;
chart.yAxis.tickInterval = 20 * compaserlen;
var stfromval = 0;
var sttoval = 20 * compaserlen;
var colorstackplot = ['#D5D5D6', '#E0E1E1', '#EAEAEB', '#F5F5F6', '#F7F7F8'];
for (var i = 0; i < 5; i++) {
console.log("compaserlen", compaserlen);
chart.yAxis.plotBands.push({
from: stfromval,
to: sttoval,
color: colorstackplot[i]
});
stfromval = sttoval;
sttoval = sttoval + (20 * compaserlen);
}