When I click one point in the spline chart,How can I get this point (xvalue,yvalue) accoring to what event?

2 posts, 0 answers
  1. PEIYANG
    PEIYANG avatar
    65 posts
    Member since:
    Jul 2012

    Posted 15 Sep 2012 Link to this post

    When I click one point in the spline chart,How can I get this point (xvalue,yvalue) accoring to what event?
  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 19 Sep 2012 Link to this post

    Hi Peiyang,

    You can get information about the selected point by listening to the ItemClick event. And then when the ItemClick event is fired use the ChartItemClickEventArgs to obtain the information you need.

    //listen to the ItemClick event
    radChart.DefaultView.ChartArea.ItemClick += ChartArea_ItemClick;
     
    void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
    {
        double selectedPointX = e.DataPoint.XValue;
        double selectedPointY = e.DataPoint.YValue;
     
        //your code here...
    }

    I hope this helps. Kind regards,
    Petar Kirov
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
Back to Top