Trackball behavior only in one series

7 posts, 1 answers
  1. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 13 Apr Link to this post

    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

     

     

  2. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 15 Apr Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 15 Apr in reply to Martin Link to this post

    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

  5. Martin
    Admin
    Martin avatar
    1099 posts

    Posted 19 Apr Link to this post

    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.
  6. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 19 Apr Link to this post

    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

  7. Answer
    Martin
    Admin
    Martin avatar
    1099 posts

    Posted 20 Apr Link to this post

    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.
  8. Amige
    Amige avatar
    44 posts
    Member since:
    Dec 2013

    Posted 20 Apr in reply to Martin Link to this post

    Hello Martin,

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

    Thanks,

    Alberto

Back to Top
UI for WPF is Visual Studio 2017 Ready