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

ChartTrackBallBehavior Performances

5 Answers 80 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Marcello
Top achievements
Rank 1
Iron
Marcello asked on 01 Apr 2015, 12:26 PM
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.

5 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 02 Apr 2015, 08:23 AM
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.

 
0
Marcello
Top achievements
Rank 1
Iron
answered on 02 Apr 2015, 08:56 AM
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.

0
Marcello
Top achievements
Rank 1
Iron
answered on 02 Apr 2015, 08:56 AM
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.

0
Marcello
Top achievements
Rank 1
Iron
answered on 02 Apr 2015, 08:57 AM
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.

0
Petar Marchev
Telerik team
answered on 02 Apr 2015, 12:36 PM
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.

 
Tags
ChartView
Asked by
Marcello
Top achievements
Rank 1
Iron
Answers by
Petar Marchev
Telerik team
Marcello
Top achievements
Rank 1
Iron
Share this question
or