且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

禁用wpftoolkit图表数据点

更新时间: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.

禁用wpftoolkit图表数据点