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

Change and filter TrackBall tooltip information

12 Answers 115 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 10 Sep 2018, 12:20 PM
Hi Telerik Team,

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

Sort by
0
Dinko
Telerik team
answered on 13 Sep 2018, 07:55 AM
Hello Thomas,

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Roberto
Top achievements
Rank 1
answered on 27 Aug 2019, 06:31 PM
Hello 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
0
Dinko
Telerik team
answered on 30 Aug 2019, 11:02 AM
Hi Roberto,

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Roberto
Top achievements
Rank 1
answered on 24 Sep 2019, 07:49 AM

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

0
Roberto
Top achievements
Rank 1
answered on 24 Sep 2019, 02:38 PM

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

0
Martin Ivanov
Telerik team
answered on 26 Sep 2019, 02:54 PM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Martin Ivanov
Telerik team
answered on 27 Sep 2019, 10:29 AM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Roberto
Top achievements
Rank 1
answered on 27 Sep 2019, 06:06 PM

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

0
Roberto
Top achievements
Rank 1
answered on 28 Sep 2019, 11:25 AM

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

0
Roberto
Top achievements
Rank 1
answered on 28 Sep 2019, 11:31 AM

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

0
Martin Ivanov
Telerik team
answered on 30 Sep 2019, 11:57 AM

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Roberto
Top achievements
Rank 1
answered on 02 Oct 2019, 08:24 AM

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

Tags
Chart
Asked by
Thomas
Top achievements
Rank 1
Answers by
Dinko
Telerik team
Roberto
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or