Is there a IGGaugeRange equivalent for IGChartView that allows me to place brushed bands across a series?
Something like this...
You would have to use another series as the range. Unfortunately, there isn't a simple way to break apart an axis into colored ranges. It might be a neat feature to have something like an IGRangeOverlay that behaves like an IGOverlay, but instead of a line, shows an area. At the moment, the only way to have such ranges is to use another series as the first series in the chart. You could either try a StackedColumnSeries or a couple of RangeAreaSeries. Ranges can share your existing Y axis, but not the X axis.
IGHighLowSeriesDataSourceHelper *dsh1 = [[IGHighLowSeriesDataSourceHelper alloc]initWithHighValues:@[@10,@10] andLowValues:@[@0,@0]];
IGRangeAreaSeries *fill = (IGRangeAreaSeries*)[_chartView addSeriesForType:[IGRangeAreaSeries class] usingKey:@"fill" withDataSource:dsh1 firstAxisKey:@"fillXAxis" secondAxisKey:@"y"];
IGCategoryXAxis *fillAxis = (IGCategoryXAxis*)[_chartView findAxisByKey:@"fillXAxis"];
fillAxis.labelsVisible = NO;
This idea dovetails nicely into what I need to do. I'll give it a shot and report back.
Thank you for the sample. The issues are plenty... ah!
The one issue that stands out is how to handle overlaps. That's a tricky area, and something that needs to be supported. That said, I'm thinking about drawing a custom image. Is there a way to either: 1) set the series background as an image, or 2) get the bounds of the series so that an image context can be created and aligned successfully ?
Thanks!
Caylan,
I'm not sure what you mean by the overlaps, can you give an example?
Unfortunately, you can't set a background image to the plot area.
If you have two overlapping ranges that you want to represent on the chart.
60F - 105F = Range that represents habitable temperatures for humans
68F-74F = Range that represents ideal temperature for humans
Since it isn't possible to set the background for the series, but you can for the entire chart... Is it possible to get the coordinates of the series so I draw the image appropriately?
Are you using NucliOS 14.1 by chance? We've added a plotAreaRect property to the chart to get the chart's viewport bounds.
I'll make a note of this and revisit in a few days. Thank you.