This question is locked. New answers and comments are not allowed.
Hi,
I'm using the example of Chart SimpleFiltering. I want to select on datapoint and I
try to use the "ChartArea_SelectionChanged" event to do it. But the event doesn't work.
My questions as below:
1) Why the ChartArea_SelectionChanged event doesn't work ?
2) How to select one datapoint?
Thanks
I'm using the example of Chart SimpleFiltering. I want to select on datapoint and I
try to use the "ChartArea_SelectionChanged" event to do it. But the event doesn't work.
My questions as below:
1) Why the ChartArea_SelectionChanged event doesn't work ?
2) How to select one datapoint?
Thanks
6 Answers, 1 is accepted
0
Hello Yimi,
When the ChartArea_SelectionChanged event is used for line series it gives information only for the selected series. This is because the InteractivityScope.Item is not supported for series that do not render separate items (Line, Spline, Area, Range, and all their stacked versions). In order to be able to select a PointMark on the line you need to use ChartArea_ItemClick event. More information about Interactivity Effects can be found here.
Greetings,
When the ChartArea_SelectionChanged event is used for line series it gives information only for the selected series. This is because the InteractivityScope.Item is not supported for series that do not render separate items (Line, Spline, Area, Range, and all their stacked versions). In order to be able to select a PointMark on the line you need to use ChartArea_ItemClick event. More information about Interactivity Effects can be found here.
Greetings,
Polina
the Telerik team
0
Yimi
Top achievements
Rank 1
answered on 25 Mar 2011, 10:26 AM
Hi,
Thank you for your help. When I use the ChartArea_ItemClick event and my problem resolved. Now I get a new problem. When I use the ChartArea_ItemClick evnet , I can click any point on the line and I only want to click some pointMarks rather than a whole line.
So, my question is:
1. How to click a specified PointMark to trigger ChartArea_ItemClick event rather than click any point on the line ?
2. Which event I can use when I click one specified PointMark ?
Many Thanks
Thank you for your help. When I use the ChartArea_ItemClick event and my problem resolved. Now I get a new problem. When I use the ChartArea_ItemClick evnet , I can click any point on the line and I only want to click some pointMarks rather than a whole line.
So, my question is:
1. How to click a specified PointMark to trigger ChartArea_ItemClick event rather than click any point on the line ?
2. Which event I can use when I click one specified PointMark ?
Many Thanks
0
Hi Yimi,
At present, this feature is not supported in RadChart out of the box. However, you can take advantage of our UIElement.ChildrenOfType<T>() extension method and directly access the PointMark visuals after the chart data is loaded. For example:
After you get the PointMarks collection, you can attach MouseLeftButtonDown event handler to the desired point:
Note that, in order to use ChildrenOfType<T>() you need to include Telerik.Windows.Controls namespace.
Regards,
At present, this feature is not supported in RadChart out of the box. However, you can take advantage of our UIElement.ChildrenOfType<T>() extension method and directly access the PointMark visuals after the chart data is loaded. For example:
var pointMarks = radChart.ChildrenOfType<
PointMark
>();
After you get the PointMarks collection, you can attach MouseLeftButtonDown event handler to the desired point:
pointMarks[2].AddHandler(MouseLeftButtonDownEvent,
new MouseButtonEventHandler(MouseLeftButtonDownEventHandler), true);
Note that, in order to use ChildrenOfType<T>() you need to include Telerik.Windows.Controls namespace.
Regards,
Polina
the Telerik team
0
Will
Top achievements
Rank 1
answered on 07 Feb 2012, 04:46 AM
Hi,
when i attch event to pointmark,the pontmarkCollections is null ,how can i know pointMark is loaded?
when i attch event to pointmark,the pontmarkCollections is null ,how can i know pointMark is loaded?
0
Hello,
In order to ensure the pointmarks are loaded you can wire to DataBound event in the following manner :
Hope this helps.
Greetings,
Nikolay
the Telerik team
In order to ensure the pointmarks are loaded you can wire to DataBound event in the following manner :
this.RadChart1.DataBound += new EventHandler<
ChartDataBoundEventArgs
>(RadChart1_DataBound);
void RadChart1_DataBound(object sender, ChartDataBoundEventArgs e)
{
Dispatcher.BeginInvoke(new Action(() => RadChart1.ChildrenOfType<
PointMark
>()));
}
Hope this helps.
Greetings,
Nikolay
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Will
Top achievements
Rank 1
answered on 10 Feb 2012, 10:39 AM
Thank you for your help