WPF 工具包图表 - 折叠图表点

发布于 2024-10-07 11:48:33 字数 1342 浏览 0 评论 0原文

我有一个包含 1000 个数据点的图表,我想知道如何删除这些数据点?它们大大减慢了整个过程。我研究过必须改变风格,还有其他方法吗?

删除(折叠)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}" 
      DataContext="{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>

我认为上面的代码会'已经工作了,但显然没有......

进一步的研究,即使这个答案也不起作用:/

从 silverlight 线或区域系列中删除标记

为帮助干杯。

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}" 
      DataContext="{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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奶茶白久 2024-10-14 11:48:33

将点样式设置为折叠并不能解决您的问题,因为对象仍位于视觉树中,影响渲染时间。由于您已经为数据点设置了绑定,因此删除它们的唯一方法是删除它们绑定到的业务对象。

另外,由于您谈论的是性能,因此值得注意的是,WPF 工具包的性能比其他一些免费图表组件差得多。请参阅这篇关于图表组件的文章性能比较 - 它是为了比较 Silverlight 版本而编写的,但根据我的经验,它也适用于 WPF。使用 Visiblox、DD3 或 Visifire 可能会显着提高图表的性能。 (全面披露:我曾参与 Visiblox 的开发)

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文