innerRadius property is ignored


#1

Hello,

It seems that setting pointStyle.innderRadius has no effect when setting a custom point style.  The radius (outer radius), color, and innerColor properties work fine, setting those from the same place.  I found a workaround by using the delegate method sChartInnerRadiusForDataPoint, but seems unnecessary when I want all the points in the series to be uniform.

#pragma mark - SChartDatasource methods

// TODO: find out why we must set the innerRadius here instead of as a property of SChartPointStyle in seriesAtIndex
- (float)sChartInnerRadiusForDataPoint:(ShinobiChart *)chart dataPointAtIndex:(NSInteger)dataIndex forSeriesAtIndex:(NSInteger)seriesIndex
{
    return 8.0;
}

-(SChartSeries *)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index {
    SChartLineSeries *lineSeries = [[SChartLineSeries alloc] init];
    SChartLineSeriesStyle *style = lineSeries.style;
    
    UIColor *tcBlueColor = [UIColor colorWithRed:23.0/255.0 green:181.0/255.0 blue:254.0/255.0 alpha:1];
    
    style.showFill = YES;
    style.fillWithGradient = NO;
    style.areaColor = tcBlueColor;
    style.areaLineColor = tcBlueColor;

    SChartPointStyle *pointStyle = style.pointStyle;
    pointStyle.showPoints = YES;
    pointStyle.innerColor = [UIColor yellowColor];
    pointStyle.color = [UIColor blackColor];
    //pointStyle.innerRadius = @8.0; //FIXME: innerRadius property does not work for unknown reasons...using delegate method instead
    pointStyle.radius = @10;
    
    return lineSeries;
}

#2

Hi eskewj,

I think I may have an idea of what the problem is. The setter for innerRadius checks to ensure that it isn’t being set to something bigger than radius. You are setting innerRadius before setting radius which means the setter will disallow this. Try setting radius before innerRadius to see if this works.

This ordering dependency in our API isn’t very nice, so I’ve raised it as something for us to look into changing.

I hope the above helps!  smiley lol


#3

Yes, that fixed it.  Would not have crossed my mind to try that.  Thanks.