<chart:LineSeries ItemsSource="{Binding Collection}" ShowTooltip="True"
XBindingPath="XValue" YBindingPath="YValue" chart:ChartTooltip.ShowDuration="50000"
>
<chart:LineSeries.TooltipTemplate>
<DataTemplate>
<Border BorderThickness="1" BorderBrush="Black" Background="LightBlue" CornerRadius="3">
<StackPanel Margin="3">
<StackPanel Orientation="Horizontal">
<TextBlock Text="XValue : " FontSize="14" FontWeight="Bold"/>
<TextBlock Text="{Binding XData}" FontSize="14" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="YValue : " FontSize="14" FontWeight="Bold"/>
<TextBlock Text="{Binding YData}" FontSize="14" />
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</chart:LineSeries.TooltipTemplate>
</chart:LineSeries> |
<chart:LineSeries ItemsSource="{Binding Collection}" ShowTooltip="True"
XBindingPath="XValue" YBindingPath="YValue" chart:ChartTooltip.ShowDuration="50000"
> |
<chart:LineSeries.AdornmentsInfo>
<chart:ChartAdornmentInfo ShowLabel="True" Symbol="Ellipse" SymbolHeight="15" SymbolWidth="15" ShowMarker="True" SymbolInterior="{Binding Interior}" >
</chart:ChartAdornmentInfo>
</chart:LineSeries.AdornmentsInfo> |
I want to show tooltip only if the mouse is over the adornment.How can I implement this ? Thanks in advance.
<local:LineSeriesExt ItemsSource="{Binding Collection}" ShowTooltip="True"
XBindingPath="XValue" YBindingPath="YValue" >
<local:LineSeriesExt.AdornmentsInfo>
<chart:ChartAdornmentInfo ShowLabel="True" Symbol="Ellipse" SymbolHeight="20" SymbolWidth="20"
ShowMarker="True" SymbolInterior="{Binding Interior}" >
</chart:ChartAdornmentInfo>
</local:LineSeriesExt.AdornmentsInfo>
</local:LineSeriesExt> |
public class LineSeriesExt : LineSeries
{
protected override void OnMouseMove(MouseEventArgs e)
{
if (e.OriginalSource is Line)
return;
base.OnMouseMove(e);
}
} |
Thanks , It is working as expected.
But I found out that another problem in data binding of line segment to tooltip as below codes. I am binding to "Item" property of tooltip datacontext.
<local:LineSeriesExtension.TooltipTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Item.MyOtherProperty}" />
</DataTemplate>
</local:LineSeriesExtension.TooltipTemplate>
The tooltip for the last adornment is always dispalying the second last adornment information.