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

simulate item click in a chart

3 Answers 88 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Chris Thierry
Top achievements
Rank 1
Chris Thierry asked on 20 Oct 2010, 03:11 PM
Hi, I have this method already defined in my silverlight application:

public

 

 

void chart_Service_ItemClick(object sender, ChartItemClickEventArgs e)

 

{
    my code....
}

I need to call this method for simulating an item click in a pie chart, so I'm calling the method chart_Service_ItemClick

How can I define the e parameter?

chart_Service_ItemClick(chart_Service, ???)

In this method I'm using the e parameter, so I canĀ“t send null, I need to define a correct one, could you please tell me how to define my e parameter of type ChartItemClickEventArgs ?

Thank you.

 

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 26 Oct 2010, 09:49 AM
Hi Chris,

Unforunately you can't simulate ItemClick event like this. As you know which DataPoint you want to click
there is no need to simulate ItemClick like this. You can create a method which does the same job which accepts the DataPoint as a parameter, having in mind that every DataPoint knows its DataSeries through the DataSeries property.

Kind regards,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris Thierry
Top achievements
Rank 1
answered on 26 Oct 2010, 01:45 PM
Hi Evgenia!
Do you have an example?
Thank you.
0
Carlos Sesma
Top achievements
Rank 1
answered on 27 Oct 2010, 03:25 PM
void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
{
    CheckDataPoint(e.DataPoint);
}
void CheckDataPoint(DataPoint mypoint)
{
    //TODO:add some code
}
 
void AlsoCallCheckDataPoint()
{
    CheckDataPoint(topChart.DefaultView.ChartArea.DataSeries[0].Single(s => (s.DataItem as Company).Name == "AAA"));
}

hope this helps.
regards.
Tags
Chart
Asked by
Chris Thierry
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Chris Thierry
Top achievements
Rank 1
Carlos Sesma
Top achievements
Rank 1
Share this question
or