Welcome Guest Search | Active Topics |

How to custom color CandleStick Chart?
ldcvn2003
#1 Posted : Tuesday, January 05, 2016 11:21:08 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/3/2016(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hi,
Can I custom color CandleStick Chart?
hi,
Can I change color Candlestick Chart ?
ex:
today price > yesterday price 2% : blue
today price > yesterday price 5% : pink
today price == yesterday price 5% : yellow
today price < yesterday price -2% :red
Thanks
Ivan
#2 Posted : Wednesday, January 06, 2016 6:19:07 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
ldcvn2003
#3 Posted : Wednesday, January 06, 2016 8:56:17 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/3/2016(UTC)
Posts: 6

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
hi,
$('#jqChart').bind('shapeRendering', function (e, shape) {
if (shape.context.y > 50) {
shape.fillStyle = 'red';
}
});

50 is constant. I want use yesterday close price compair today close price.
Example:
today price > yesterday price 2% : blue
today price > yesterday price 5% : pink
today price == yesterday price 5% : yellow
today price < yesterday price -2% :red
thanks
Ivan
#4 Posted : Monday, January 11, 2016 3:19:25 AM(UTC)
Rank: Administration

Groups: Administrators, Moderator, Registered
Joined: 11/5/2012(UTC)
Posts: 131

Thanks: 0 times
Was thanked: 15 time(s) in 15 post(s)
It can be something like:
Code:

$('#jqChart').bind('shapeRendering', function (e, shape) {

                var context = shape.context;
                var index = context.index;

                if (index == 0) {
                    return;
                }

                var data = context.series.arrData;
                var previousData = data[index - 1];

                // previousData[0] is time
                // previousData[1] is high
                // previousData[2] is low
                // previousData[3] is open
                // previousData[4] is close

                if (context.high > previousData[1]) {
                    shape.strokeStyle = 'yellow';
                }
            });
Best,
Ivan Petrov
jqChart Inc.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.550 seconds.