AD
Administrator
Syncfusion Team
May 12, 2008 04:43 AM UTC
Hi Tiago,
Thanks for your interest in Syncfusion products. ChartSeries click event does not return the column on which it was clicked, but using the MouseEventArgs of the event we can get the column of the chartseries.
The following lines of code can be used to get the chart point on which click was made.
C# Code:
Point pt = e.GetPosition((UIElement)sender);
//get the x axis value based on the clicked co - ordinates
double Xvalue = area.PointToValue(area.PrimaryAxis, pt);
//get the Y axis value based on the clicked co - ordinates
double Yvalue = area.PointToValue(area.SecondaryAxis, pt);
The following lines of code can be used to get the column on which click was made.
C# Code:
void ChartSeries1_Click(object sender, MouseEventArgs e)
{
ChartSeries series = (ChartSeries)sender;
HitTestResult hr = VisualTreeHelper.HitTest(this, e.GetPosition((UIElement)chart1.Areas[0]));
}
By using the VisualHit property of the HitTestResult, each chart column of the chart can be obtained.
Let me know if you have any queries.
Thanks for your interests Syncfusion products.
Regards,
Athaur