Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

disable wpftoolkit chart datapoint

Does anybody know how to turn off the datapoints for a noraml LineSeries in a WPFToolkit chart? I find them to be very annoying, and not useful to my purposes, but I can't find a simple property or anything like that on the class itself.

like image 825
A.R. Avatar asked Mar 18 '11 17:03

A.R.


1 Answers

You want to hide them?

It is possible if to set the empty ControlTemplate to the Template property. Here is the example:

<Window.Resources>
    <Style x:Key="InvisibleDataPoint" TargetType="{x:Type charting:DataPoint}">
        <Setter Property="Background" Value="Blue"/>
        <Setter Property="Template" Value="{x:Null}"/>
    </Style>
</Window.Resources>
<Grid>
    <charting:Chart>
        <charting:LineSeries ItemsSource="{Binding ChartItems}" IndependentValuePath="XValue" DependentValuePath="YValue" 
                                 DataPointStyle="{StaticResource InvisibleDataPoint}"/>
    </charting:Chart>
</Grid>

And although the points are invisible, you can set other properties, like Background and change the look of chart.

enter image description here

like image 162
vortexwolf Avatar answered Oct 11 '22 17:10

vortexwolf