Silverlight 图表 - 堆积面积图与面积图

发布于 2024-10-07 17:47:05 字数 1023 浏览 6 评论 0原文

我目前正在 Silverlight 4.0、Visual Studio 2010 中构建一个图表应用程序。我目前有一些工作正常的面积图,但是我目前正在尝试将其转换为堆积面积图,并且堆积面积图的库/属性似乎非常不同,似乎不可能将数据绑定到 stackarea 图表。使用 stackedarea 图表时,它根本找不到 IndependentValueBinding 或 DependentValueBinding 属性,因此除非我在值中进行硬编码,否则似乎无法构建此图表。有解决方法吗?这个问题在下面的 XAML 中更加清晰地突出显示,其中区域工作正常,而 stackedarea 根本不起作用。

        <ch:Chart x:Name="LineChart"
                  Height="400"
                  VerticalContentAlignment="Center">
            <ch:Chart.Series>
                <ch:StackedAreaSeries Margin="0,0,20,20"
                              Name="LineSeries"
                              IndependentValueBinding = "{Binding Path=Key}"
                              DependentValueBinding = "{Binding Path=Value}" />
                <ch:AreaSeries Margin="0,0,20,20"
                              Name="LineSeries2"
                              IndependentValueBinding = "{Binding Path=Key}"
                              DependentValueBinding = "{Binding Path=Value}" />

I am currently building a charting application in Silverlight 4.0, Visual Studio 2010. I currently have some area charts which are working fine, however I am currently trying to convert it to a stacked area chart and the libraries / properties for the stackedarea chart seem very different and it seems impossible to do data-binding to a stackarea chart. It simply does not find the property IndependentValueBinding or DependentValueBinding when using a stackedarea chart, so unless I hard-code in the values it seems there is no way of building this chart. Is there a workaround to this? The issue is highlighted clearer in the XAML below, where the area works fine and the stackedarea does not work at all.

        <ch:Chart x:Name="LineChart"
                  Height="400"
                  VerticalContentAlignment="Center">
            <ch:Chart.Series>
                <ch:StackedAreaSeries Margin="0,0,20,20"
                              Name="LineSeries"
                              IndependentValueBinding = "{Binding Path=Key}"
                              DependentValueBinding = "{Binding Path=Value}" />
                <ch:AreaSeries Margin="0,0,20,20"
                              Name="LineSeries2"
                              IndependentValueBinding = "{Binding Path=Key}"
                              DependentValueBinding = "{Binding Path=Value}" />

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

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

发布评论

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

评论(1

︶ ̄淡然 2024-10-14 17:47:05

定义一个seriesdefinition,它具有所有绑定属性。然后将系列 def 添加到 stackedarea 系列中。

像这样的东西:

Dim StackedAreaSeries as StackedAreaSeries
Dim SD as Seriesdefintion
SD.independentvaluebinding = ...


定义所有系列属性

然后

StackedAreaSeries.SeriesDefintions.add(SD)

Define a seriesdefintion, which has all of the binding properties. Then add the series def to the stackedarea series.

Something like:

Dim StackedAreaSeries as StackedAreaSeries
Dim SD as Seriesdefintion
SD.independentvaluebinding = ...

.
define all series properties

Then

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