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

Displaying 0 or some values in yaxis is value is zero

1 Answer 45 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.
Ankit
Top achievements
Rank 1
Ankit asked on 16 Mar 2015, 12:58 PM
Hello,

I am using column chart and have a scenario in which the y axis can be zero for all the values in x axis, in that case yAxis is blank and not even showing 0.
I want yAxis to at least display zero or some values on yAxis.


Thanks
Ankit

1 Answer, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 16 Mar 2015, 03:38 PM
Hi Ankit,

Thank you for contacting us.

To achieve this scenario you should create your y axis manually and assign it to the yAxis property of TKChart. The code snippet below demonstrates how to create an axis with range from 0 to 10 with major tick interval 1. The axis will display its labels even if all data points have y value of 0:
TKChartNumericAxis *yAxis = [[TKChartNumericAxis alloc] initWithMinimum:@0 andMaximum:@10];
yAxis.majorTickInterval = @1;
     
_chart.yAxis = yAxis;

I hope this helps. Do not hesitate to contact us in case 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.

 
Tags
Chart
Asked by
Ankit
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Share this question
or