hi,
I use the following template for tooltip.
but the XValue and YValue are not coming in tooltip. SeriesName is coming though.
please give me some pointers.
<DataTemplate x:Key="CompassTooltipTemplate" DataType="s:SeriesInfo">
<StackPanel>
<StackPanel.Resources>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="LightGray" />
<Setter Property="FontSize" Value="12" />
</Style>
</StackPanel.Resources>
<TextBlock Text="{Binding SeriesName}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding YValue}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding XValue}" />
</StackPanel>
</StackPanel>
</DataTemplate>
- Vibin Varghese asked 7 years ago
- You must login to post comments
Hi Vibin,
Thanks for your question. The values don’t appear, because the properties are of the IComparable type. In XAML, to have a binding to a property of an interface type, you have to either specify StringFormat or to use ValueConverter.
SeriesInfo provides two additional properties FormattedXValue, FormattedYValue of type String. You could bind to these instead if you don’t want to modify the values.
Hope this helps!
Best regards,
Yuriy
- Yuriy Zadereckiy answered 7 years ago
-
Thanks!!Worked!!!
- You must login to post comments
Please login first to submit.