更新时间:2023-12-05 21:37:04
您要隐藏呢?
有可能的,如果设置为空控件模板
到模板
属性。
下面是例子:
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.