Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
545
IGStackedSeriesDataSourceHelper display data side by side
posted

Hi,

i have an array ("objects") of objects like this

@property NSNumber *value1;

@property NSNumber *value2;

@property NSString *textForLabel;

I use

[[IGStackedSeriesDataSourceHelper alloc] initWithData:objects fields:@[@"value1",@"value2"] labelPath:@"textForLabel"];

 [_chartView addStackedSeriesForType:[IGStackedColumnSeries class] usingKey:@"columnSeries" withDataSource:source firstAxisKey:@"xAxis" secondAxisKey:@"yAxis"];

I get this result:

How do I display columns side by side and not one above the other? I have to use another data source?
Thank you

Parents
No Data
Reply
  • 21382
    Verified Answer
    posted

    A stacked data source is for stacked data charts.  You most likely are looking to use the IGCategorySeriesDataSourceHelper and hook it up a IGColumnSeries.  That would display a single value per bar.  The add a second IGColumnSeries (and second helper) for the second bar


    something like

    *h1=  IGCategorySeriesDataSourceHelper initWithData:data andValuePath:value1

    *h2 = IGCategorySeriesDataSourceHelper initWithData:data andValuePath:value2


    _chartView addSeriesForType: IGColumnSeries .... withDataSource:h1;

    _chartView addSeriesForType: IGColumnSeries .... withDataSource:h2;



Children