关于Winfrom自带的Chart曲线图控件使用 - 折线类
-
如何让X或者Y轴的坐标不进行显示
chart1.ChartAreas[0].AxisX(或Y).Enabled = AxisEnabled.True; -
去掉右上角的标题
chart1.Legends[0].MaximumAutoSize = 0; -
设置表坐标间隔 X Y
this.chart1.ChartAreas[0].AxisY.Minimum = 0; //从多少开始
this.chart1.ChartAreas[0].AxisY.Interval = 50;//间隔
this.chart1.ChartAreas[0].AxisY.Maximum = 600;//最大坐标this.chart1.ChartAreas[0].AxisX.Minimum =0;
this.chart1.ChartAreas[0].AxisX.Interval = 50;
this.chart1.ChartAreas[0].AxisX.Maximum = 1600; -
添加线条
Series s1 = new Series();//新建一个线条
s1.Points.AddXY(填X的坐标, 填Y的坐标); //比如0,10
chart1.Series.Add(s1);//添加到需要显示的图表上 -
设置线条样式、颜色、宽度
chart1.Series[0].ChartType = SeriesChartType.Line; //设置样式
chart1.Series[0].Color = Color.White;//颜色
chart1.Series[0].BorderWidth = 2;//宽度 -
设置网格线显示与不显示
chart1.ChartAreas[0].AxisX.MajorGrid.Enabled = true; //显示X轴网格线 ,Y同理