C#WindowsFormsApplication draws a simple line chart based on coordinates

Point[] pot = { new Point(0, 123), new Point(50, 148), new Point(100, 118), new Point(150, 192), new Point(200, 176), 
                      new Point(250, 237), new Point(300, 320), new Point(350, 450), new Point(400, 219), new Point(450, 180), new Point(500, 170)};
        private void Form1_Paint()
        {
            Graphics gobj = this.CreateGraphics();
            gobj.DrawCurve(new Pen(Color.Blue, 2), pot, 0f);//数据间连曲线
            gobj.Dispose();
        }
private void button2_Click(object sender, EventArgs e)
        {
            Form1_Paint();
        }

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41170600/article/details/106061516