Silverlight工具包图表:带有条形和线形的多个系列 [英] Silverlight Toolkit chart: Multiple series with bar and line

查看:123
本文介绍了Silverlight工具包图表:带有条形和线形的多个系列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法以自己想要的方式显示网格.但是我也不确定在Silverlight工具包图表中是否可以做到这一点.因此,对此的任何帮助或指导将不胜感激.

I am having problem to show the grid in a way that I wanted. But I am also not sure whether it is possible to do that in the Silverlight toolkit chart. So any help or direction on this would be appreciated.

<Grid x:Name="LayoutRoot" Background="White">
<charting:Chart x:Name="myChart" Width="600" Height="400">
<charting:BarSeries                 
Title="Tasks"
ItemsSource="{Binding Path=Data1}"
IndependentValueBinding="{Binding Month}"
DependentValueBinding="{Binding Task}"
DependentRangeAxis="{Binding ElementName=TaskAxis}">
</charting:BarSeries>
<charting:LineSeries                 
Title="Benefits"
ItemsSource="{Binding Path=Data1}"
IndependentValueBinding="{Binding Month}"
DependentValueBinding="{Binding Benefits}"
DependentRangeAxis="{Binding ElementName=BenefitsAxis}">
</charting:LineSeries>
<charting:Chart.Axes>
<charting:LinearAxis Orientation="Y" Location="Left" Title="First" x:Name="TaskAxis" />
<charting:LinearAxis Orientation="Y" Location="Right" Title="Second" x:Name="BenefitsAxis" />
</charting:Chart.Axes>
 </charting:Chart>
</Grid>

鉴于上述摘要,可以在左侧的Y轴显示月份,在顶部的x轴显示任务值,在底部的x轴显示福利值.

Given the above snippet, is it possible to have the Yaxis on the left to show the month and the top x-axis to show the tasks value, and bottom x-axis to show the benefits value.

因此,它在某种程度上共享了本月的Yaxis.并且可以使用上下x轴甚至右Y轴来绘制任务和收益值.

So in a way, it is sharing the Yaxis for the month. and it can use either top/bottom x-axis or even right Yaxis to plot the tasks and benefits value.

你们怎么看?

谢谢.

推荐答案

下面的示例在顶部有任务轴,在底部有福利轴,在左侧有共享的Y轴:

The example below has the task axis on the top and the benefits axis on the bottom, with a shared Y-axis on the left:

<toolkit:Chart x:Name="myChart" Width="600" Height="800">
    <toolkit:BarSeries                 
            Title="Tasks"
            ItemsSource="{Binding Path=Data1}"
            IndependentValueBinding="{Binding Month}"
            DependentValueBinding="{Binding Task}"
            DependentRangeAxis="{Binding ElementName=TaskAxis}">
    </toolkit:BarSeries>

    <toolkit:BarSeries                 
            Title="Benefits"
            ItemsSource="{Binding Path=Data1}"
            IndependentValueBinding="{Binding Month}"
            DependentValueBinding="{Binding Benefits}"
            DependentRangeAxis="{Binding ElementName=BenefitsAxis}">
    </toolkit:BarSeries>

    <toolkit:Chart.Axes>
        <toolkit:LinearAxis Orientation="X" Location="Top" Title="Task" x:Name="TaskAxis" />
        <toolkit:LinearAxis Orientation="X" Location="Bottom" Title="Benefits" x:Name="BenefitsAxis" />
    </toolkit:Chart.Axes>
</toolkit:Chart>

这篇关于Silverlight工具包图表:带有条形和线形的多个系列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆