加标题:

 using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
// ... namespace SideBySideBar2D {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e) {
// Create an empty chart.
ChartControl sideBySideBarChart = new ChartControl(); // Create the first side-by-side bar series and add points to it.
Series series1 = new Series("Side-by-Side Bar Series 1", ViewType.Bar);
series1.Points.Add(new SeriesPoint("A", ));
series1.Points.Add(new SeriesPoint("B", ));
series1.Points.Add(new SeriesPoint("C", ));
series1.Points.Add(new SeriesPoint("D", )); // Create the second side-by-side bar series and add points to it.
Series series2 = new Series("Side-by-Side Bar Series 2", ViewType.Bar);
series2.Points.Add(new SeriesPoint("A", ));
series2.Points.Add(new SeriesPoint("B", ));
series2.Points.Add(new SeriesPoint("C", ));
series2.Points.Add(new SeriesPoint("D", )); // Add the series to the chart.
sideBySideBarChart.Series.Add(series1);
sideBySideBarChart.Series.Add(series2); // Hide the legend (if necessary).
sideBySideBarChart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; // Rotate the diagram (if necessary).
((XYDiagram)sideBySideBarChart.Diagram).Rotated = true; // Add a title to the chart (if necessary).
ChartTitle chartTitle1 = new ChartTitle();
chartTitle1.Text = "Side-by-Side Bar Chart";
sideBySideBarChart.Titles.Add(chartTitle1); // Add the chart to the form.
sideBySideBarChart.Dock = DockStyle.Fill;
this.Controls.Add(sideBySideBarChart);
} }
}

含有加标题

 using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace DXApplication1chart1
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
public Form1()
{
InitializeComponent();
} private void Form1_Load(object sender, EventArgs e)
{ } private void button1_Click(object sender, EventArgs e)
{
this.xtraTabControl1.TabPages.Add("普通折线图");//添加一个page
ChartControl lineChart = new ChartControl();
Series series1 = new Series("通过人数", ViewType.Line);
series1.ArgumentScaleType = ScaleType.Numerical;
((LineSeriesView)series1.View).LineMarkerOptions.Kind = MarkerKind.Triangle;
((LineSeriesView)series1.View).LineStyle.DashStyle = DashStyle.Dash; //series1.Points.Add(new SeriesPoint(1, new double[] { 2 }));
series1.Points.Add(new SeriesPoint(, ));//即便是个数组,仍然只用第一个数
series1.Points.Add(new SeriesPoint(, new double[] { }));
series1.Points.Add(new SeriesPoint(, new double[] { }));
series1.Points.Add(new SeriesPoint(, new double[] { }));
series1.Points.Add(new SeriesPoint(, new double[] { }));
series1.Points.Add(new SeriesPoint(, new double[] { }));
series1.Points.Add(new SeriesPoint(, new double[] { }));
series1.Points.Add(new SeriesPoint(, new double[] { }));
//series1.CheckableInLegend = true;
//series1.CheckedInLegend = true;
lineChart.Legend.UseCheckBoxes = true;//图例可以勾选 Series series2 = new Series("报名人数", ViewType.Line);
series2.ArgumentScaleType = ScaleType.Numerical;
((LineSeriesView)series2.View).LineMarkerOptions.Kind = MarkerKind.Cross;
((LineSeriesView)series2.View).LineStyle.DashStyle = DashStyle.DashDotDot;
series2.Points.Add(new SeriesPoint(, new double[] { }));
series2.Points.Add(new SeriesPoint(, new double[] { }));
series2.Points.Add(new SeriesPoint(, new double[] { }));
series2.Points.Add(new SeriesPoint(, new double[] { }));
series2.Points.Add(new SeriesPoint(, new double[] { }));
series2.Points.Add(new SeriesPoint(, new double[] { }));
series2.Points.Add(new SeriesPoint(, new double[] { }));
series2.Points.Add(new SeriesPoint(, new double[] { }));
lineChart.Series.Add(series1); lineChart.Series.Add(series2); lineChart.Legend.Visible = true;
((XYDiagram)lineChart.Diagram).Rotated = false;
lineChart.Dock = DockStyle.Fill; lineChart.Size = new System.Drawing.Size(, );
this.Controls.Add(lineChart);
int tabPagesCount = this.xtraTabControl1.TabPages.Count - ;
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChart);
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; }
public void ShowSeries(ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{ //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % ));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility =DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
}
lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
lineChartControl.Legend.Visible = true;//图例可见
((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl); } private void button2Pic2_Click(object sender, EventArgs e)
{
this.xtraTabControl2.TabPages.Add("三角函数图");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl = new ChartControl();//实例化一个ChartControl
lineChartControl.Legend.UseCheckBoxes = true;//图例可以勾选 //产生数据
List<double> xaxesList = new List<double>();//x轴数据
List<double> ySinList = new List<double>();//系列1-y轴数据
List<double> yCosList = new List<double>();//系列2-y轴数据
List<double> yTanList = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList.Add(i);
ySinList.Add(Math.Sin(i));
yCosList.Add(Math.Cos(i));
yTanList.Add(Math.Sin(i) + Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList = new List<List<double>>();
YList.Add(ySinList);
YList.Add(yCosList);
YList.Add(yTanList);
//系列内容名称
List<string> seriesTextList = new List<string>();//系列内容名称
seriesTextList.Add("cos");
seriesTextList.Add("sin");
seriesTextList.Add("cos+sin");
//系列名称
List<Series> seriesNameList = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList.Add(new Series(seriesTextList[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line
}
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex <; seriesIndex++)
{
ShowSeries(lineChartControl, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);
}
//显示
int tabPagesCount = this.xtraTabControl2.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl2.TabPages[tabPagesCount].Controls.Add(lineChartControl);//将ChartControl这个控件添加到这个page中
this.xtraTabControl2.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page }
}
}

技巧:1.当不知道哪个变量代表啥意思时,可以右键查看定义。这样就不必凡事看别人的资料了。

2.之所以放在list中,是因为这样可以方便的读取excel放入list。


用循环加载不同数据,在画第二幅图是出现错误:

“System.ArgumentException”类型的未经处理的异常在 DevExpress.XtraCharts.v14.1.dll 中发生

其他信息: Can't set the series view's pane, because the specified pane isn't default and isn't contained in the diagram's collection of panes.

解决:最容易的就是我实现知道花几个图,然后,用chartControl拉出来这几个图,然后直接引用就可以啦。---这种方法好像不行。

还有别的方法吗?https://documentation.devexpress.com/CoreLibraries/DevExpress.XtraCharts.XYDiagramSeriesViewBase.Pane.property

 using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace WindowsFormsApplication2devexpressChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
ChartControl chartControl1 = new ChartControl(); // Create two series.
Series series1 = new Series("Series 1", ViewType.Bar);
Series series2 = new Series("Series 2", ViewType.Line); // Add points to them, with their arguments different.
series1.Points.Add(new SeriesPoint("A", ));
series1.Points.Add(new SeriesPoint("B", ));
series1.Points.Add(new SeriesPoint("C", ));
series1.Points.Add(new SeriesPoint("D", ));
series2.Points.Add(new SeriesPoint("I", ));
series2.Points.Add(new SeriesPoint("II", ));
series2.Points.Add(new SeriesPoint("III", ));
series2.Points.Add(new SeriesPoint("IV", )); // Add both series to the chart.
chartControl1.Series.AddRange(new Series[] { series1, series2 }); // Hide the legend (optional).
chartControl1.Legend.Visible = false; // Cast the chart's diagram to the XYDiagram type,
// to access its axes and panes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram; // Add secondary axes to the diagram, and adjust their options.
diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
diagram.SecondaryAxesX[].Alignment = AxisAlignment.Near;
diagram.SecondaryAxesY[].Alignment = AxisAlignment.Near; // Add a new additional pane to the diagram.
diagram.Panes.Add(new XYDiagramPane("My Pane")); // Assign both the additional pane and, if required,
// the secondary axes to the second series.
LineSeriesView myView = (LineSeriesView)series2.View;
myView.AxisX = diagram.SecondaryAxesX[];
myView.AxisY = diagram.SecondaryAxesY[];
// Note that the created pane has the zero index in the collection,
// because the existing Default pane is a separate entity.
myView.Pane = diagram.Panes[]; // Customize the layout of the diagram's panes.
diagram.PaneDistance = ;
diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
diagram.DefaultPane.Weight = 1.2; // Add the chart to the form.
chartControl1.Dock = DockStyle.Fill;
this.Controls.Add(chartControl1);
}
}
}

devexpress绘图

解决方法如下,不要在一个循环里面用两个画图函数(下面的方法还是没有解决,因为第一个图总可以用两个ShowSeries)函数,第二个就不行了。

要这样:

 using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace WindowsFormsApplication2devexpressChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
#region
//int tabPagesCount = 0;
//ChartControl chartControl1 = new ChartControl(); //// Create two series.
//Series series1 = new Series("Series 1", ViewType.Bar);
//Series series2 = new Series("Series 2", ViewType.Line); //// Add points to them, with their arguments different.
//series1.Points.Add(new SeriesPoint("A", 10));
//series1.Points.Add(new SeriesPoint("B", 12));
//series1.Points.Add(new SeriesPoint("C", 17));
//series1.Points.Add(new SeriesPoint("D", 14));
//series2.Points.Add(new SeriesPoint("I", 2500));
//series2.Points.Add(new SeriesPoint("II", 3800));
//series2.Points.Add(new SeriesPoint("III", 1500));
//series2.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl1.Series.AddRange(new Series[] { series1, series2 }); //// Hide the legend (optional).
//chartControl1.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram = (XYDiagram)chartControl1.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView = (LineSeriesView)series2.View;
//myView.AxisX = diagram.SecondaryAxesX[0];
//myView.AxisY = diagram.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView.Pane = diagram.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram.PaneDistance = 10;
//diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl1.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count-1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl1);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; ////
//ChartControl chartControl2 = new ChartControl(); //// Create two series.
//Series series3 = new Series("Series 3", ViewType.Bar);
//Series series4= new Series("Series 4", ViewType.Line); //// Add points to them, with their arguments different.
//series3.Points.Add(new SeriesPoint("A", 10));
//series3.Points.Add(new SeriesPoint("B", 12));
//series3.Points.Add(new SeriesPoint("C", 17));
//series3.Points.Add(new SeriesPoint("D", 14));
//series4.Points.Add(new SeriesPoint("I", 2500));
//series4.Points.Add(new SeriesPoint("II", 3800));
//series4.Points.Add(new SeriesPoint("III", 1500));
//series4.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl2.Series.AddRange(new Series[] { series3, series4 }); //// Hide the legend (optional).
//chartControl2.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram2 = (XYDiagram)chartControl2.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram2.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram2.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram2.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram2.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram2.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView2 = (LineSeriesView)series2.View;
//myView2.AxisX = diagram2.SecondaryAxesX[0];
//myView2.AxisY = diagram2.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView2.Pane = diagram2.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram2.PaneDistance = 10;
//diagram2.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram2.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram2.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl2.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count - 1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl2);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; #endregion this.xtraTabControl1.TabPages.Add("三角函数图");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl = new ChartControl();//实例化一个ChartControl
lineChartControl.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl.Series.Clear();
//产生数据
List<double> xaxesList = new List<double>();//x轴数据
List<double> ySinList = new List<double>();//系列1-y轴数据
List<double> yCosList = new List<double>();//系列2-y轴数据
List<double> yTanList = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList.Add(i);
ySinList.Add(Math.Sin(i));
yCosList.Add(Math.Cos(i));
yTanList.Add(Math.Sin(i) + Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList = new List<List<double>>();
YList.Add(ySinList);
YList.Add(yCosList);
YList.Add(yTanList);
//系列内容名称
List<string> seriesTextList = new List<string>();//系列内容名称
seriesTextList.Add("400kPa理论值cos 我有中文");
seriesTextList.Add("600kPa理论值cos 我有中文");
seriesTextList.Add("800kPa理论值cos+sin 我有中文");
//系列名称
List<Series> seriesNameList = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList.Add(new Series(seriesTextList[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line
}
//将系列假如chartControl
//for (int seriesIndex = 0; seriesIndex < 3; seriesIndex++)
//{
// ShowSeries(ref lineChartControl, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);
//}
//显示
int tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第二个图
this.xtraTabControl1.TabPages.Add("三角函数图2");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl2 = new ChartControl();//实例化一个ChartControl
lineChartControl2.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl2.Series.Clear(); //产生数据
List<double> xaxesList2 = new List<double>();//x轴数据
List<double> ySinList2 = new List<double>();//系列1-y轴数据
List<double> yCosList2 = new List<double>();//系列2-y轴数据
List<double> yTanList2 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList2.Add(i);
ySinList2.Add(Math.Sin(i));
yCosList2.Add(Math.Cos(i));
yTanList2.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList2 = new List<List<double>>();
YList2.Add(ySinList2);
YList2.Add(yCosList2);
YList2.Add(yTanList2);
//系列内容名称
List<string> seriesTextList2 = new List<string>();//系列内容名称
seriesTextList2.Add("cos 我有中文");
seriesTextList2.Add("sin 我有中文");
seriesTextList2.Add("2cos+sin我有中文");
//系列名称
List<Series> seriesNameList2 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList2.Add(new Series(seriesTextList2[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line }
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeries(ref lineChartControl2, seriesNameList2[seriesIndex], seriesTextList2[seriesIndex], xaxesList2, YList2[seriesIndex], seriesIndex);
//ShowSeriesTheory(ref lineChartControl2, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//This is an error!!!!!!!!!!!!!!!!!!!!!! } //显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl2);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第三个图
this.xtraTabControl1.TabPages.Add("三角函数图3");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl3 = new ChartControl();//实例化一个ChartControl
lineChartControl3.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl3.Series.Clear(); //产生数据
List<double> xaxesList3 = new List<double>();//x轴数据
List<double> ySinList3 = new List<double>();//系列1-y轴数据
List<double> yCosList3 = new List<double>();//系列2-y轴数据
List<double> yTanList3 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList3.Add(i);
ySinList3.Add(Math.Sin(i));
yCosList3.Add(Math.Cos(i));
yTanList3.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList3 = new List<List<double>>();
YList3.Add(ySinList3);
YList3.Add(yCosList3);
YList3.Add(yTanList3);
//系列内容名称
List<string> seriesTextList3 = new List<string>();//系列内容名称
seriesTextList3.Add("cos 我有中文");
seriesTextList3.Add("sin 我有中文");
seriesTextList3.Add("2cos+sin我有中文");
//系列名称
List<Series> seriesNameList3 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList3.Add(new Series(seriesTextList3[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line }
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeries(ref lineChartControl3, seriesNameList3[seriesIndex], seriesTextList3[seriesIndex], xaxesList3, YList3[seriesIndex], seriesIndex);
// ShowSeriesTheory(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//This is an error!!!!!!!!!!!!!!!!!!!!!!
ShowSeries(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);
} //显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl3);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page }
public void ShowSeries(ref ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{ //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % ));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
}
lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
lineChartControl.Legend.Visible = true;//图例可见
((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl); } public void ShowSeriesTheory(ref ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{ //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % ));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
} lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
lineChartControl.Legend.Visible = true;//图例可见
((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl); } private void Form1_Load(object sender, EventArgs e)
{ }
}
}

devexpress画图

//将系列假如chartControl
for (int seriesIndex = 0; seriesIndex < 3; seriesIndex++)
{
ShowSeries(ref lineChartControl3, seriesNameList3[seriesIndex], seriesTextList3[seriesIndex], xaxesList3, YList3[seriesIndex], seriesIndex);
// ShowSeriesTheory(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//错误
ShowSeries(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//正确
}


尝试了,画两个图也没问题啊

 using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace WindowsFormsApplication2devexpressChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
#region
//int tabPagesCount = 0;
//ChartControl chartControl1 = new ChartControl(); //// Create two series.
//Series series1 = new Series("Series 1", ViewType.Bar);
//Series series2 = new Series("Series 2", ViewType.Line); //// Add points to them, with their arguments different.
//series1.Points.Add(new SeriesPoint("A", 10));
//series1.Points.Add(new SeriesPoint("B", 12));
//series1.Points.Add(new SeriesPoint("C", 17));
//series1.Points.Add(new SeriesPoint("D", 14));
//series2.Points.Add(new SeriesPoint("I", 2500));
//series2.Points.Add(new SeriesPoint("II", 3800));
//series2.Points.Add(new SeriesPoint("III", 1500));
//series2.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl1.Series.AddRange(new Series[] { series1, series2 }); //// Hide the legend (optional).
//chartControl1.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram = (XYDiagram)chartControl1.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView = (LineSeriesView)series2.View;
//myView.AxisX = diagram.SecondaryAxesX[0];
//myView.AxisY = diagram.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView.Pane = diagram.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram.PaneDistance = 10;
//diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl1.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count-1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl1);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; ////
//ChartControl chartControl2 = new ChartControl(); //// Create two series.
//Series series3 = new Series("Series 3", ViewType.Bar);
//Series series4= new Series("Series 4", ViewType.Line); //// Add points to them, with their arguments different.
//series3.Points.Add(new SeriesPoint("A", 10));
//series3.Points.Add(new SeriesPoint("B", 12));
//series3.Points.Add(new SeriesPoint("C", 17));
//series3.Points.Add(new SeriesPoint("D", 14));
//series4.Points.Add(new SeriesPoint("I", 2500));
//series4.Points.Add(new SeriesPoint("II", 3800));
//series4.Points.Add(new SeriesPoint("III", 1500));
//series4.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl2.Series.AddRange(new Series[] { series3, series4 }); //// Hide the legend (optional).
//chartControl2.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram2 = (XYDiagram)chartControl2.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram2.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram2.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram2.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram2.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram2.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView2 = (LineSeriesView)series2.View;
//myView2.AxisX = diagram2.SecondaryAxesX[0];
//myView2.AxisY = diagram2.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView2.Pane = diagram2.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram2.PaneDistance = 10;
//diagram2.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram2.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram2.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl2.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count - 1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl2);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; #endregion this.xtraTabControl1.TabPages.Add("三角函数图");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl = new ChartControl();//实例化一个ChartControl
lineChartControl.Legend.UseCheckBoxes = true;//图例可以勾选 //产生数据
List<double> xaxesList = new List<double>();//x轴数据
List<double> ySinList = new List<double>();//系列1-y轴数据
List<double> yCosList = new List<double>();//系列2-y轴数据
List<double> yTanList = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList.Add(i);
ySinList.Add(Math.Sin(i));
yCosList.Add(Math.Cos(i));
yTanList.Add(Math.Sin(i) + Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList = new List<List<double>>();
YList.Add(ySinList);
YList.Add(yCosList);
YList.Add(yTanList);
//系列内容名称
List<string> seriesTextList = new List<string>();//系列内容名称
seriesTextList.Add("cos");
seriesTextList.Add("sin");
seriesTextList.Add("cos+sin");
//系列名称
List<Series> seriesNameList = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList.Add(new Series(seriesTextList[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line
}
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeries(lineChartControl, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);
}
//显示
int tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第二个图 //尝试第二个图
this.xtraTabControl1.TabPages.Add("三角函数图2");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl2 = new ChartControl();//实例化一个ChartControl
lineChartControl2.Legend.UseCheckBoxes = true;//图例可以勾选 //产生数据
List<double> xaxesList2 = new List<double>();//x轴数据
List<double> ySinList2 = new List<double>();//系列1-y轴数据
List<double> yCosList2 = new List<double>();//系列2-y轴数据
List<double> yTanList2 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList2.Add(i);
ySinList2.Add(Math.Sin(i));
yCosList2.Add(Math.Cos(i));
yTanList2.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList2 = new List<List<double>>();
YList2.Add(ySinList2);
YList2.Add(yCosList2);
YList2.Add(yTanList2);
//系列内容名称
List<string> seriesTextList2 = new List<string>();//系列内容名称
seriesTextList2.Add("cos");
seriesTextList2.Add("sin");
seriesTextList2.Add("2cos+sin");
//系列名称
List<Series> seriesNameList2 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList2.Add(new Series(seriesTextList2[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line
}
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeries(lineChartControl2, seriesNameList2[seriesIndex], seriesTextList2[seriesIndex], xaxesList2, YList2[seriesIndex], seriesIndex);
}
//显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl2);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page }
public void ShowSeries(ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{ //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % ));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
}
lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
lineChartControl.Legend.Visible = true;//图例可见
((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl); }
}
}

chartcontrol画两个图,没问题啊

在代码中图例加上中文也没事:


 using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace WindowsFormsApplication2devexpressChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
#region
//int tabPagesCount = 0;
//ChartControl chartControl1 = new ChartControl(); //// Create two series.
//Series series1 = new Series("Series 1", ViewType.Bar);
//Series series2 = new Series("Series 2", ViewType.Line); //// Add points to them, with their arguments different.
//series1.Points.Add(new SeriesPoint("A", 10));
//series1.Points.Add(new SeriesPoint("B", 12));
//series1.Points.Add(new SeriesPoint("C", 17));
//series1.Points.Add(new SeriesPoint("D", 14));
//series2.Points.Add(new SeriesPoint("I", 2500));
//series2.Points.Add(new SeriesPoint("II", 3800));
//series2.Points.Add(new SeriesPoint("III", 1500));
//series2.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl1.Series.AddRange(new Series[] { series1, series2 }); //// Hide the legend (optional).
//chartControl1.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram = (XYDiagram)chartControl1.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView = (LineSeriesView)series2.View;
//myView.AxisX = diagram.SecondaryAxesX[0];
//myView.AxisY = diagram.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView.Pane = diagram.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram.PaneDistance = 10;
//diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl1.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count-1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl1);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; ////
//ChartControl chartControl2 = new ChartControl(); //// Create two series.
//Series series3 = new Series("Series 3", ViewType.Bar);
//Series series4= new Series("Series 4", ViewType.Line); //// Add points to them, with their arguments different.
//series3.Points.Add(new SeriesPoint("A", 10));
//series3.Points.Add(new SeriesPoint("B", 12));
//series3.Points.Add(new SeriesPoint("C", 17));
//series3.Points.Add(new SeriesPoint("D", 14));
//series4.Points.Add(new SeriesPoint("I", 2500));
//series4.Points.Add(new SeriesPoint("II", 3800));
//series4.Points.Add(new SeriesPoint("III", 1500));
//series4.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl2.Series.AddRange(new Series[] { series3, series4 }); //// Hide the legend (optional).
//chartControl2.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram2 = (XYDiagram)chartControl2.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram2.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram2.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram2.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram2.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram2.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView2 = (LineSeriesView)series2.View;
//myView2.AxisX = diagram2.SecondaryAxesX[0];
//myView2.AxisY = diagram2.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView2.Pane = diagram2.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram2.PaneDistance = 10;
//diagram2.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram2.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram2.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl2.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count - 1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl2);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; #endregion this.xtraTabControl1.TabPages.Add("三角函数图");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl = new ChartControl();//实例化一个ChartControl
lineChartControl.Legend.UseCheckBoxes = true;//图例可以勾选
ChartTitle chartTitle1 = new ChartTitle();
chartTitle1.Text = "Side-by-Side Bar Chart";
lineChartControl.Titles.Add(chartTitle1);
lineChartControl.Series.Clear();
//产生数据
List<double> xaxesList = new List<double>();//x轴数据
List<double> ySinList = new List<double>();//系列1-y轴数据
List<double> yCosList = new List<double>();//系列2-y轴数据
List<double> yTanList = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList.Add((double)i);
ySinList.Add(Math.Sin(i));
yCosList.Add(Math.Cos(i));
yTanList.Add(Math.Sin(i) + Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList = new List<List<double>>();
YList.Add(ySinList);
YList.Add(yCosList);
YList.Add(yTanList);
//系列内容名称
List<string> seriesTextList = new List<string>();//系列内容名称
seriesTextList.Add("400kPa理论值cos 我有中文1");
seriesTextList.Add("600kPa理论值cos 我有中文1");
seriesTextList.Add("800kPa理论值cos+sin 我有中文1");
//系列名称
List<Series> seriesNameList = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList.Add(new Series(seriesTextList[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line
}
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeries(ref lineChartControl, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex); }
//显示
int tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第二个图
this.xtraTabControl1.TabPages.Add("三角函数图2");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl2 = new ChartControl();//实例化一个ChartControl
lineChartControl2.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl2.Series.Clear(); //产生数据
List<double> xaxesList2 = new List<double>();//x轴数据
List<double> ySinList2 = new List<double>();//系列1-y轴数据
List<double> yCosList2 = new List<double>();//系列2-y轴数据
List<double> yTanList2 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList2.Add((double)i);
ySinList2.Add(Math.Sin(i));
yCosList2.Add(Math.Cos(i));
yTanList2.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList2 = new List<List<double>>();
YList2.Add(ySinList2);
YList2.Add(yCosList2);
YList2.Add(yTanList2);
//系列内容名称
List<string> seriesTextList2 = new List<string>();//系列内容名称
seriesTextList2.Add("400kPa实验值cos 我有中文2");
seriesTextList2.Add("600kPa实验值sin 我有中文2");
seriesTextList2.Add("800kPa实验值2cos+sin我有中文2");
//系列名称
List<Series> seriesNameList2 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList2.Add(new Series(seriesTextList2[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line }
//合成一个系列
List<string> seriesTextList12 = new List<string>();
seriesTextList12.AddRange(seriesTextList);
seriesTextList12.AddRange(seriesTextList2);
List<Series> seriesNameList12 = new List<Series>();
seriesNameList12.AddRange(seriesNameList);
seriesNameList12.AddRange(seriesNameList2);
List<List<double>> xaxesList12 = new List<List<double>>();//x轴数据
xaxesList12.Add(xaxesList);
xaxesList12.Add(xaxesList);
xaxesList12.Add(xaxesList);
xaxesList12.Add(xaxesList2);
xaxesList12.Add(xaxesList2);
xaxesList12.Add(xaxesList2);
List<List<double>> YList12 = new List<List<double>>();
YList12.AddRange(YList);
YList12.AddRange(YList2); //将系列假如chartControl
for (int seriesIndex = ; seriesIndex < seriesNameList12.Count; seriesIndex++)
{
//ShowSeries(ref lineChartControl2, seriesNameList2[seriesIndex], seriesTextList2[seriesIndex], xaxesList2, YList2[seriesIndex], seriesIndex);
////ShowSeriesTheory(ref lineChartControl2, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//This is an error!!!!!!!!!!!!!!!!!!!!!!
ShowSeries(ref lineChartControl2, seriesNameList12[seriesIndex], seriesTextList12[seriesIndex], xaxesList12[seriesIndex], YList12[seriesIndex], seriesIndex);
} //显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl2);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第三个图
this.xtraTabControl1.TabPages.Add("三角函数图3");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl3 = new ChartControl();//实例化一个ChartControl
lineChartControl3.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl3.Series.Clear(); //产生数据
List<double> xaxesList3 = new List<double>();//x轴数据
List<double> ySinList3 = new List<double>();//系列1-y轴数据
List<double> yCosList3 = new List<double>();//系列2-y轴数据
List<double> yTanList3 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList3.Add((double)i);
ySinList3.Add(Math.Sin(i));
yCosList3.Add(Math.Cos(i));
yTanList3.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList3 = new List<List<double>>();
YList3.Add(ySinList3);
YList3.Add(yCosList3);
YList3.Add(yTanList3);
//系列内容名称
List<string> seriesTextList3 = new List<string>();//系列内容名称
seriesTextList3.Add("cos 我有中文3");
seriesTextList3.Add("sin 我有中文3");
seriesTextList3.Add("2cos+sin我有中文3");
//系列名称
List<Series> seriesNameList3 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList3.Add(new Series(seriesTextList3[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line }
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeries(ref lineChartControl3, seriesNameList3[seriesIndex], seriesTextList3[seriesIndex], xaxesList3, YList3[seriesIndex], seriesIndex);
// ShowSeriesTheory(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//This is an error!!!!!!!!!!!!!!!!!!!!!!
//ShowSeries(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);
} //显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl3);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page }
public void ShowSeries(ref ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{ //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % ));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
}
lineChartControl.Series.Clear();
lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
lineChartControl.Legend.Visible = true;//图例可见
((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl); } // public void ShowSeriesTheory(ref ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
//List<double> yAxes, int iMarkerKind)
// { // //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
// seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
// ((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % 9));//mark类型 MarkerKind.Triangle
// ((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; // ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
// for (int pointIndex = 0; pointIndex < xAxes.Count; pointIndex++)
// {
// seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
// }
// lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
// lineChartControl.Legend.Visible = true;//图例可见
// ((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
// lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
// //lineChartControl.Size = new System.Drawing.Size(400, 250);
// //this.Controls.Add(lineChartControl); // } private void Form1_Load(object sender, EventArgs e)
{ }
}
}

将list合并,用一次函数试图解决,可还是不行

 using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace WindowsFormsApplication2devexpressChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
#region
//int tabPagesCount = 0;
//ChartControl chartControl1 = new ChartControl(); //// Create two series.
//Series series1 = new Series("Series 1", ViewType.Bar);
//Series series2 = new Series("Series 2", ViewType.Line); //// Add points to them, with their arguments different.
//series1.Points.Add(new SeriesPoint("A", 10));
//series1.Points.Add(new SeriesPoint("B", 12));
//series1.Points.Add(new SeriesPoint("C", 17));
//series1.Points.Add(new SeriesPoint("D", 14));
//series2.Points.Add(new SeriesPoint("I", 2500));
//series2.Points.Add(new SeriesPoint("II", 3800));
//series2.Points.Add(new SeriesPoint("III", 1500));
//series2.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl1.Series.AddRange(new Series[] { series1, series2 }); //// Hide the legend (optional).
//chartControl1.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram = (XYDiagram)chartControl1.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView = (LineSeriesView)series2.View;
//myView.AxisX = diagram.SecondaryAxesX[0];
//myView.AxisY = diagram.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView.Pane = diagram.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram.PaneDistance = 10;
//diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl1.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count-1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl1);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; ////
//ChartControl chartControl2 = new ChartControl(); //// Create two series.
//Series series3 = new Series("Series 3", ViewType.Bar);
//Series series4= new Series("Series 4", ViewType.Line); //// Add points to them, with their arguments different.
//series3.Points.Add(new SeriesPoint("A", 10));
//series3.Points.Add(new SeriesPoint("B", 12));
//series3.Points.Add(new SeriesPoint("C", 17));
//series3.Points.Add(new SeriesPoint("D", 14));
//series4.Points.Add(new SeriesPoint("I", 2500));
//series4.Points.Add(new SeriesPoint("II", 3800));
//series4.Points.Add(new SeriesPoint("III", 1500));
//series4.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl2.Series.AddRange(new Series[] { series3, series4 }); //// Hide the legend (optional).
//chartControl2.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram2 = (XYDiagram)chartControl2.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram2.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram2.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram2.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram2.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram2.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView2 = (LineSeriesView)series2.View;
//myView2.AxisX = diagram2.SecondaryAxesX[0];
//myView2.AxisY = diagram2.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView2.Pane = diagram2.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram2.PaneDistance = 10;
//diagram2.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram2.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram2.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl2.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count - 1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl2);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; #endregion this.xtraTabControl1.TabPages.Add("三角函数图");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
//ChartControl lineChartControl = new ChartControl();//实例化一个ChartControl
//lineChartControl.Legend.UseCheckBoxes = true;//图例可以勾选
//ChartTitle chartTitle1 = new ChartTitle();
//chartTitle1.Text = "三角函数";
//lineChartControl.Titles.Add(chartTitle1);
//lineChartControl.Series.Clear();
//产生数据
List<double> xaxesList = new List<double>();//x轴数据
List<double> ySinList = new List<double>();//系列1-y轴数据
List<double> yCosList = new List<double>();//系列2-y轴数据
List<double> yTanList = new List<double>();//系列3-y轴数据
List<double> yCotList = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList.Add((double)i);
ySinList.Add(Math.Sin(i));
yCosList.Add(Math.Cos(i));
yTanList.Add(Math.Sin(i) + Math.Cos(i));
yCotList.Add(Math.Cos(i) - Math.Sin(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList = new List<List<double>>();
YList.Add(ySinList);
YList.Add(yCosList);
YList.Add(yTanList);
YList.Add(yCotList);
//系列内容名称
List<string> seriesTextList = new List<string>();//系列内容名称
seriesTextList.Add("400kPa理论值cos 我有中文1");
seriesTextList.Add("600kPa理论值cos 我有中文1");
seriesTextList.Add("800kPa理论值cos+sin 我有中文1");
seriesTextList.Add("800kPa理论值cos-sin 我有中文1");
//系列名称
List<Series> seriesNameList = new List<Series>();
for (int i = ; i < seriesTextList.Count; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList.Add(new Series(seriesTextList[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line
} ////将系列假如chartControl
//for (int seriesIndex = 0; seriesIndex < seriesNameList.Count; seriesIndex++)
//{
// ShowSeries(ref lineChartControl, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex); //}
////显示
int tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl);//将ChartControl这个控件添加到这个page中
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第二个图
this.xtraTabControl1.TabPages.Add("三角函数图2");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl2 = new ChartControl();//实例化一个ChartControl
lineChartControl2.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl2.Series.Clear(); //产生数据
List<double> xaxesList2 = new List<double>();//x轴数据
List<double> ySinList2 = new List<double>();//系列1-y轴数据
List<double> yCosList2 = new List<double>();//系列2-y轴数据
List<double> yTanList2 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList2.Add((double)i);
ySinList2.Add(Math.Sin(i));
yCosList2.Add(Math.Cos(i));
yTanList2.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList2 = new List<List<double>>();
YList2.Add(ySinList2);
YList2.Add(yCosList2);
YList2.Add(yTanList2);
//系列内容名称
List<string> seriesTextList2 = new List<string>();//系列内容名称
seriesTextList2.Add("400kPa实验值cos 我有中文2");
seriesTextList2.Add("600kPa实验值sin 我有中文2");
seriesTextList2.Add("800kPa实验值2cos+sin我有中文2");
//系列名称
List<Series> seriesNameList2 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList2.Add(new Series(seriesTextList2[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line }
//合成一个系列
List<string> seriesTextList12 = new List<string>();
seriesTextList12.AddRange(seriesTextList);
seriesTextList12.AddRange(seriesTextList2);
List<Series> seriesNameList12 = new List<Series>();
seriesNameList12.AddRange(seriesNameList);
seriesNameList12.AddRange(seriesNameList2);
List<List<double>> xaxesList12 = new List<List<double>>();//x轴数据
xaxesList12.Add(xaxesList);
xaxesList12.Add(xaxesList);
xaxesList12.Add(xaxesList);
xaxesList12.Add(xaxesList2);
xaxesList12.Add(xaxesList2);
xaxesList12.Add(xaxesList2);
xaxesList12.Add(xaxesList2);
List<List<double>> YList12 = new List<List<double>>();
YList12.AddRange(YList);
YList12.AddRange(YList2); //将系列假如chartControl
for (int seriesIndex = ; seriesIndex < seriesNameList12.Count; seriesIndex++)
{
//ShowSeries(ref lineChartControl2, seriesNameList2[seriesIndex], seriesTextList2[seriesIndex], xaxesList2, YList2[seriesIndex], seriesIndex);
////ShowSeriesTheory(ref lineChartControl2, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//This is an error!!!!!!!!!!!!!!!!!!!!!!
ShowSeries(ref lineChartControl2, seriesNameList12[seriesIndex], seriesTextList12[seriesIndex], xaxesList12[seriesIndex], YList12[seriesIndex], seriesIndex);
} //显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl2);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第三个图
this.xtraTabControl1.TabPages.Add("三角函数图3");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl3 = new ChartControl();//实例化一个ChartControl
lineChartControl3.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl3.Series.Clear();
//public Series[] SeriesSerializable { get; set; } //产生数据
List<double> xaxesList3 = new List<double>();//x轴数据
List<double> ySinList3 = new List<double>();//系列1-y轴数据
List<double> yCosList3 = new List<double>();//系列2-y轴数据
List<double> yTanList3 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList3.Add((double)i);
ySinList3.Add(Math.Sin(i));
yCosList3.Add(Math.Cos(i));
yTanList3.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList3 = new List<List<double>>();
YList3.Add(ySinList3);
YList3.Add(yCosList3);
YList3.Add(yTanList3);
//系列内容名称
List<string> seriesTextList3 = new List<string>();//系列内容名称
seriesTextList3.Add("cos 我有中文3");
seriesTextList3.Add("sin 我有中文3");
seriesTextList3.Add("2cos+sin我有中文3");
//系列名称
List<Series> seriesNameList3 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList3.Add(new Series(seriesTextList3[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line }
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{ //ShowSeries(ref lineChartControl3, seriesNameList3[seriesIndex], seriesTextList3[seriesIndex], xaxesList3, YList3[seriesIndex], seriesIndex);
// ShowSeriesTheory(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//This is an error!!!!!!!!!!!!!!!!!!!!!!
//ShowSeries(ref lineChartControl3, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);
ShowSeries(ref lineChartControl3, seriesNameList12[seriesIndex], seriesTextList12[seriesIndex], xaxesList12[seriesIndex], YList12[seriesIndex], seriesIndex);
} //显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl3);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page }
public void ShowSeries(ref ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{ //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % ));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
}
//lineChartControl.Series.Clear(); lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
lineChartControl.Legend.Visible = true;//图例可见
((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl); } // public void ShowSeriesTheory(ref ChartControl lineChartControl, Series seriesName, string seriesText, List<double> xAxes,
//List<double> yAxes, int iMarkerKind)
// { // //seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
// seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
// ((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % 9));//mark类型 MarkerKind.Triangle
// ((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; // ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
// for (int pointIndex = 0; pointIndex < xAxes.Count; pointIndex++)
// {
// seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
// }
// lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
// lineChartControl.Legend.Visible = true;//图例可见
// ((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
// lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
// //lineChartControl.Size = new System.Drawing.Size(400, 250);
// //this.Controls.Add(lineChartControl); // } private void Form1_Load(object sender, EventArgs e)
{ }
}
}

只有第一幅图可以加合并list,别的不行

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraCharts; namespace BindIndividualSeriesRuntimeCS
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
public Form1()
{
InitializeComponent();
}
private DataTable CreateChartData(int rowCount)
{
// Create an empty table.
DataTable table = new DataTable("Table1"); // Add two columns to the table.
table.Columns.Add("Argument", typeof(Int32));
table.Columns.Add("Value", typeof(Int32)); // Add data rows to the table.
Random rnd = new Random();
DataRow row = null;
for (int i = ; i < rowCount; i++)
{
row = table.NewRow();
row["Argument"] = i;
row["Value"] = rnd.Next();
table.Rows.Add(row);
} return table;
} private void Form1_Load(object sender, EventArgs e)
{ // Create a chart.
ChartControl chart = new ChartControl(); // Create an empty Bar series and add it to the chart.
Series series = new Series("Series1", ViewType.Spline);
chart.Series.Add(series); // Generate a data table and bind the series to it.
series.DataSource = CreateChartData(); // Specify data members to bind the series.
series.ArgumentScaleType = ScaleType.Numerical;
series.ArgumentDataMember = "Argument";
series.ValueScaleType = ScaleType.Numerical;
series.ValueDataMembers.AddRange(new string[] { "Value" }); series = new Series("Series2", ViewType.Spline);
chart.Series.Add(series); // Generate a data table and bind the series to it.
series.DataSource = CreateChartData(); // Specify data members to bind the series.
series.ArgumentScaleType = ScaleType.Numerical;
series.ArgumentDataMember = "Argument";
series.ValueScaleType = ScaleType.Numerical;
series.ValueDataMembers.AddRange(new string[] { "Value" }); series = new Series("Series3", ViewType.Spline);
chart.Series.Add(series); // Generate a data table and bind the series to it.
series.DataSource = CreateChartData(); // Specify data members to bind the series.
series.ArgumentScaleType = ScaleType.Numerical;
series.ArgumentDataMember = "Argument";
series.ValueScaleType = ScaleType.Numerical;
series.ValueDataMembers.AddRange(new string[] { "Value" }); // Set some properties to get a nice-looking chart.
//((SideBySideBarSeriesView)series.View).ColorEach = true;
//((XYDiagram)chart.Diagram).AxisY.Visibility = DevExpress.Utils.DefaultBoolean.False;
//chart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; // Dock the chart into its parent and add it to the current form.
chart.Dock = DockStyle.Fill;
this.xtraTabControl1.TabPages[].Controls.Add(chart); ChartControl chart2 = new ChartControl(); // Create an empty Bar series and add it to the chart.
series = new Series("Series1", ViewType.Spline);
chart2.Series.Add(series); // Generate a data table and bind the series to it.
series.DataSource = CreateChartData(); // Specify data members to bind the series.
series.ArgumentScaleType = ScaleType.Numerical;
series.ArgumentDataMember = "Argument";
series.ValueScaleType = ScaleType.Numerical;
series.ValueDataMembers.AddRange(new string[] { "Value" }); series = new Series("Series2", ViewType.Spline);
chart2.Series.Add(series); // Generate a data table and bind the series to it.
series.DataSource = CreateChartData(); // Specify data members to bind the series.
series.ArgumentScaleType = ScaleType.Numerical;
series.ArgumentDataMember = "Argument";
series.ValueScaleType = ScaleType.Numerical;
series.ValueDataMembers.AddRange(new string[] { "Value" }); series = new Series("Series3", ViewType.Spline);
chart2.Series.Add(series); // Generate a data table and bind the series to it.
series.DataSource = CreateChartData(); // Specify data members to bind the series.
series.ArgumentScaleType = ScaleType.Numerical;
series.ArgumentDataMember = "Argument";
series.ValueScaleType = ScaleType.Numerical;
series.ValueDataMembers.AddRange(new string[] { "Value" }); // Set some properties to get a nice-looking chart.
//((SideBySideBarSeriesView)series.View).ColorEach = true;
//((XYDiagram)chart.Diagram).AxisY.Visibility = DevExpress.Utils.DefaultBoolean.False;
//chart.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False; // Dock the chart into its parent and add it to the current form.
chart2.Dock = DockStyle.Fill;
this.xtraTabControl1.TabPages[].Controls.Add(chart2); }
}
}

绑定database方式

 using DevExpress.XtraCharts;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; namespace WindowsFormsApplication2devexpressChart
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// public XYDiagramPaneCollection Panes { get; }//https://documentation.devexpress.com/CoreLibraries/DevExpress.XtraCharts.XYDiagram2D.Panes.property
private void button1_Click(object sender, EventArgs e)
{
#region
//int tabPagesCount = 0;
//ChartControl chartControl1 = new ChartControl(); //// Create two series.
//Series series1 = new Series("Series 1", ViewType.Bar);
//Series series2 = new Series("Series 2", ViewType.Line); //// Add points to them, with their arguments different.
//series1.Points.Add(new SeriesPoint("A", 10));
//series1.Points.Add(new SeriesPoint("B", 12));
//series1.Points.Add(new SeriesPoint("C", 17));
//series1.Points.Add(new SeriesPoint("D", 14));
//series2.Points.Add(new SeriesPoint("I", 2500));
//series2.Points.Add(new SeriesPoint("II", 3800));
//series2.Points.Add(new SeriesPoint("III", 1500));
//series2.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl1.Series.AddRange(new Series[] { series1, series2 }); //// Hide the legend (optional).
//chartControl1.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram = (XYDiagram)chartControl1.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView = (LineSeriesView)series2.View;
//myView.AxisX = diagram.SecondaryAxesX[0];
//myView.AxisY = diagram.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView.Pane = diagram.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram.PaneDistance = 10;
//diagram.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl1.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count-1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl1);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; ////
//ChartControl chartControl2 = new ChartControl(); //// Create two series.
//Series series3 = new Series("Series 3", ViewType.Bar);
//Series series4= new Series("Series 4", ViewType.Line); //// Add points to them, with their arguments different.
//series3.Points.Add(new SeriesPoint("A", 10));
//series3.Points.Add(new SeriesPoint("B", 12));
//series3.Points.Add(new SeriesPoint("C", 17));
//series3.Points.Add(new SeriesPoint("D", 14));
//series4.Points.Add(new SeriesPoint("I", 2500));
//series4.Points.Add(new SeriesPoint("II", 3800));
//series4.Points.Add(new SeriesPoint("III", 1500));
//series4.Points.Add(new SeriesPoint("IV", 1300)); //// Add both series to the chart.
//chartControl2.Series.AddRange(new Series[] { series3, series4 }); //// Hide the legend (optional).
//chartControl2.Legend.Visible = false; //// Cast the chart's diagram to the XYDiagram type,
//// to access its axes and panes.
//XYDiagram diagram2 = (XYDiagram)chartControl2.Diagram; //// Add secondary axes to the diagram, and adjust their options.
//diagram2.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram2.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram2.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram2.SecondaryAxesY[0].Alignment = AxisAlignment.Near; //// Add a new additional pane to the diagram.
//diagram2.Panes.Add(new XYDiagramPane("My Pane")); //// Assign both the additional pane and, if required,
//// the secondary axes to the second series.
//LineSeriesView myView2 = (LineSeriesView)series2.View;
//myView2.AxisX = diagram2.SecondaryAxesX[0];
//myView2.AxisY = diagram2.SecondaryAxesY[0];
//// Note that the created pane has the zero index in the collection,
//// because the existing Default pane is a separate entity.
//myView2.Pane = diagram2.Panes[0]; //// Customize the layout of the diagram's panes.
//diagram2.PaneDistance = 10;
//diagram2.PaneLayoutDirection = PaneLayoutDirection.Horizontal;
//diagram2.DefaultPane.SizeMode = PaneSizeMode.UseWeight;
//diagram2.DefaultPane.Weight = 1.2; //// Add the chart to the form.
//chartControl2.Dock = DockStyle.Fill;
////this.Controls.Add(chartControl1);
//this.xtraTabControl1.TabPages.Add("zbl两个pane图");//添加一个page
//tabPagesCount = this.xtraTabControl1.TabPages.Count - 1;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
//this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(chartControl2);
//this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount; #endregion this.xtraTabControl1.TabPages.Add("三角函数图");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl = new ChartControl();//实例化一个ChartControl
// Cast the chart's diagram to the XYDiagram type,
// to access its axes and panes.
XYDiagram diagram = (XYDiagram)lineChartControl.Diagram;//
//diagram.SecondaryAxesX.Add(new SecondaryAxisX("My Axis X"));
//diagram.SecondaryAxesY.Add(new SecondaryAxisY("My Axis Y"));
//diagram.SecondaryAxesX[0].Alignment = AxisAlignment.Near;
//diagram.SecondaryAxesY[0].Alignment = AxisAlignment.Near;
//// Add a new additional pane to the diagram.
//diagram.Panes.Add(new XYDiagramPane("My Pane")); lineChartControl.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl.Series.Clear();
//产生数据
List<double> xaxesList = new List<double>();//x轴数据
List<double> ySinList = new List<double>();//系列1-y轴数据
List<double> yCosList = new List<double>();//系列2-y轴数据
List<double> yTanList = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList.Add(i);
ySinList.Add(Math.Sin(i));
yCosList.Add(Math.Cos(i));
yTanList.Add(Math.Sin(i) + Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList = new List<List<double>>();
YList.Add(ySinList);
YList.Add(yCosList);
YList.Add(yTanList);
//系列内容名称
List<string> seriesTextList = new List<string>();//系列内容名称
seriesTextList.Add("400kPa理论值cos 我有中文");
seriesTextList.Add("600kPa理论值cos 我有中文");
seriesTextList.Add("800kPa理论值cos+sin 我有中文");
//系列名称
List<Series> seriesNameList = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList.Add(new Series(seriesTextList[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line
}
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeries(ref lineChartControl, diagram,seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);
}
//显示
int tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //尝试第二个图
this.xtraTabControl1.TabPages.Add("三角函数图2");//添加一个page,在此之前可以直接用ui界面的本控件的remove属性删除默认的两个page
ChartControl lineChartControl2 = lineChartControl;// new ChartControl();//实例化一个ChartControl
lineChartControl2.Legend.UseCheckBoxes = true;//图例可以勾选
lineChartControl2.Series.Clear(); //产生数据
List<double> xaxesList2 = new List<double>();//x轴数据
List<double> ySinList2 = new List<double>();//系列1-y轴数据
List<double> yCosList2 = new List<double>();//系列2-y轴数据
List<double> yTanList2 = new List<double>();//系列3-y轴数据
for (int i = ; i < ; i++)
{
xaxesList2.Add(i);
ySinList2.Add(Math.Sin(i));
yCosList2.Add(Math.Cos(i));
yTanList2.Add(Math.Sin(i) + * Math.Cos(i));
}
//将所有系列的y值放入一个列表,这个列表是列表的列表
List<List<double>> YList2 = new List<List<double>>();
YList2.Add(ySinList2);
YList2.Add(yCosList2);
YList2.Add(yTanList2);
//系列内容名称
List<string> seriesTextList2 = new List<string>();//系列内容名称
seriesTextList2.Add("cos 我有中文");
seriesTextList2.Add("sin 我有中文");
seriesTextList2.Add("2cos+sin我有中文");
//系列名称
List<Series> seriesNameList2 = new List<Series>();
for (int i = ; i < ; i++)
{
//完全建立一个系列,以后直接用就行了
seriesNameList2.Add(new Series(seriesTextList2[i], ViewType.Spline));//ScatterLine点划线,实验值用这种,理论值用line }
//将系列假如chartControl
for (int seriesIndex = ; seriesIndex < ; seriesIndex++)
{
ShowSeriesTheory(ref lineChartControl2, diagram,seriesNameList2[seriesIndex], seriesTextList2[seriesIndex], xaxesList2, YList2[seriesIndex], seriesIndex);
ShowSeries(ref lineChartControl2,diagram, seriesNameList[seriesIndex], seriesTextList[seriesIndex], xaxesList, YList[seriesIndex], seriesIndex);//This is an error!!!!!!!!!!!!!!!!!!!!!! } //显示
tabPagesCount = this.xtraTabControl1.TabPages.Count - ;//xtraTabControl2page的个数,为了删除默认的,可以用ui界面的remove
this.xtraTabControl1.TabPages[tabPagesCount].Controls.Add(lineChartControl2);//将ChartControl这个控件添加到这个page中
this.xtraTabControl1.SelectedTabPageIndex = tabPagesCount;//切换到这个page为选中的page //object o=diagram.DefaultPane;
}
public void ShowSeries(ref ChartControl lineChartControl, XYDiagram diagram, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{
seriesName.Points.Clear();
//seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind % ));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
}
//seriesName.IsAutoCreated();
LineSeriesView myView = (LineSeriesView)seriesName.View;
//myView.Pane = diagram.DefaultPane;
lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
diagram = (XYDiagram)lineChartControl.Diagram;
myView.Pane = diagram.DefaultPane;
lineChartControl.Legend.Visible = true;//图例可见
((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl);
seriesName.Points.Clear(); } public void ShowSeriesTheory(ref ChartControl lineChartControl, XYDiagram diagram, Series seriesName, string seriesText, List<double> xAxes,
List<double> yAxes, int iMarkerKind)
{
seriesName.Points.Clear();
//seriesName = new Series(seriesText, ViewType.ScatterLine);//新建立一个系列
seriesName.ArgumentScaleType = ScaleType.Numerical;//x轴数据类型,为数字
((LineSeriesView)seriesName.View).LineMarkerOptions.Kind = (MarkerKind)((iMarkerKind %));//mark类型 MarkerKind.Triangle
((LineSeriesView)seriesName.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True; ((LineSeriesView)seriesName.View).LineStyle.DashStyle = DashStyle.Dash;//线型
//lineChartControl.Series.Add(seriesName.Name, ViewType.Spline);
for (int pointIndex = ; pointIndex < xAxes.Count; pointIndex++)
{
seriesName.Points.Add(new SeriesPoint(xAxes[pointIndex], yAxes[pointIndex]));
}
LineSeriesView myView = (LineSeriesView)seriesName.View;
//myView.Pane = diagram.DefaultPane; //DevExpress.XtraCharts.SeriesBase.View property lineChartControl.Series.Add(seriesName);//往ChartControl控件上添加系列
diagram = (XYDiagram)lineChartControl.Diagram;
// myView.Pane = diagram.DefaultPane;
lineChartControl.Legend.Visible = true;//图例可见 ((XYDiagram)lineChartControl.Diagram).Rotated = false;//ChartControl控件不旋转
lineChartControl.Dock = DockStyle.Fill;//ChartControl控件在父控件内填满平铺
//lineChartControl.Size = new System.Drawing.Size(400, 250);
//this.Controls.Add(lineChartControl);
seriesName.Points.Clear();
} private void Form1_Load(object sender, EventArgs e)
{ }
}
}

试着改进,还不行,一个系列都不显示了

c# devexpress绘图 三角函数的更多相关文章

  1. 张奎师弟参与devexpress chartControl绘图--解决了devexpress的chartControl控件不能添加系列的问题

    using DevExpress.XtraCharts; using System; using System.Collections.Generic; using System.ComponentM ...

  2. c# devexpress学习绘图

    用字典方式存储数据并绘图:http://www.xuebuyuan.com/465384.html 数据库存储数据,并对图形作各种设置:http://www.cnblogs.com/xuhaibiao ...

  3. 甘特图控件如何自定义绘图?DevExpress Winforms帮你忙

    DevExpress Winforms Controls 内置140多个UI控件和库,完美构建流畅.美观且易于使用的应用程序.无论是Office风格的界面,还是分析处理大批量的业务数据,DevExpr ...

  4. C#Windows窗体界面设计_01_绘制三角函数_五点作图法

    binzhouweichao@163.com Visual Stutio 2010 C#开发环境 五点作图绘制三角函数,以正弦函数为例,选取一个周期[0, 2π]上的五个特殊的点,也就是横坐标0, π ...

  5. iOS开发--绘图教程

    本文是<Programming iOS5>中Drawing一章的翻译,考虑到主题完整性,翻译版本中加入了一些书中未涉及到的内容.希望本文能够对你有所帮助. 本文由海水的味道翻译整理,转载请 ...

  6. iOS绘图教程 (转,拷贝以记录)

    本文是<Programming iOS5>中Drawing一章的翻译,考虑到主题完整性,在翻译过程中我加入了一些书中没有涉及到的内容.希望本文能够对你有所帮助. 转自:http://www ...

  7. iOS绘图教程

    本文是<Programming iOS5>中Drawing一章的翻译,考虑到主题完整性,翻译版本中加入了一些书中未涉及到的内容.希望本文能够对你有所帮助.(本文由海水的味道翻译整理,转载请 ...

  8. H5的canvas绘图技术

    canvas元素是HTML5中新添加的一个元素,该元素是HTML5中的一个亮点.Canvas元素就像一块画布,通过该元素自带的API结合JavaScript代码可以绘制各种图形和图像以及动画效果. 1 ...

  9. Android群英传笔记——第六章:Android绘图机制与处理技巧

    Android群英传笔记--第六章:Android绘图机制与处理技巧 一直在情调,时间都是可以自己调节的,不然世界上哪有这么多牛X的人 今天就开始读第六章了,算日子也刚好一个月了,一个月就读一半,这效 ...

随机推荐

  1. 项目打包 TestFlight用法

    TestFlight用法 包教包会(iOS APP官方测试工具) https://www.jianshu.com/p/4be185e4069c

  2. SideBar 选择城市时右侧边上的 选择bar

    需要定义一个SideBar的视图类  在布局文件中引用   同时在布局中设置一个textView默认不可见 当触摸时才显示   在调用的Activity中 sideBar.setOnTouchingL ...

  3. jquery ajax 中实现给变量赋值

    我们在用JQuery的Ajax从后台提取数据后想把它赋值给全局变量,但是却怎么都赋不进,为什么呢? 原因其实很简单,我们用的Ajax是异步操作,也就是说在你赋值的时候数据还没提取出来,你当然赋不进去, ...

  4. Win10以管理员身份启动cmd.exe

    PowerShell -windowstyle hidden -Command "Start-Process cmd.exe -ArgumentList '/s,/k, pushd' -Ve ...

  5. 当时钟事件声明为过程变量 让system.threading.timer时钟失效

    这个项目的小模块就是画label 控件到tablepayoutpanel表单 之中, 中间用到了时钟,事件(带返回值的),哈希表 .由于时钟定义在 form1的启动构造函数中导致了form1,启动完毕 ...

  6. Maven 系列 一 :Maven 快速入门及简单使用

    开发环境 MyEclipse 2014 JDK 1.8 Maven 3.2.1 1.什么是Maven? Maven是一个项目管理工具,主要用于项目构建,依赖管理,项目信息管理. 2.下载及安装 下载最 ...

  7. IntelliJ idea 的破解

    ·1.破解的jar包下载链接: https://pan.baidu.com/s/1JV6GwguGQNs5pNQtst29Hw  提取码: u2jd 2.安装和破解地址:https://www.cnb ...

  8. sqrt函数倒数计算新对比

    某人发表说 雷神之锤 里面有一个 1/sqrt(x) 的函数非常了不起. 但经过实测,发现现在计算机已经优化, 该算法已经没有优势. 具体看文档: <a href="http://fi ...

  9. [Robot Framework] 怎么写动态等待?

    举例:Robot Framwork+WhiteLibrary,等待元素可用或不可用 Wait Until Object Is Enabled Wait Until Object Is Not Enab ...

  10. npm run build出问题十分通用的解决方法

    1.C:\NanoFabric\52ABP\SPAHost\ClientApp\node_modules 原来的目录重命名为C:\NanoFabric\52ABP\SPAHost\ClientApp\ ...