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

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

1 Answer 20 Views
Chart
This is a migrated thread and some comments may be shown as answers.
PEIYANG
Top achievements
Rank 1
PEIYANG asked on 15 Sep 2012, 06:48 PM
When I click one point in the spline chart,How can I get this point (xvalue,yvalue) accoring to what event?

1 Answer, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 19 Sep 2012, 11:59 AM
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.

Tags
Chart
Asked by
PEIYANG
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Share this question
or