I'm currently looking into the Telerik WPF chart control (RadCartesianChart with line series).
What I'm trying to figure out is a way to change the tooltip information of a TrackBall.
Currently the ToolTip info says Value: x, Category: y like in your screenshot on this
page: https://docs.telerik.com/devtools/wpf/controls/radchartview/features/behaviors/trackball
I want to create a different design for it, reading, Date: xx.xx.xxxx, NumberOf: y and
filter all 0 values (y) out of the tooltip info. I'm using MVVM pattern with C#. I got to
the point where I can change the tooltip text (binding to TrackInfoUpdated event) but at
this point I can't get the values of the current TrackBall data series. In the VS2017 debugger
the values and categories are visible but it seems that these values are not publicly available.
Maybe you've an idea how to get the values?
Thanks in advance.
Best Regards,
Thomas
12 Answers, 1 is accepted
To customize the tack ball info you can specify custom DataTemplate for the TrackBallInfoTemplate property of the series which you are using. Check the TrackBall help article in our documentation which describes the TrackBall properties. Basically, the DataContext of the TrackBallInfoTemplate is DataPointInfo object. This object exposes DataPoint property which holds the current hover point. You can directly bind to its Value and Category properties. Check the attached project which demonstrates this.
Hope this project is helpful.
Regards,
Dinko
Progress Telerik
Please, in your case, when you move between two datapoints, the trackball will show you the closest (as you indicated in the code). But how can I do to show the previous data point and not the closest?
I do not want to see future points. I just want to see the closest point before the vertical line.
I tried everything but I cannot achieve anything. Some idea?
Thanks
RG
This is the default behavior of the TrackBall. Our chart component does not expose an API to change this functionality of the TrackBall. You can consider using ToolTip behavior, for example, which is shown when the mouse is over a data point.
Regards,
Dinko
Progress Telerik
Dear Dinko,
Thanks for your feedback.It is a pity that TrackBall does not have such a functionality :-(.
And what is the best way to show the current value in the vertical line? I mean, not the closest point, only the values which crosses the vertical line. Do you have some sample of it?
Thanks a lot
Dear Dinko,
I could see the main problem I have. When I change from LineSeries type to StepLineSeries, the graph does not have the behavior I want. I want that the rise of the grap is when there is a change of value. Please, have a look to the attached picture and let me know how I can fix it as I want.
Thanks
R
Hello Roberto,
We will need some additional time to process your query. Will get back to you with more information on this tomorrow.
Regards,
Martin Ivanov
Progress Telerik
Hi R,
To achieve your requirement and position the raisers of the step-line series on the values, you can set the RaisersPosition property of StepLineSeries to BetweenTicks.
<telerik:StepLineSeries RisersPosition="BetweenTicks">
To manually control the trackball position, you can set its Position property manually. You can do this in the position changing event. There you can replace the value of the NewPosition property of the event arguments.
Can you try those suggestions and let us know how it goes?
Regards,
Martin Ivanov
Progress Telerik
Hello Martin,
Thanks for your reply. Unfortunately, this option did not work.
This option was one of the first things I tried. But I did not have success. I cannot see any difference in the graph (steplineseries) between the three options (onticks, betweenticks, default).
Please, see attached the real difference between LineSeries and StepLineSeries. Line series is correct and showing me the value of last DataPoint (GOOD). The Step LineSeries shows the correct value too but it is drawed bad. And the appearence is the same regardless the RiserPosition property.
I would be really glad if you can give me further information to fix this problem.
Thanks
Dear Martin,
I know where the problem was. The ItemsSource where ordered by Descending. This was the problem. I changed the orderbydescending to Orderby and now the graph is showed as I wanted.
Thanks for your support.
Roberto
Dear Martin,
I know where the problem was. The ItemsSource where ordered by Descending. This was the problem. I changed the orderbydescending to Orderby and now the graph is showed as I wanted.
Thanks for your support.
Roberto
Hello Roberto,
I am bit puzzled how to shown visualization is achieved. It seems that the chart has two LinearAxes, but it uses StepLineSeries, which is not supported, so I will guess I am missing something. Can you send some runnable code snippets showing your setup and also some sample data to check this? Maybe ~10 data points. Also, you can open a new support ticket and attach a runnable project there.
Regards,
Martin Ivanov
Progress Telerik
Dear Martin,
As I explained, the problem was that the itemssource were ordered by descending. Once I ordered them by ascencing, the graph was drawed properly. Honestly, I cannot understand it becasue the points are the same. But, it works.
Thanks
Roberto