Show position of a chartingToolkit:LineDataPoint in a collection
-
I have set up the following tooltip to show the x and y values of datapoints within a WPF linechart, what I would also like to do is show the index within the collection that the point uses. How do I show this please?
<Style x:Key="ToolTipDataPointStyle" TargetType="chartingToolkit:LineDataPoint">
<Setter Property="Background" Value="Green"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="chartingToolkit:LineDataPoint">
<Grid x:Name="Root" Opacity="1">
<ToolTipService.ToolTip>
<StackPanel Margin="2,2,2,2">
<ContentControl Content="{Binding HoleSize}" ContentStringFormat="Hole Size: {0}" />
<ContentControl Content="{Binding PulseWidth}" ContentStringFormat="Pulse Width: {0}"/>
<!--<ContentControl Content="{Binding Path.[0]}" ContentStringFormat="Data = {0}"/>-->
</StackPanel>
</ToolTipService.ToolTip>
<Ellipse StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> -
I have set up the following tooltip to show the x and y values of datapoints within a WPF linechart, what I would also like to do is show the index within the collection that the point uses. How do I show this please?
<Style x:Key="ToolTipDataPointStyle" TargetType="chartingToolkit:LineDataPoint">
<Setter Property="Background" Value="Green"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="chartingToolkit:LineDataPoint">
<Grid x:Name="Root" Opacity="1">
<ToolTipService.ToolTip>
<StackPanel Margin="2,2,2,2">
<ContentControl Content="{Binding HoleSize}" ContentStringFormat="Hole Size: {0}" />
<ContentControl Content="{Binding PulseWidth}" ContentStringFormat="Pulse Width: {0}"/>
<!--<ContentControl Content="{Binding Path.[0]}" ContentStringFormat="Data = {0}"/>-->
</StackPanel>
</ToolTipService.ToolTip>
<Ellipse StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>Hi surfluds, May be this link could help you. http://endofstream.com/charts-creating-custom-style-for-linedatapoint/