You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, brothers, I got a problem about Charts. I wanna make a chart view with one group bars and one line. I copied the code from ChartsDemo's CombinedChartViewController. CombinedChartViewController had two BarChartDataSet, but I only need one. then I deleted BarChartDataSet2. code become likes this:
Hi, brothers, I got a problem about Charts. I wanna make a chart view with one group bars and one line. I copied the code from ChartsDemo's CombinedChartViewController. CombinedChartViewController had two BarChartDataSet, but I only need one. then I deleted BarChartDataSet2. code become likes this:
(BarChartData *)generateBarData
{
NSMutableArray<BarChartDataEntry *> *entries1 = [[NSMutableArray alloc] init];
for (int index = 0; index < ITEM_COUNT; index++)
{
[entries1 addObject:[[BarChartDataEntry alloc] initWithX:0.0 y:(arc4random_uniform(25) + 25)]];
}
BarChartDataSet *set1 = [[BarChartDataSet alloc] initWithValues:entries1 label:@"Bar 1"];
[set1 setColor:[UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f]];
set1.valueTextColor = [UIColor colorWithRed:60/255.f green:220/255.f blue:78/255.f alpha:1.f];
set1.valueFont = [UIFont systemFontOfSize:10.f];
set1.axisDependency = AxisDependencyLeft;
set1.highlightEnabled = NO;
BarChartData *d = [[BarChartData alloc] initWithDataSet:set1];
float barWidth = 0.9f;
d.barWidth = barWidth;
[d setValueFont:[UIFont systemFontOfSize:10.f]];
return d;
}
But all bars draw on the same place. they are overlapped. How I solve these overlapped bars?
The text was updated successfully, but these errors were encountered: