How can I customize the color of CandleStick bar if open==close==high==low?


#1

Hi,

I have a troule. 

In   Version: 2.7.0-iOS8beta1-4, Edition: Premium,  the default color of candlestick bar is red when open=close=high=low.

How can I customize the color of CandleStick bar if open=close=high=low?

Thanks & Regards,

:confused:


#2

Hello. 
Maybe try this one:

SChartCandlestickSeries *sChartSeries = [[SChartCandlestickSeriesalloc] init]; 
sChartSeries.style.risingColor = [UIColor blackColor];
sChartSeries.style.risingColorGradient = [UIColor blackColor];
 sChartSeries.style.fallingColor = [UIColorwhiteColor];
sChartSeries.style.fallingColorGradient = [UIColor whiteColor];

#3

Hi Artsiom,

I know these can setup the bar color when close > open or close < open.

But how to setup the color when close==open (no rising and no falling)?  The default color of version 2.7 is red,but the 2.2.2a is green. 

How can I define it?I wanna setup the bar color to green when close = open.

Thanks & Regards


#4

Hi Song,

If you want complete control over the style of each candle stick you can subclass the candle stick series and override -styleForPoint:previousPoint:. This method will be called once for each datapoint and you should return a SChartCandlestickSeriesStyle object representing the style of that datapoint.

Here you are passed the point you are about to style and the previous point, so you can easily work out if the value is rising, falling, or the same, and return the appropriate color.

Here’s a link to our documentation for the method:
http://www.shinobicontrols.com/docs/ShinobiControls/ShinobiCharts/2.7.0/Premium/Normal/html/Classes/SChartCandlestickSeries.html#//api/name/styleForPoint:previousPoint:

Thanks,
Jan Akerman


#5

Thanks Jan.