赞
踩
System.Drawing.dll
System.Windows.Forms.dll
WindowsFormsIntegration.dll
System.Windows.Forms.DataVisualization.dll
xmlns:Wchart="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
**ps:Windows窗口 设置 AllowsTransparency="False",才能显示Winfrom Chart控件**
<Grid Margin="4 4 4 2"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="100"/> </Grid.ColumnDefinitions> <Grid Margin="5" Background="WhiteSmoke"> <WindowsFormsHost > <Wchart:Chart x:Name="ChartPlot" > <!--<Wchart:Chart.ChartAreas> <Wchart:ChartArea> <Wchart:ChartArea.AxisY> <Wchart:Axis></Wchart:Axis> </Wchart:ChartArea.AxisY> </Wchart:ChartArea> </Wchart:Chart.ChartAreas>--> </Wchart:Chart> </WindowsFormsHost> </Grid> <StackPanel x:Name="IsEnableChannel" Orientation="Vertical" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center"> </StackPanel> </Grid>
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
#region 初始化图表 private ChartArea AREA = new ChartArea() { Name = "Line" }; // 画图区域 private Legend LEGEND = new Legend(); // 一个图例 /// <summary> /// 初始化图表 /// </summary> /// <param name="lineCount">线条数</param> private void initChart(int lineCount) { ChartPlot.Series.Clear(); //清除线条 ChartPlot.ChartAreas.Clear(); //清除画图区域 ChartPlot.Legends.Clear(); //清除图例 AREA.AxisX
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。