How can we access all the yaxis labels from a rad chart? I have to insert all labels lying on y axis into a drop down list programatically......and then write some logic in drop down lists' selectedIndexChanged() method to perform some operations on radchart. So how can I insert all of the yaxis labels programatically in the drop down?
4 Answers, 1 is accepted
0
Hello Amey,
Unfortunately you cannot iterate over a collection with the calculated label values earlier than the PrePaint event and that is too late to interact with other web controls on the page. The desired functionality could be achieved only if you set AutoScale=false for the YAxis and then you need to set manually the MinValue, MaxValue, and the step for the labels like this:
You can then calculate the desired information from the MinValue, MaxValue, and Step you specified for the axis e.g. if MinValue=0, MaxValue=400, and step is 100, the labels would be 0, 100, 200, 300, 400.
All the best,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Unfortunately you cannot iterate over a collection with the calculated label values earlier than the PrePaint event and that is too late to interact with other web controls on the page. The desired functionality could be achieved only if you set AutoScale=false for the YAxis and then you need to set manually the MinValue, MaxValue, and the step for the labels like this:
<telerik:RadChart ID="RadChart1" runat="server"> |
<Series> |
<telerik:ChartSeries Name="Series 1"> |
<Items> |
<telerik:ChartSeriesItem Name="Item 1" YValue="4"> |
</telerik:ChartSeriesItem> |
<telerik:ChartSeriesItem Name="Item 2" YValue="2"> |
</telerik:ChartSeriesItem> |
<telerik:ChartSeriesItem Name="Item 3" YValue="400"> |
</telerik:ChartSeriesItem> |
</Items> |
</telerik:ChartSeries> |
</Series> |
<PlotArea> |
<YAxis AutoScale="false" MinValue="0" MaxValue="400" Step="100"></YAxis> |
</PlotArea> |
</telerik:RadChart> |
You can then calculate the desired information from the MinValue, MaxValue, and Step you specified for the axis e.g. if MinValue=0, MaxValue=400, and step is 100, the labels would be 0, 100, 200, 300, 400.
All the best,
Manuel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
anusha
Top achievements
Rank 1
answered on 21 Jan 2011, 10:03 AM
Unable to Autoscale for YAxis.If I appy the following coding the chart is dislayed inthe below figure
<
YAxis AutoScale="false" MinValue="100" MaxValue="1000"></YAxis>
0
Hi Anusha,
You need to set appropriate Step property value as well.
Regards,
Giuseppe
the Telerik team
You need to set appropriate Step property value as well.
Regards,
Giuseppe
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
anusha
Top achievements
Rank 1
answered on 25 Jan 2011, 01:20 PM
Thanq Its Working Fine!!