laka
Posts: 3
Joined: Sun Aug 28, 2022 8:20 am

Beginner question

Hello,

I'm sorry, I speak a little English.

This demo is nice: /stock/demo/basic-line

I would like:
  • Add 1 dotted line to zero (0).
  • Up zero: green points/lines
  • Down zero: red points/lines
Is it possible? Please help me with code. Thanks.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Beginner question

Hello and welcome to our forum and thanks for contacting us with your question!

Yes, it is possible. You can add a dotted line using yAxis.plotlines property and to change color of lines and points depending on the value you can use series.zones.

Demo: https://jsfiddle.net/BlackLabel/ws2rn0ep/
API: https://api.highcharts.com/highcharts/yAxis.plotLines
https://api.highcharts.com/highcharts/series.line.zones

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”