Lasso and selection issues

4 posts, 0 answers
  1. Steve
    Steve avatar
    43 posts
    Member since:
    May 2014

    Posted 18 Apr Link to this post

    I am using a scatter chart now, and trying to allow the user to select multiple points to turn them on or off. Using the selection mode of "MultipleDataPoints" doesn't seem to work for scatter charts the way the "documentation" implies for the pie charts. When I get the "SelectedPointChanged" event, either I don't understand the purpose of the "NewSelectedPoint" and "OldSelectedPoint", or they aren't working. Basically if I have 5 points 1,2,3,4, and 5, if I click on point 2 and then 3 it gives me new point 3 and old point 2. I would expect not to get an old point called out until I "deselect" a point. Otherwise I don't see how to accomplish what the example shows, with two points offset from the center when the multiple points is selected. Rather than banging my head against the wall on this, I used the custom renderer and hit test method on mouse down method that you showed me to fix the multiple pie selection issue, so I have it been able to accomplish what I need but I would still like to know what I am supposed to do in that situation, or if multiple data point selection is just not supported for scatter charts.

     

    My more pressing issue is that I am now trying to use the lasso selection. However I don't want to zoom. I would like to override the behavior to get the lasso but then do my own action on the lasso'd points (the selection I am doing above, actually). I tried inheriting the class but all of the obvious calls that I could override had no effect.

     

    Alternatively, or perhaps in addition to, I would like to know how to determine what points are in the zoomed area once lasso'd. For double bonus, I would like to be able to lasso a circle with the radius emanating from the moused down point (the radius at the mouse up point).

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 18 Apr Link to this post

    Hi Steve,

    Thank you for writing.

    The arguments in the SelectedPointChanged event always return the currently selected point and the previous one. If the SelectionMode property is set to MultipleDataPoints, the old data point will not be removed from the SelectedPoints collection unless it is deselected. You can always access this collection and get a reference to these data points.

    Regarding your other question, you would indeed need to inherit the LassoZoomController. Then you can override the OnMouseDown, OnMouseMove and OnMouseUp methods with your custom logic. You are also going to need a class responsible for rendering the circle on the chart.

    I am sending you attached a sample implementation for performing a circular lasso selection. In case you are not going to need to zoom in within the chart, you can remove the logic responsible for calculating the scale factors. I am also sending you a short video showing the result on my end.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Steve
    Steve avatar
    43 posts
    Member since:
    May 2014

    Posted 18 Apr in reply to Hristo Merdjanov Link to this post

    Where is the SelectedPoints collection?
  5. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 20 Apr Link to this post

    Hello Steve,

    Thank you for writing back.

    The SelectedDataPoints collection is defined on the Area object of the View. It can be accessed like this: 
    ChartViewSelectedDataPointCollection points = this.radChartView1.View.Area.SelectedDataPoints;

    I hope this information was useful. 

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top