We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Bug? Within LineSeries TooltipTemplate, YData and Item are not synchronised.

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



1 Reply

DA Devi Aruna Maharasi Murugan Syncfusion Team September 19, 2016 12:41 PM UTC

Hi Tim, 
  
Thanks for contacting Syncfusion Support. 
  
The behavior of the line series is, the YData of line segment (Line between two points) is calculated from its nearest data point and item of the segment are corresponding data of the segment from underlying model. This same behavior is applied to the adornments used in the line series. 
However, your requirement (adornment having corresponding index item) can be attained by using the scatter series rather than adornments. We have prepared a demo sample based on this and it can be downloaded from below link 
  
  
Regards, 
Devi 
 


  
  


Loader.
Live Chat Icon For mobile
Up arrow icon