-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackedBarChart isn't stacking bars #2815
Comments
check out ChartDemo; you don't setup correctly. The stacked y values should be in an array. for (int i = 0; i < count; i++)
{
double mult = (range + 1);
double val1 = (double) (arc4random_uniform(mult) + mult / 3);
double val2 = (double) (arc4random_uniform(mult) + mult / 3);
double val3 = (double) (arc4random_uniform(mult) + mult / 3);
[yVals addObject:[[BarChartDataEntry alloc] initWithX:i yValues:@[@(val1), @(val2), @(val3)] icon: [UIImage imageNamed:@"icon"]]];
} |
Thanks for your response, but I am using an array of y-values for each entry. Turns out my issue was that I was not using the initializer of BarChartDataSet to pass in the values. The stack size is only calculated there, which is a requirement for bar chart stacking to work. |
all I see. I don't realize this. Sorry |
I'm trying to create a stacked bar chart, but the bars won't stack. I just get alternating colors for adjacent bars, and the values are summed from the array passed into it. I pass in an array of x values (indexes) and an array of y value arrays as items. A coworker ran into the same issue on the Android platform, but I don't see this issue mentioned anywhere else so maybe we aren't setting something correctly?
The text was updated successfully, but these errors were encountered: