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

Tooltip for scatter spline data points without showing the ellipses

2 Answers 103 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Shilpa
Top achievements
Rank 1
Shilpa asked on 22 Dec 2015, 03:49 AM

Hi,

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">
                    <telerik:ScatterSeriesDescriptor.Style>
                        <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">
                                <Setter.Value>
                                    <DataTemplate>
                                        <Ellipse Width="10" Height="10"  Fill="{DynamicResource BRUSH_SELECTION}">
                                            <Ellipse.ToolTip>
                                                <ToolTip>
                                                    <ToolTip.Style>
                                                        <Style TargetType="ToolTip">
                                                            <Style.Setters>
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate>
                                                                            <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>
                                                                                    <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"/>
                                                                                    </StackPanel>
                                                                                </StackPanel>
                                                                            </Grid>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
 
                                                            </Style.Setters>
                                                        </Style>
                                                    </ToolTip.Style>
                                                </ToolTip>
                                            </Ellipse.ToolTip>
                                        </Ellipse>
 
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
 
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding IsDashed,Mode=TwoWay}" Value="True">
                                    <Setter Property="DashArray" Value="5"></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </telerik:ScatterSeriesDescriptor.Style>
                </telerik:ScatterSeriesDescriptor >

2 Answers, 1 is accepted

Sort by
0
Accepted
Peshito
Telerik team
answered on 22 Dec 2015, 09:39 AM
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:
​
<telerik:ScatterSeriesDescriptor.Style>
        <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.

Regards,
Peshito
Telerik
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
0
Shilpa
Top achievements
Rank 1
answered on 22 Dec 2015, 11:08 AM

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!

 

Tags
ChartView
Asked by
Shilpa
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Shilpa
Top achievements
Rank 1
Share this question
or