johnyg07
Posts: 6
Joined: Tue Aug 24, 2021 9:01 pm

custom color candlestick

hi, How can i have custom colors for the candle sticks. I want to override the hollow-candle sticks and make green ones to have black border. And I want to color 4% more change to have green color.
Can someone please point me to right direction?
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: custom color candlestick

Hi johnyg07,

Thanks for contacting us with your question.

You can change bullish candles' color with upColor option.

If you want to color candles with at least 4% increase in value, then for example you can iterate over all points and compare each point with previous one.
Demo: https://jsfiddle.net/BlackLabel/bfp4350u/

You have to correct these calculations but this demo should give you general idea how to do something like that. Another option that you have, is to parse your data before passing it to the chart, and set color for each point, following format specified here: https://api.highcharts.com/highstock/se ... stick.data

Let me know if you have any further questions!
Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Stock”