[IOS charts] color under the serie


#1

hello, i want to set a color to all the area under the line,

did anyone succeded with that? how can it be done? thanks.


#2

Here’s one way to do it:

#pragma mark - SChartDatasource methods
 
-(SChartSeries*)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index {
    SChartSeries* chartSeries = nil;
 
     SChartLineSeriesStyle * style = [[SChartLineSeriesStylealloc] init];            
     [style setFillWithGradient:NO];
    [style setAreaColor:[UIColor colorOfYourFill]];
    [style setShowFill:YES];
     [style setAreaLineWidth:[NSNumbernumberWithFloat:2.0]];
    [style setAreaLineColor:[UIColor colorOfYourLine]];
 
     SChartLineSeries* lineSeries = [[SChartLineSeriesalloc] init];
    [lineSeries setStyle:style];
    
    chartSeries = lineSeries;
    return chartSeries;
 }

#3

thanks alot!