开发者

disable wpftoolkit chart datapoint

开发者 https://www.devze.com 2023-02-17 13:29 出处:网络
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 an

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.


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.

disable wpftoolkit chart datapoint

0

精彩评论

暂无评论...
验证码 换一张
取 消