4

I have create a simple LineSeries chart using WPF toolkit. By default, on mouse over a datapoint, it display a label with YAxis value. (if I put my mouse on the X=3,Y=45 datapoint, it will display a label with "45" inside)

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

If somebody have a suggestion, it could be great ! Thank you and best regards,

PY

oOnez
  • 887
  • 2
  • 11
  • 23

1 Answers1

5

Here you can find the XAML style of a LineSeries DataPoint and by default the tooltip is defined as

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

so, you can take the whole style to your application and override the tooltip definition 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 willget displayed the "X, Y" tooltip you need.

michele
  • 2,091
  • 1
  • 16
  • 24