Hi,
Tr335 wrote: ↑Thu Aug 18, 2022 8:47 am
1) To the fiddle you had sent, I tried adding 'checked=true' to plotline checkboxes, as I want the plotlines to be displayed on load by default. But I could not get it to work.
Then you should move this logic to an external function and call it before adding listeners to checkboxes.
Tr335 wrote: ↑Thu Aug 18, 2022 8:47 am
2) Also, If plotline value is an array. For example, plotline value of x-axis is 'value : [2,4]' instead of 'value: 2', I want both 2 and 4 values o be plotted on x axis (on load as I mentioned before).
As the API says, plotLines.value can only be a number, not an array. The array of objects is plotLines and to generate several lines on one axis you have to do it like this:
Code: Select all
plotLines: [{
value: 2,
color: 'green',
width: 2,
zIndex: 2
}, {
value: 4,
color: 'blue',
width: 2,
zIndex: 2
}]
Demo:
https://jsfiddle.net/BlackLabel/4Lnchkbw/
API:
https://api.highcharts.com/highcharts/xAxis.plotLines
https://api.highcharts.com/highcharts/x ... ines.value
Best regards!