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

Trackball on CatagoricalAxis

1 Answer 114 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Flemming
Top achievements
Rank 1
Flemming asked on 19 Oct 2017, 11:55 AM

Hi

I am using ChartView for visualizing some data.

The data is a list of doubles and strings. The string is a category and the double is a value.

The data is shown as points – and it works fine (see attached image)

Vertical axis is a LinearAxis.
Horizontal axis is a CategoricalAxis.
The series is a PointSeries.

I now want to use the trackball feature to highlight the point closest to the mouse. I have used this feature before on non-categorical axis and it worked fine. But in this case only one point for each category gets highlighted. The point highlightet is always the first point in the list in each category.

Do you have any idea what is wrong?

/Flemming Rosenbrandt


1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 24 Oct 2017, 09:01 AM
Hello Flemming,

Indeed, the trackball will show the first point of the series in the hovered category. Actually, the trackball works with the direction in which the trackball is moving - in your case the horizontal axis, so the closest data point will be the closest in the X direction. The vertical axis won't be taken into account. To achieve your requirement you can use can create a custom trackball using chart annotations and implement some custom snapping there. You can see such approach shown in the TrackBallLikeAnnotations SDK example. You can use the sample and extend it to take into account also the vertical mouse position.

I hope this helps.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ChartView
Asked by
Flemming
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or