Show label on data points in line graph

Aug 8, 2011 at 12:26 PM


Is there any way to show label(with X and Y values) near the data point..?

I guess we need to use "TemplateMarkerGenerator2" but i am unable to do so.

Any pointers..? A working sample with a simple Numeric(X), double(Y) axis would be great!


Sep 30, 2011 at 5:33 AM



yes, it's easy with DataFollowChart.

Marker position (relative to curve's point) could be affected by setting ScreenOffsetX, ScreenOffestX (s. code below)

        <DataTemplate x:Key="followMarkerTemplate">
            <Grid d3:ViewportPanel.ScreenOffsetY="-20" d3:ViewportPanel.ScreenOffsetX="40">
                <Rectangle RadiusX="3" RadiusY="3" Fill="Yellow" Stroke="DarkGray">
                <StackPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal" Margin="3">
                        <TextBlock Text="{Binding Data.Y, StringFormat=V:{0}}" Margin="0,0,3,0"/>
                        <TextBlock Text="{Binding Data.Derivative, StringFormat=D:{0}}"/>