关于Winfrom自带的Chart曲线图控件使用 - 折线类

关于Winfrom自带的Chart曲线图控件使用 - 折线类

  1. 如何让X或者Y轴的坐标不进行显示
    chart1.ChartAreas[0].AxisX(或Y).Enabled = AxisEnabled.True;

  2. 去掉右上角的标题
    chart1.Legends[0].MaximumAutoSize = 0;

  3. 设置表坐标间隔 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;

  4. 添加线条
    Series s1 = new Series();//新建一个线条
    s1.Points.AddXY(填X的坐标, 填Y的坐标); //比如0,10
    chart1.Series.Add(s1);//添加到需要显示的图表上

  5. 设置线条样式、颜色、宽度
    chart1.Series[0].ChartType = SeriesChartType.Line; //设置样式
    chart1.Series[0].Color = Color.White;//颜色
    chart1.Series[0].BorderWidth = 2;//宽度

  6. 设置网格线显示与不显示
    chart1.ChartAreas[0].AxisX.MajorGrid.Enabled = true; //显示X轴网格线 ,Y同理

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值