Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Chart > select PointMarks on a line graph

Not answered select PointMarks on a line graph

Feed from this thread
  • Yimi avatar

    Posted on Mar 22, 2011 (permalink)

    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

    Reply

  • Polina Polina admin's avatar

    Posted on Mar 25, 2011 (permalink)

    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,
    Polina
    the Telerik team

    Reply

  • Yimi avatar

    Posted on Mar 25, 2011 (permalink)

    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  

    Reply

  • Polina Polina admin's avatar

    Posted on Mar 30, 2011 (permalink)

    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:
    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

    Reply

  • Will avatar

    Posted on Feb 6, 2012 (permalink)

    Hi,
    when i attch event to pointmark,the pontmarkCollections is null ,how can i know pointMark is loaded? 

    Reply

  • Nikolay Nikolay admin's avatar

    Posted on Feb 9, 2012 (permalink)

    Hello,

    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 >>

    Reply

  • Will avatar

    Posted on Feb 10, 2012 (permalink)

    Thank you for your help

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Chart > select PointMarks on a line graph
Related resources for "select PointMarks on a line graph"

Silverlight Chart Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]