2012-04-07 7 views
0

私が望む方法でグリッドを表示するのに問題があります。しかし、Silverlightのツールキットのチャートでそれが可能かどうかもわかりません。だから、これに関する助けや指導は感謝します。上記のスニペットを考えるSilverlight Toolkit chart:棒グラフと線グラフの複数のシリーズ

<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> 

、それはメリット値を表示するには、タスクの値、及び下x軸を示すために、月とトップx軸を示すために、左側のY軸を持つことが可能です。

それで、ある意味では、月のYaxisを共有しています。上/下のx軸または右のYaxisのいずれかを使用して、タスクと利益の値をプロットすることができます。

あなたはどう思いますか?

ありがとうございました。

答えて

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> 
関連する問題