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

Chart for iOS 8 how to match columns to axis.

2 Answers 60 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.
Daniel
Top achievements
Rank 1
Daniel asked on 03 Oct 2014, 08:31 AM
Hello,

Im current using the trial version of the framework for iOS 8 using xCode 6, I was wondering how I would match Column series up to a specific axis.

I the problem I have is that I need to match Column Series A to yAxis A, and Column Series B to yAxis B. I have tried various methods and also used the documentation, however couldn't find anything to assign Columns to Axis apart from:


  TKChartNumericAxis *axisA = [[TKChartNumericAxis alloc]initWithMinimum:@0 andMaximum:@100];
    axisA.position = TKChartAxisPositionRight;


  TKChartNumericAxis *axisB = [[TKChartNumericAxis alloc]initWithMinimum:@0 andMaximum:@1000];
    axisB.position = TKChartAxisPositionRight;

And then assigning the series1.yaxis to axis A and the same for series 2 and axis b, Both yAxis have different values, however this is causing the chart to stack the series of columns one on top of the other. Thanks in advance.





2 Answers, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 03 Oct 2014, 01:22 PM
Hello Daniel,

Thank you for contacting us.

Currently clustering of column series in TKChart is possible only if all the series have same y axis. A possible workaround is to set same y axis to both of the series, so they are clustered, and add another y axis to the chart like in the following code snippet:

TKChartCategoryAxis *xAxis = [[TKChartCategoryAxis alloc] initWithCategories:categories];
chart.xAxis = xAxis;
     
TKChartNumericAxis *leftAxis = [[TKChartNumericAxis alloc] initWithMinimum:@0 andMaximum:@1000];
leftAxis.position = TKChartAxisPositionLeft;
[chart addAxis:leftAxis];
     
TKChartNumericAxis *rightAxis = [[TKChartNumericAxis alloc] initWithMinimum:@0 andMaximum:@100];
rightAxis.position = TKChartAxisPositionRight;
[chart addAxis:rightAxis];
     
TKChartColumnSeries *seriesA = [[TKChartColumnSeries alloc] initWithItems:dataPoints];
TKChartColumnSeries *seriesB = [[TKChartColumnSeries alloc] initWithItems:dataPoints1];
     
[chart addSeries:seriesA];
[chart addSeries:seriesB];

This issue will be addressed in a future version of UI for iOS. Until then you can vote/comment/follow it in our feedback portal. I updated your Telerik points for this suggestion.

Please do not hesitate to contact us if you need further assistance.

Regards,
Adrian
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
Daniel
Top achievements
Rank 1
answered on 03 Oct 2014, 01:50 PM

Thank you, I also tried this but i was not sure if it was correct or not.
Tags
Chart
Asked by
Daniel
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or