Chart Type and Chart Axis Label.

Thread is closed for posting
2 posts, 0 answers
  1. ankit
    ankit avatar
    4 posts
    Member since:
    May 2008

    Posted 04 Jun 2008 Link to this post

    hello,

    How can i get the value of X Axis label when user click on one the bar.....

  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 05 Jun 2008 Link to this post

    Hello ankit,

    If you have specified XValue for the series items manually or you have databound them via the ChartSeries.DataXColumn property, you can get the XValue like this:

    ASPX
    <telerik:RadChart ID="RadChart1" runat="server" AutoLayout="true" OnClick="RadChart1_Click"
        <Series> 
            <telerik:ChartSeries Name="Series 1"
                <Items> 
                    <telerik:ChartSeriesItem Name="Item 1" YValue="1" XValue="1"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 2" YValue="3" XValue="2"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 3" YValue="2" XValue="3"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 4" YValue="6" XValue="4"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 5" YValue="8" XValue="5"
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem Name="Item 6" YValue="2" XValue="6"
                    </telerik:ChartSeriesItem> 
                </Items> 
            </telerik:ChartSeries> 
        </Series> 
    </telerik:RadChart> 

    Code-behind
    protected void RadChart1_Click(object sender, ChartClickEventArgs args) 
        if (args.SeriesItem is ChartSeriesItem) 
            Response.Write(args.SeriesItem.XValue); 


    Hope this helps.


    Best wishes,
    Manuel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top