开发者

drawing custom lines on highchart graph

开发者 https://www.devze.com 2023-04-12 19:07 出处:网络
I have recently been开发者_StackOverflow中文版 working with the highchart api to plot some data on a website, and I have need to be able to add a custom vertical \"line\" to symbolise something happen

I have recently been开发者_StackOverflow中文版 working with the highchart api to plot some data on a website, and I have need to be able to add a custom vertical "line" to symbolise something happening for example a press release.

I have thought about adding a column element to the chart as a seperate series but this is less than ideal.

if anyone has any ideas that would be awesome

thanks


Can you use the the renderer to draw the line?

Here is the API doc for renderer. Look at the path function.

Also check the Try it for jsfiddle for path function.


You can also check the addPlotLine or addPlotBand methods (http://api.highcharts.com/highcharts#Axis.addPlotLine and http://api.highcharts.com/highcharts#Axis.addPlotBand).

It may be easier and quicker to use than drawing a SVG path, unless your line isn't straight.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号