This question is locked. New answers and comments are not allowed.
I created a pie chart:
TKChart *c = [[TKChart alloc] initWithFrame:self.view.bounds];
NSMutableArray *ar = [NSMutableArray new];
for (int i = 0; i < 20; i++) {
TKChartDataPoint *p = [[TKChartDataPoint alloc] initWithValue:@(1) name:[NSString stringWithFormat:@"Point %d",i]];
[ar addObject:p];
}
TKChartPieSeries *series = [[TKChartPieSeries alloc] initWithItems:ar];
[c addSeries:series];
c.legend.hidden = NO;
[self.view addSubview:c];
TKChartLegendContainer *cont = c.legend.container;
// cont.stack.stretchMode = TKLayoutStretchModeVertical;
cont.stack.alignmentMode = TKLayoutAlignmentModeHorizontalCenter;
cont.stack.orientation = TKStackLayoutOrientationHorizontal;
cont.stack.stretchMode = TKLayoutStretchModeHorizontal;
Doesn't matter what I do to the legend configuration, I can't make the legend's container resize or move to an appropriate position.
I want the legend to be scrollable (It inherits from UIScrollView) and I want it to be centred above the pie chart. How can this be achieved?
Thanks,
TKChart *c = [[TKChart alloc] initWithFrame:self.view.bounds];
NSMutableArray *ar = [NSMutableArray new];
for (int i = 0; i < 20; i++) {
TKChartDataPoint *p = [[TKChartDataPoint alloc] initWithValue:@(1) name:[NSString stringWithFormat:@"Point %d",i]];
[ar addObject:p];
}
TKChartPieSeries *series = [[TKChartPieSeries alloc] initWithItems:ar];
[c addSeries:series];
c.legend.hidden = NO;
[self.view addSubview:c];
TKChartLegendContainer *cont = c.legend.container;
// cont.stack.stretchMode = TKLayoutStretchModeVertical;
cont.stack.alignmentMode = TKLayoutAlignmentModeHorizontalCenter;
cont.stack.orientation = TKStackLayoutOrientationHorizontal;
cont.stack.stretchMode = TKLayoutStretchModeHorizontal;
Doesn't matter what I do to the legend configuration, I can't make the legend's container resize or move to an appropriate position.
I want the legend to be scrollable (It inherits from UIScrollView) and I want it to be centred above the pie chart. How can this be achieved?
Thanks,