Items on Y-axis

Thread is closed for posting
3 posts, 0 answers
  1. Rushma
    Rushma avatar
    7 posts
    Member since:
    May 2011

    Posted 20 Sep 2011 Link to this post

    Hi guys,

    I am using Telerik radchart in my web application and the chart is populated from a datasource.

    The X-axis is AutoScale = false and Y-axis is AutoScale = true.

    I was wondering if there is a way to have only 10 items marked on the Y-axis at all times.

    radchart1.PlotArea.YAxis.MaxItemsCount = 10; does not seem to work.

    Let me know if you need more information.

    Thanks in advance.

  2. Missing user
    Missing user avatar

    Posted 21 Sep 2011 Link to this post

    Hello Rushma,

    In order to define a custom range for the YAxis you need to set YAxis.AutoScale property to false and the needed values for YAxis.MinValue, YAxis.MaxValue and YAxis.Step properties. We would suggest you to use the YAxis.AddRange(minValue, maxValue, step) method to set all three properties in a single pass. More information about axes can be found here:

    I hope this helps.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Rushma
    Rushma avatar
    7 posts
    Member since:
    May 2011

    Posted 21 Sep 2011 Link to this post

    Hi Polina,

    Really appreciate your response, thank you.

    I get the use of YAxis.AddRange but my DataYColumn might have data in thousands for 1 financial year and in milions for the next financial year. Hence making it hard to fix maxValue and step for Y-axis.

    I have pasted my code below. Currently I do not have any constraints on the Y-axis so depending on my Column1 values, the Y-axis minValue, maxValue and Step are automatically set.

    radChart.DataSource = myDataTable;

    radChart.PlotArea.XAxis.AutoScale = false;


    radChart.PlotArea.XAxis.DataLabelsColumn =



    radChart.PlotArea.YAxis.AutoScale =



    radChart.Series[0].DataYColumn =




    So coming back to my original question, so how do I make sure only 10 points are dispalyed on the Y-axis at all times.

    Thanks in advance.

Back to Top