Page 1 of 1

How do I control the colours for a Candle?

Posted: Fri Sep 24, 2010 5:43 pm
by 15351453
Hi,
The Candle series colours individual candles automatically based on the price values.
Is there a way to override this logic?

It appears to choose the colour based on whether open > close, whereas I want previous close > close.

I tried playing around with the pen and brush colours, but can only affect the outline colour.

At a guess, it looks like I could sub-class Candle and override the calculateColor method.

Is this the best approach or is there a more direct method?

Many thanks
Roger

Re: How do I control the colours for a Candle?

Posted: Fri Sep 24, 2010 6:46 pm
by 15351453
It's OK, I've got it.
I sub-classed Candle, overrode drawValue(int), fiddled the up and down colors and the pen color according to my logic and then called the super-class method.