This question is locked. New answers and comments are not allowed.
If I derive a class from TKChartViewController and implement these methods, I get a line chart as expected:
- (NSUInteger)numberOfSeriesForChart:(TKChart *)chart
{
return 1;
}
- (TKChartSeries *)seriesForChart:(TKChart *)chart atIndex:(NSUInteger)index
{
TKChartSeries *s = [[TKChartLineSeries alloc] init];
s.title = @"Test";
return s;
}
- (NSUInteger)chart:(TKChart *)chart numberOfDataPointsForSeriesAtIndex:(NSUInteger)seriesIndex
{
return 4;
}
- (id<TKChartData>)chart:(TKChart *)chart dataPointAtIndex:(NSUInteger)dataIndex forSeriesAtIndex:(NSUInteger)seriesIndex
{
TKChartDataPoint *point = [[TKChartDataPoint alloc] init];
point.dataXValue = @(dataIndex);
point.dataYValue = @(arc4random() % 100);
return point;
}
But if I change TKChartLineSeries to TKChartColumnSeries, then I get an empty chart with just axes, no columns.
What am I missing?
- (NSUInteger)numberOfSeriesForChart:(TKChart *)chart
{
return 1;
}
- (TKChartSeries *)seriesForChart:(TKChart *)chart atIndex:(NSUInteger)index
{
TKChartSeries *s = [[TKChartLineSeries alloc] init];
s.title = @"Test";
return s;
}
- (NSUInteger)chart:(TKChart *)chart numberOfDataPointsForSeriesAtIndex:(NSUInteger)seriesIndex
{
return 4;
}
- (id<TKChartData>)chart:(TKChart *)chart dataPointAtIndex:(NSUInteger)dataIndex forSeriesAtIndex:(NSUInteger)seriesIndex
{
TKChartDataPoint *point = [[TKChartDataPoint alloc] init];
point.dataXValue = @(dataIndex);
point.dataYValue = @(arc4random() % 100);
return point;
}
But if I change TKChartLineSeries to TKChartColumnSeries, then I get an empty chart with just axes, no columns.
What am I missing?