Tooltip not shown in Scatter Line Series

6 posts, 0 answers
  1. Shilpa
    Shilpa avatar
    43 posts
    Member since:
    Dec 2015

    Posted 15 Jun Link to this post

    HI Telerik,

    I am using ScatterLineSeries and I want to show tooltip on the points on Mouse hover. In order to show tooltip I used Point Template while styling the chart. Since I do not want to see the ellipse, I set the color to transparent.  But I have a huge number of points in the series and the UI freezes for long time while rendering the Lines. Then I realized that PointTemplate is causing the freeze. I removed it and the chart is rendering very fast. But the tooltip is not shown anymore. Please help me how to show tooltip without using Point Template.

     

    Thanks,

    Shilpa

  2. Dinko
    Admin
    Dinko avatar
    206 posts

    Posted 16 Jun Link to this post

    Hi Shilpa,

    When you are setting a PointTemplate an additional ContentPresenter will be included in the visual tree for each data point. Also, the elements defined in the template will be added to the view. That is why we suggest you to avoid using the PointTemplate when you have a lot of data points in the series.

    In your case, we can suggest using the DefaultVisualStyle property. It is of type Style and you can set a custom style to change the appearance of the data points. Your custom style should target the native Path component. Basically, you can set the Fill property to transparent, this way the tooltip will be visible when the mouse is over the data point.
    <telerik:ScatterLineSeries.DefaultVisualStyle>
        <Style TargetType="Path">
            <Setter Property="Fill" Value="Transparent"/>
        </Style>
    </telerik:ScatterLineSeries.DefaultVisualStyle>
    However, keep in mind that the chart's Palette has a bigger priority than the default visual style - in other words if the Palette property is set the DefaultVisualStyle of the series will be ignored.

    In addition, you can check the following help articles.
    Customizing CartesianChart Series
    - Selection

    Regards,
    Dinko
    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. Shilpa
    Shilpa avatar
    43 posts
    Member since:
    Dec 2015

    Posted 16 Jun in reply to Dinko Link to this post

    Hi Dinko,

    By default the tooltips of series are shown for their datapoints only. By default each bar represents a datapoint for Bar series, but for Line, Spline and Area series the datapoints are the points that connect the line segments. You should specify the desired shape, color and size for these points to be visualized using PointTemplate. Without it you won't see practically no point and respectively no tooltip for these series.

     

    This is from Telerik Documentation. I am using Scatter Line Series and I am not able to see tooltip if I don't define PointTemplate. Can you please show me an example where you use ScatterLineSeries and show tooltip of x and y values of the data points wihtout using PointTemplate?

    Thanks,

    Shilpa

  5. Dinko
    Admin
    Dinko avatar
    206 posts

    Posted 21 Jun Link to this post

    Hi Shilpa,

    In your case when you have a large number of data points is better to use the DefaultVisualStyle property so you can style the data points of the ScatterLineSeries. This will ensure that the chart won't create additional ContentPresenter for the custom point template. Instead, it will use just the style.

    I have prepared a sample project (attached to this reply) demonstrating how you can use the DefaultVisualStyle property to show tooltip in ScatterLineSeries.

    As a side note, you can specify a XamlRenderOptions and set its DefaultVisualsRenderMode property to Separate.  This way you can increase the performance. You can take a look at the Rendering help article where this render option is further described.

    Regards,
    Dinko
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Shilpa
    Shilpa avatar
    43 posts
    Member since:
    Dec 2015

    Posted 21 Jun in reply to Dinko Link to this post

    HI Dinko,

    I loaded the sample project you have attached but I am not able to see tooltip here on mouse hover. Which version of dll have you used?

    I am using version 2014.3.1410.45. Also I am not able to get Render Option. Can you please help me?

    Thanks,

    Shilpa

  7. Dinko
    Admin
    Dinko avatar
    206 posts

    Posted 24 Jun Link to this post

    Hi Shilpa,

    Let me start with that from Q1 2016 version of our controls we added support for default visuals for all series. That is why the DefaultVisualStyle property of the ScatterLineSeries is not applied and the tooltip is not displayed. For the same reason, the DefaultVisualsRenderMode property of the XamlRenderOptions is not accessible.

    As for the rendering options. I have misled you in my previous reply. Basically, setting rendering options will not increase the performance of the tooltip when you have a large number of data points place in the chart. That is why I logged a feature request in our Feedback Portal where you can track its progress and vote for its implementation.

    I have used the latest version of our assemblies in the attached application. I recommend you to update your DLLs to the latest version in order to apply a custom style to the DefaultVisualStyle property of the ScatterLineSeries.

    Regards,
    Dinko
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WPF is Visual Studio 2017 Ready