Silverlight 图表 - 堆积面积图与面积图
我目前正在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
定义一个seriesdefinition,它具有所有绑定属性。然后将系列 def 添加到 stackedarea 系列中。
像这样的东西:
。
定义所有系列属性
然后
Define a seriesdefintion, which has all of the binding properties. Then add the series def to the stackedarea series.
Something like:
.
define all series properties
Then