I have a SChartLineSeries and when I select a point, the selectedPointStyle doesn't seem to get applied.
Here's my code:
-(SChartSeries*)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index {
SChartLineSeries* lineSeries = [[SChartLineSeries alloc] init];
lineSeries.selectionMode = SChartSelectionPoint;
SChartLineSeriesStyle *style = [SChartLineSeriesStyle new];
style.pointStyle = [SChartPointStyle new];
style.pointStyle.showPoints = YES;
style.pointStyle.color = [UIColor whiteColor];
style.pointStyle.radius = [NSNumber numberWithInt:5];
//style.pointStyle.innerRadius = [NSNumber numberWithFloat:0.0];
style.selectedPointStyle.color = [UIColor orangeColor];
style.selectedPointStyle.radius = [NSNumber numberWithInt:15];
[lineSeries setStyle:style];
//[lineSeries setSelectedStyle:style];
}
Please help. We're in a crunch time. Also, if I have to customize to show a dashed line, is it possible to do so in Shinobi?
The problem is that you're trying to set properties on the
selectedPointStyle
property, which isnil
by default. In the same way that you created a newSChartPointStyle
object for thepointStyle
property, you need to create one for theselectedPointStyle
property.Update your code to the following and you should observe the selection effect that you're after:
In answer to your other question, dashed lines are not currently supported as part of ShinobiCharts.