开发者

WPF Toolkit Chart - Collapsing Chart Points

开发者 https://www.devze.com 2023-01-30 20:48 出处:网络
I have a chart with 1000s of points of data and am wondering how to remove the data points?They slow the whole process down considerably.I researched about having to change the style, is there another

I have a chart with 1000s of points of data and am wondering how to remove the data points? They slow the whole process down considerably. I researched about having to change the style, is there another way?

Removing (collapsing) DataPoints in a LineSeries?

<Grid>
    <chartingToolkit:Chart
       Width="Auto" Height="Auto"
       Background="Transparent" Panel.ZIndex="3">
        <chartingToolkit:LineSeries Title="Symbol" Background="Transparent"
      IndependentValueBinding="{Binding Path=Key}"
      DependentValueBinding="{Binding Path=Value}"
      ItemsSource="{Binding Path=SymbolData}" 
      Dat开发者_运维问答aContext="{Binding}">
            <chartingToolkit:LineSeries.DataPointStyle>
                <Style TargetType="{x:Type chartingToolkit:LineDataPoint}">
                    <Setter Property="Background" Value="Red"/>
                    <Setter Property="Visibility" Value="Collapsed"/>
                </Style>
            </chartingToolkit:LineSeries.DataPointStyle>
        </chartingToolkit:LineSeries>
    </chartingToolkit:Chart>
</Grid>

I thought the code above would've worked, but apparently not...

Further research, even this answer did not work : /

Removing markers from silverlight line or area series

Cheers for the help.


Setting the point styles to Collapsed won't solve your issue as the objects will still be in the visual tree affecting rendering time. Since you have set up bindings for the data points, the only way to remove them is to remove your business objects that they are bound to.

Also, since you're talking about performance, it's worth noting that the WPF toolkit's performance is much worse than some other free charting components. See this article on charting component's performance comparison - it was written comparing Silverlight versions, but according to my experience it holds for WPF as well. Using Visiblox, DD3 or Visifire would probably significantly improve the performance of your charts. (Full disclosure: I have been involved in developing in Visiblox)

0

精彩评论

暂无评论...
验证码 换一张
取 消