user1801810 user1801810 - 5 months ago 71
jQuery Question

Highcharts Grid Line Width (or Color) - Single Line

I have the following

Highcharts
(http://www.highcharts.com) scatter chart. Note that the axes start at -10 and stop at 10, with 0 in the middle. I want each 0 line to be a different width or color from all the others. Should be easy but I can't find in the API documentation how to do. All I can find is how to change properties for all lines. Has anyone done this or have suggestions?

Outside of the API I looked into using Javascript (specifically jQuery) to update the element's style but the only specific part (
d
) I could easily use to find which line to update isn't always the same. The element looks like.....

<path stroke-width="10" opacity="1" stroke="#D8D8D8" d="M 293.5 72 L 293.5 502" fill="none"></path>


Thanks.

Scatter Chart

Answer

You can implement plotLines. Check this out.

In yAxis, I have set a green line at value of 70.

In xAxis, I have set a blue line at value of 170.

You may play around with the color and width as well.

Comments