简体   繁体   English

Highcharts网格线宽度(或颜色)-单线

[英]Highcharts Grid Line Width (or Color) - Single Line

I have the following Highcharts ( http://www.highcharts.com ) scatter chart. 我有以下Highchartshttp://www.highcharts.com )散点图。 Note that the axes start at -10 and stop at 10, with 0 in the middle. 请注意,轴从-10开始并在10处停止,中间为0。 I want each 0 line to be a different width or color from all the others. 我希望每条0线的宽度或颜色都与其他所有线不同。 Should be easy but I can't find in the API documentation how to do. 应该很容易,但是我在API文档中找不到该怎么做。 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. 在API之外,我考虑使用Javascript(特别是jQuery)来更新元素的样式,但是我可以轻松地用来查找要更新的行的唯一特定部分( d )并不总是相同的。 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. 谢谢。

散点图

You can implement plotLines . 您可以实现plotLines Check this out. 检查这个出来。

In yAxis , I have set a green line at value of 70. yAxis ,我将绿线设置为70。

In xAxis , I have set a blue line at value of 170. xAxis ,我将蓝线设置为170。

You may play around with the color and width as well. 您也可以尝试colorwidth

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM