Displaying 0 or some values in yaxis is value is zero

2 posts, 0 answers
  1. Ankit
    Ankit avatar
    8 posts
    Member since:
    Jan 2015

    Posted 16 Mar 2015 Link to this post


    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.

  2. Adrian
    Adrian avatar
    160 posts

    Posted 16 Mar 2015 Link to this post

    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.


    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.

  3. DevCraft banner
Back to Top