Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply custom color on candlesticks based on OPEN/CLOSE values?

I'm working on candlesticks (highStock). Is there any function through which I can change color of individual candlesticks based on Open/close values ? by default it gives blue and white color, i.e. if opening values are greater then closing values then color will be blues , and if closing value is greater then opening values then color will be white. but i want to apply green and red color instead on blue and white. also i want to apply white color if the closing price is same as opening. any help will be highly appreciated. Thanks in Advance ;)

like image 384
Omar Bahir Avatar asked Jul 31 '13 09:07

Omar Bahir


1 Answers

You can find your answer from the below link:

Highstock Docs for candlestick chart

JSFIDDLE DEMO

Code:

plotOptions: {
    candlestick: {
        color: 'red',
        upColor: 'green'
    }
},
like image 62
Dhaval Bharadva Avatar answered Sep 17 '22 20:09

Dhaval Bharadva