This is a migrated thread and some comments may be shown as answers.

iOS native chart drill down

3 Answers 87 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brendon
Top achievements
Rank 1
Brendon asked on 04 Nov 2014, 12:24 AM
Hi,
I would like to know whether the native iOS charts does support drill down e.g. when I select charts like bar, pie, or line, it will drill down and show the detailed data.  I cant seem to find a technical document on how to do that.  Can you help to provide the link, so I have better idea.

Thanks,
Brendon

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 05 Nov 2014, 01:48 PM
Hi Brendon,

Please find the answer to this question in your previous support ticket. Do not hesitate to contact us if you have further questions.

Regards,
Jack
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Allen
Top achievements
Rank 2
answered on 12 Nov 2014, 05:16 PM
Hi Jack,

Is this information available? I would like to be able to do a drill-down on line selection in a chart.

Thanks,

Allen
0
Jack
Telerik team
answered on 13 Nov 2014, 11:02 AM
Hi Allen,

Thank you for asking. I am posting my answer here:

This feature is not supported our of the box in TKChart. It is a powerful feature and we will consider implementing it in a future release. In fact, it is quite easy to achieve this scenario with a few lines of code. One option is to handle the chart:didSelectPoint:inSeries:atIndex method and replace chart data with new one. Please, consider the following code snippet:
- (void)chart:(TKChart *)chart didSelectPoint:(id<TKChartData>)point inSeries:(TKChartSeries *)series atIndex:(NSInteger)index
{
    NSMutableArray *items = [NSMutableArray new];
    for (int i = 0; i<10; i++) {
        TKChartDataPoint *point = [[TKChartDataPoint alloc] initWithX:@(i) Y:@(arc4random()%100)];
        [items addObject:point];
    }
    TKChartLineSeries *s = [[TKChartLineSeries alloc] initWithItems:items];
    [chart removeAllData];
    [chart addSeries:s];
}

The attached project demonstrates this approach. Do not hesitate to contact us if you have any questions.

Regards,
Jack
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Brendon
Top achievements
Rank 1
Answers by
Jack
Telerik team
Allen
Top achievements
Rank 2
Share this question
or