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

Items on Y-axis

2 Answers 50 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Rushma
Top achievements
Rank 1
Rushma asked on 20 Sep 2011, 09:55 PM
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 Answers, 1 is accepted

Sort by
0
Missing User
answered on 21 Sep 2011, 03:06 PM
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:
http://www.telerik.com/help/aspnet-ajax/radchart-axes.html

I hope this helps.

Kind regards,
Polina
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
0
Rushma
Top achievements
Rank 1
answered on 21 Sep 2011, 09:37 PM
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 =

"MonthName";

 

radChart.PlotArea.YAxis.AutoScale =

true;

 

radChart.Series[0].DataYColumn =

"Column1";

 

radChart.DataBind();

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.

Tags
Chart (Obsolete)
Asked by
Rushma
Top achievements
Rank 1
Answers by
Missing User
Rushma
Top achievements
Rank 1
Share this question
or