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

Trackball behavior only in one series

6 Answers 261 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Amige
Top achievements
Rank 1
Veteran
Amige asked on 13 Apr 2016, 09:10 PM

Hi,

I have a RadCartesianChart control showing 2 ScatterLineSeries, I want to have the Trackball behavior only in one of the series, I added templates with an empty instance of DataTemplate like this:

<telerik:ScatterLineSeries.TrackBallInfoTemplate>
                                                    <DataTemplate/>
                                                </telerik:ScatterLineSeries.TrackBallInfoTemplate>
 
                                                <telerik:ScatterLineSeries.TrackBallTemplate>
                                                    <DataTemplate/>
                                                </telerik:ScatterLineSeries.TrackBallTemplate>

This way I don't show the popup neither the indicator, but I still have the snap effect.

Is it possible to hide or remove the snap effect on one series?

Regards,

Alberto

 

 

6 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 15 Apr 2016, 07:31 AM
Hello Alberto,

To display information in the trackball only for a single series you can subscribe to the TrackInfoUpdated event of the ChartTrackBallBehavior and remove the data points of the other series from the event arguments.
void trackBallBehavior_TrackInfoUpdated(object sender, TrackBallInfoEventArgs e)
{
    var dpInfos = e.Context.DataPointInfos;
    // remove all infos that you do not want to display
}

Regards,
Martin
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Amige
Top achievements
Rank 1
Veteran
answered on 15 Apr 2016, 09:57 PM

Hi Martin,

What I would also like is to remove the snap effect of the trackball line on one series. In the attached image I have 2 series (blue and red) on the blue series I am showing the trackball and the info and also I want the trackball line to snap to the series data points, so I don't have to do anything with this series.

But in the red series I don't want to show the trackball neither the info (so far, I already achieved this), but the trackball line is still snapping to the series data points.

Is there a way to accomplish this?

 

Regards,

Alberto

0
Martin Ivanov
Telerik team
answered on 19 Apr 2016, 09:40 AM
Hi Alberto,

The trackball will snap only to the data points presented in the DataPointInfos collection of the event arguments. You can take a look at the attached project and see how to remove the info and snapping on a specific series.

Regards,
Martin
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Amige
Top achievements
Rank 1
Veteran
answered on 19 Apr 2016, 03:26 PM

Hi Martin,

Thanks for the sample project. I don't know if it is because of my version of Telerik controls (I am using the 2014.1.331.45 version) but the trackball is still snapping on both series, as you can see in the attached image.

Only the red series is showing the information but the trackball is snapping on both series.

Do you think this could be related to the controls version?

Thanks,

Alberto

0
Accepted
Martin Ivanov
Telerik team
answered on 20 Apr 2016, 07:14 AM
Hi Alberto,

Yes, this was an issue few releases back. It was fixed in Q3 2014. I recommend you to upgrade to the latest version of UI for WPF so that you can take advantage of the newest features and bug fixes.

An alternative approach that can be used to achieve your requirement is do use the chart's annotations to implement trackball-like visual element, instead of using the trackball behavior.

Regards,
Martin
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Amige
Top achievements
Rank 1
Veteran
answered on 20 Apr 2016, 09:25 PM

Hello Martin,

I'll try to upgrade my version of UI for WPF.

Thanks,

Alberto

Tags
Chart
Asked by
Amige
Top achievements
Rank 1
Veteran
Answers by
Martin Ivanov
Telerik team
Amige
Top achievements
Rank 1
Veteran
Share this question
or