ChartTrackBallBehavior Performances

7 posts, 0 answers
  1. Marcello
    Marcello avatar
    58 posts
    Member since:
    Apr 2013

    Posted 01 Apr 2015 Link to this post

    Hi,

    Performances of ChartTrackBallBehavior isn't good when I work with a lot of series (20/30) with a lot of points (>20.000 each).
    In effect I cant ensure conditions for a good implementation of "Get Closest" functions because my datapoints is always ordered.

    Exists a strategy for inform series that Dataset is ordered or override GetClosest functions?

    Thank's marc.
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 02 Apr 2015 Link to this post

    Hello Marcello,

    Originally the trackball and tooltip behaviors were created with the intention that they would be used when the chart is not that busy. This is because when there are so many items the trackball/tooltip can provide only a very small piece of information compared to the whole picture (you will see trackinfo for a single point when there are 20 thousand points). This is one of the reasons that both the trackball and tooltip were not optimized.

    However, we have seen many customers using the two behaviors in busy scenarios and we have identified the need to improve the performance in such cases.

    Unfortunately, currently you cannot override the FindClosestPoints method, because it is internal. I think that the best way to go here is not to use the behavior. If you know your items are sorted, and you can find them very fast - simply implement your own trackball-like control. You can place it completely out of the chart, on top of it. You can use the PlotAreaClip property of the chart to find where exactly you can position this control.

    Let us know if you need more information.

    Regards,
    Petar Marchev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Marcello
    Marcello avatar
    58 posts
    Member since:
    Apr 2013

    Posted 02 Apr 2015 in reply to Petar Marchev Link to this post

    Hi Petar,

    Thanks very much.
    In effect I'm implementing my own trackballs. I ask you comments about my strategy:

    - I use MouseMove and MouseLeave events on chart for mouse intercept.
    - I find X value using Chart.ConvertPointToData(e.GetPosition(Chart)).FirstValue
    - I use my own closest points strategy and I find one point for each series.
    - I use CustomAnnotations to show the balls

    marc.

  5. Marcello
    Marcello avatar
    58 posts
    Member since:
    Apr 2013

    Posted 02 Apr 2015 in reply to Petar Marchev Link to this post

    Hi Petar,

    Thanks very much.
    In effect I'm implementing my own trackballs. I ask you comments about my strategy:

    - I use MouseMove and MouseLeave events on chart for mouse intercept.
    - I find X value using Chart.ConvertPointToData(e.GetPosition(Chart)).FirstValue
    - I use my own closest points strategy and I find one point for each series.
    - I use CustomAnnotations to show the balls

    marc.

  6. Marcello
    Marcello avatar
    58 posts
    Member since:
    Apr 2013

    Posted 02 Apr 2015 in reply to Petar Marchev Link to this post

    Hi Petar,

    Thanks very much.
    In effect I'm implementing my own trackballs. I ask you comments about my strategy:

    - I use MouseMove and MouseLeave events on chart for mouse intercept.
    - I find X value using Chart.ConvertPointToData(e.GetPosition(Chart)).FirstValue
    - I use my own closest points strategy and I find one point for each series.
    - I use CustomAnnotations to show the balls

    marc.

  7. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 02 Apr 2015 Link to this post

    Hello,

    I will try to provide my insight on the matter

    - I use MouseMove and MouseLeave events on chart for mouse intercept.
    This is fine, but keep in mind that you may be interested only when the mouse is inside the PlotAreaRect of the chart. So you may consider implementing PlotAreaMouseMove and PlotAreaMouseLeave logic instead of the ChartMouseMove and ChartMouseLeave logic.

    - I find X value using Chart.ConvertPointToData(e.GetPosition(Chart)).FirstValue
    Exactly what I would have suggested.

    - I use my own closest points strategy and I find one point for each series.
    Perfect.

    - I use CustomAnnotations to show the balls
    If here you mean the chart's annotations, I cannot fully commit to this approach. What I meant was to use a custom control that is fully outside the chart. I say this because of performance considerations. You can test this and perhaps in this case the performance will not drop, but the problem is as follows. When you add/remove/modify a chart annotation, the whole chart gets invalidated. This means that many things are recalculated. Not everything is updated, but since there are some calculations in the way, performance, when moving the annotation, may slightly drop.

    So here I suggest you make a quick test. Move some annotation on mouse move and look to see if you will see a delay. If not, there shouldn't be anything to worry about and you can use this example as a guide on how to get trackball-like looking annotations. If you see a delay, you should consider the original suggestion where you don't modify any of the chart elements.

    Let us know if you have any other questions.

    Regards,
    Petar Marchev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  8. Marcello
    Marcello avatar
    58 posts
    Member since:
    Apr 2013

    Posted 02 Apr 2015 in reply to Petar Marchev Link to this post

    Hi Petar,

    - PlotAreaMouseMove and PlotAreaMouseLeave
    ....mmm... this events don't exists.

    - I cannot fully commit to this approach...
    Ok, I try to implement a complete independant TrackBall UI.

    Thanks very much,
    marc.
Back to Top
UI for WPF is Visual Studio 2017 Ready