Candlestick

Moderator: c0rdawg

Candlestick

Postby giomax » Thu Jul 16, 2009 8:30 am

Dear at all.
I'm a new user of Open Flash Chart, an happy one!! :D
I've got a question about candle chart but I don't kwon if it is an "Help me" or a "New Feature" question.
I want to draw financial graph, so for this reason your candle chart is very userful.

What' is the problem?
Usually in stock graph positive bars are colored in green and negative bar are colored in red.

This now is not possible (I think) with OpenFlashChart becauseyou can set only one color for the chart type.
I try to define a trick, setting two candle object, one colored in green and one colored in red using this sintax:

if($open >= $close){
$dataRed[] = new candle_value(
number_format($high, 2),
number_format($open, 2),
number_format($close, 2),
number_format($low, 2)
);
$data[] = null;
}else if($open < $close){
$data[] = new candle_value(
number_format($high, 2),
number_format($open, 2),
number_format($close, 2),
number_format($low, 2)
);
$dataRed[] = null;
}

The problem is that once the graphic in show the "null" candle "use" space but rightly nothing is shown.
Is there any way to make them invisible?

I upload two images to make more clear my problem: one with the chart with only a candle data with all candles colored in black and a second one with two candle oblect defined (red and greed). As you can see there is too much space between candle.
Attachments
colored.jpg
Candle Chart colored
colored.jpg (44.81 KiB) Viewed 483 times
b&w.jpg
Candle Chart all on one color
b&w.jpg (46.02 KiB) Viewed 483 times
giomax
 
Posts: 2
Joined: Thu Jul 16, 2009 8:17 am

Re: Candlestick

Postby monk.e.boy » Thu Jul 16, 2009 9:33 pm

what colour is the doji? I see you have them in both green and red.

http://en.wikipedia.org/wiki/Candlestick_chart

Nice bug report BTW :)

I have fixed this by adding an optional negative-colour to the candle charts, this will go live with the next release. Hope that helps.

monk.e.boy
monk.e.boy
Founder & Project Lead
 
Posts: 653
Joined: Thu Sep 04, 2008 10:06 pm

Re: Candlestick

Postby giomax » Fri Jul 17, 2009 6:50 am

Yeah!
That will help.

Thanks a lot!
giomax
 
Posts: 2
Joined: Thu Jul 16, 2009 8:17 am


Return to Help Me!

Who is online

Users browsing this forum: No registered users and 1 guest