有人知道如何关闭 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
并更改图表的外观。
关于c# - 禁用 wpftoolkit 图表数据点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5355425/