I have a chart with a LineSeries and am trying to set a TooltipTemplate. The problem is that YData and Item are not synchronised within the DataTemplate, and so the following template can display different values in each TextBox even though they should always be equal, given that the LineSeries Y-axis is bound to Item.Y.
<DataTemplate x:Key="tooltipTemplate">
<StackPanel>
<TextBlock Text="{Binding YData}" />
<TextBlock Text="{Binding Item.Y}" />
</StackPanel>
</DataTemplate>
It seems that YData comes from the closest data point while Item comes from the previous data point. This behaviour of Item also means that it can never be accessed for the last data point; this is having particular problems when using adornments as hovering over the last marker returns data from the previous data point (it took a while to track that down!).
I may be able to get around this using an adornment template, assuming Item exists in that context and its behaviour is more sensible.
So, am I missing something or is this a bug? And can I work around it?
Thanks
Tim Rawlinson