1
比方說,我有這個XAML(與Live ChartBuilder創建):如何「堆棧」一個Silverlight條形圖?
<Grid xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:datavis="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit" xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" xmlns:utility="clr-namespace:Utility;assembly=ChartBuilder" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<charting:Chart>
<charting:Chart.Series>
<charting:BarSeries
Title="Series 1">
<charting:BarSeries.ItemsSource>
<utility:ObservableObjectCollection>
<sys:Double>1</sys:Double>
<sys:Double>2.33333325386047</sys:Double>
<sys:Double>3.66666674613953</sys:Double>
<sys:Double>5</sys:Double>
</utility:ObservableObjectCollection>
</charting:BarSeries.ItemsSource>
</charting:BarSeries>
<charting:BarSeries
Title="Series 2">
<charting:BarSeries.ItemsSource>
<utility:ObservableObjectCollection>
<sys:Double>1</sys:Double>
<sys:Double>2.33333325386047</sys:Double>
<sys:Double>3.66666674613953</sys:Double>
<sys:Double>5</sys:Double>
</utility:ObservableObjectCollection>
</charting:BarSeries.ItemsSource>
</charting:BarSeries>
</charting:Chart.Series>
</charting:Chart>
</Grid>
將會產生兩個水平顯示條的條形圖。我如何堆疊這些?
謝謝。我在這裏發佈後,我遇到了該鏈接。我不太喜歡偷盜工具包源代碼的方式(而不是從中衍生出來),但它會起作用。 – 2009-07-23 21:21:04