WPF Toolkit Graphical Description: Setting the datapoint Label

I created a simple LineSeries diagram using the WPF toolkit. By default, when you mouse over a datapoint, a label with the value YAxis is displayed. (if I put the mouse on X = 3, Y = 45 datapoint, it will display the label with "45" inside)

I want to change this default behavior to display both the value of the X axis and Y. (if I put the mouse on X = 3, Y = 45 datapoint, it will display the label with "3, 45" inside)

If anyone has a suggestion, this can be great! Thanks and best regards,

Py

+4
source share
1 answer

Here you can find the XAML LineSeries DataPoint style , and the default tooltip is defined as

<ToolTipService.ToolTip> <ContentControl Content="{TemplateBinding FormattedDependentValue}"/> </ToolTipService.ToolTip> 

so you can use the whole style for your application and override the definition of the tooltip, for example:

 <ToolTipService.ToolTip> <StackPanel Margin="2,2,2,2"> <ContentControl Content="{TemplateBinding IndependentValue}" FontSize="12"/> <ContentControl Content="{TemplateBinding DependentValue}" FontSize="12"/> </StackPanel> </ToolTipService.ToolTip> 

and you will see the displayed prompt "X, Y".

+5
source

All Articles