Horizontal Colored Areas In Charts


#1

HI all,

I’m developping an application where I would need to build such a chart : http://imagik.fr/view-rl/25614

I’m starting with ShinobiChart (free trial) and I was wondering if it was possible to do what I need, therefore if I should buy the premium version.

I did the quickstartguide, and tried some tweaks to have colored areas like in the image above.

My concerns are : - What is the best way to do these horizontal colored areas like I need ?  Fake it with an area colored below a lineSerie (is it possible to color an area ABOVE a lineserie ?), fake it with a bandserie ?(bandseries do not seem to appear on my chart, I read somewhere that it’s a premium version functionnality) Or is it possible to customize a chart object to have areas colored like this, between two “y” values for example, without using chartseries ?

                                 - I need to see the datapoints and the main lineserie, can I make it appear on top of everyother object of the chart ?

I hope someone can help me. I would really like to be sure that the premium version would allow me to do what I need :slight_smile:

thanks in advance,

Antoine


#2

Hi Antoine,

Firstly, the trial version of our charts includes all of the premium features. So there shouldn’t be anything that isn’t working because of that. As for the coloured horizontal plot bands you are trying to create, we actually have a class specifically designed for that. This class is called SChartAnnotation, below is a code snippet showing you how to add a plot band to your chart:

// Create a red horizontal band annotation.
SChartAnnotation *annotation = [SChartAnnotation horizontalBandAtPosition:@0 andMaxY:@10 withXAxis:chart.xAxis andYAxis:chart.yAxis withColor:[UIColor redColor]]; 

// Place annotation underneath data.
annotation.position = SChartAnnotationBelowData; 

// Add the annotation to chart.
[chart addAnnotation:annotation];

This would get you the effect in your picture if you added multiple bands. You would need the premium version of charts to use this feature however.

Hopefully this helps!

Jan