我有问题以我想要的方式显示网格。但我也不确定是否可以在Silverlight工具包图表中执行此操作。因此,对此的任何帮助或指示都将受到赞赏。
<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轴显示优势值。
所以在某种程度上,它正在分享本月的Yaxis。它可以使用顶部/底部x轴甚至右Y轴来绘制任务和收益值。
你们有什么想法?
感谢。
答案 0 :(得分:1)
以下示例的任务轴位于顶部,福利轴位于底部,左侧是共享的Y轴:
<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>