繁体   English   中英

禁用wpftoolkit图表数据点

[英]disable wpftoolkit chart datapoint

有人知道如何在WPFToolkit图表中关闭noraml LineSeries的数据点吗? 我发现它们非常烦人,对我的目的没用,但是我找不到一个简单的属性或类似的东西本身。

你想隐藏它们吗?

可以将空的ControlTemplate设置为Template属性。 这是一个例子:

<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>

虽然这些点是不可见的,但您可以设置其他属性,例如Background并更改图表的外观。

在此输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM