解决方法@H_301_4@
你想隐藏它们吗?
可以将空的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>
虽然这些点是不可见的,但您可以设置其他属性,例如背景,并更改图表的外观.
可以将空的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>
虽然这些点是不可见的,但您可以设置其他属性,例如背景,并更改图表的外观.