Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

axisDependency does not work #2258

Closed
sunynator opened this issue Mar 19, 2017 · 2 comments
Closed

axisDependency does not work #2258

sunynator opened this issue Mar 19, 2017 · 2 comments

Comments

@sunynator
Copy link

sunynator commented Mar 19, 2017

I'm trying to create combined chart but the yValue from LineChart and BarChart are alway have the same projection even I set axisDependency for both line dataset and bar dataset. This problem happens in the sample project.

1

LineChartData *d = [[LineChartData alloc] init];
NSMutableArray *entries = [[NSMutableArray alloc] init];
for (int index = 0; index < ITEM_COUNT; index++)
{
    [entries addObject:[[ChartDataEntry alloc] initWithX:index + 0.5 y:(arc4random_uniform(15) + 5)]];
}
LineChartDataSet *set = [[LineChartDataSet alloc] initWithValues:entries label:@"Line DataSet"];
set.axisDependency = AxisDependencyLeft;
[d addDataSet:set];

`

NSMutableArray<BarChartDataEntry *> *entries1 = [[NSMutableArray alloc] init];
for (int index = 0; index < ITEM_COUNT; index++)
{
    [entries1 addObject:[[BarChartDataEntry alloc] initWithX:index y:(arc4random_uniform(25) + 1000000)]];

}
BarChartDataSet *set1 = [[BarChartDataSet alloc] initWithValues:entries1 label:@"Bar 1"];
set1.axisDependency = AxisDependencyRight;


BarChartData *d = [[BarChartData alloc] initWithDataSets:@[set1]];
@thierryH91200
Copy link
Contributor

look at PR : fix the issue with axis dependencies #2049

@liuxuan30
Copy link
Member

closing. soon to merge #2874

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants