Tooltip for scatter spline data points without showing the ellipses

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

    Posted 21 Dec 2015 Link to this post


    I am using ScatterSplineSeries and I have defined tooltip template in PointTemplate. My requirement is such that I do not want to see the data points visually but on mouse hover on point tooltip to be shown. Here is my XAML. I tried setting the Visibility property of the Ellipse but then tooltip also stopped showing. How to acheive this ? Please help me.

    <telerik:ScatterSeriesDescriptor ItemsSourcePath="Points" YValuePath="YValue" XValuePath="XValue">
                            <Style TargetType="telerik:ScatterSplineSeries">
                                <Setter Property="StrokeThickness" Value="{Binding StrokeThickness}"></Setter>
                                <Setter Property="Stroke" Value="{Binding Color}"></Setter>
                                <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource BooleanToVisibilityConverter}}"></Setter>
                                <Setter Property="DisplayName" Value="{Binding Name}"></Setter>
                                <Setter Property="PointTemplate">
                                            <Ellipse Width="10" Height="10"  Fill="{DynamicResource BRUSH_SELECTION}">
                                                            <Style TargetType="ToolTip">
                                                                    <Setter Property="Template">
                                                                                <Grid Background="{DynamicResource BRUSH_TOOLTIP}" HorizontalAlignment="Right" Width="120" Height="70">
                                                                                    <StackPanel Margin="5" Orientation="Vertical">
                                                                                        <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal" Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                                                                            <TextBlock Text="Volume: " FontWeight="Bold"/>
                                                                                            <TextBlock Text="{Binding XValue}" FontWeight="Bold"/>
                                                                                            <TextBlock Text=" %" FontWeight="Bold"/>
                                                                                        <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal" Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                                                                            <TextBlock Text="Dose: " FontWeight="Bold" />
                                                                                            <TextBlock Text="{Binding YValue}" FontWeight="Bold" />
                                                                                            <TextBlock Text=" Gy" FontWeight="Bold"/>
                                    <DataTrigger Binding="{Binding IsDashed,Mode=TwoWay}" Value="True">
                                        <Setter Property="DashArray" Value="5"></Setter>
                    </telerik:ScatterSeriesDescriptor >

  2. Answer
    Peshito avatar
    524 posts

    Posted 22 Dec 2015 Link to this post

    Hello Shilpa,

    Could you elaborate a bit more on the scenario. If I understood you correctly you would like to have your series hidden but to keep the PointTemplate represented as an ellipse still visible on the plot? If that so, you could use a ScatterPointSeries instead of a ScatterLineSeries. You could also achieve this with the ScatterLine by simply setting the Stroke color of your series to Transparent:
            <Style TargetType="telerik:ScatterSplineSeries">
                <Setter Property="StrokeThickness" Value="2"></Setter>
                <Setter Property="Stroke" Value="Transparent"></Setter>

    In case you are trying to just hide the ellipse points and keep the series visible, you could achieve the same by setting the Fill of your ellipse to Transparent.

    I would also suggest you to take a look at chart's trackball behavior as it might also be useful for your scenario.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Shilpa
    Shilpa avatar
    43 posts
    Member since:
    Dec 2015

    Posted 22 Dec 2015 in reply to Peshito Link to this post

    Hi Peshito,

    I wanted the spline to be shown and points to be invisible with tooltip. And as you suggested I have made the Fill Transparent and that gave the result exactly how I wanted. 

    Thanks a lot!


Back to Top