我正在嘗試用戶System.Windows.Forms.DataVisualization.Charting來創建折線圖。我一直在使用System.Windows.Controls.DataVisualization.Toolkit一段時間,但想擺脫我所有的.NET 3.5引用。我找不到任何資源使用DataVisualization.Charting在.NET 4.0中使用DataVisualization.Charting創建Chart
使用System.Windows.Controls.DataVisualization.Toolkit圖的一個例子...
<DVC:Chart Name="mcChart" Width="Auto" Height="225" Padding="0" Margin="0,-5,0,0" >
<DVC:Chart.Series>
<DVC:LineSeries x:Name="lsActual" Title=" Expenditures" IndependentValueBinding="{Binding Month}" DependentValueBinding="{Binding Amt}" DataPointStyle="{StaticResource redLineDataPoint}" />
<DVC:LineSeries x:Name="lsBudget" Title=" Budget" IndependentValueBinding="{Binding Month}" DependentValueBinding="{Binding Amt}" DataPointStyle="{StaticResource blueLineDataPoint}"/>
<DVC:LineSeries x:Name="lsProjection" Title=" Projection" IndependentValueBinding="{Binding Month}" DependentValueBinding="{Binding Amt}" DataPointStyle="{StaticResource greenLineDataPoint}" />
</DVC:Chart.Series>
</DVC:Chart>
System.Windows.Forms.DataVisualization.Charting ...
?
參考
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:CHR="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
xmlns:DVC="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
圖表內置於WPF .NET 4.0中,還是您必須使用Toolkit? – knockando 2010-11-08 19:45:37