c#如何绘制折线图

c# how to draw line chart

我正在尝试创建折线图来显示数据。目前我有显示条形图的代码。在这里

using System.Windows.Forms.DataVisualization.Charting;

private void CreateChart()
{
    var series = new Series("Finance");

    // Frist parameter is X-Axis and Second is Collection of Y- Axis
    series.Points.DataBindXY(new[] { 2001, 2002, 2003, 2004 }, new[] { 100, 200, 90, 150 });
    chart1.Series.Add(series);

}

它工作得很好。我该如何修改它以显示折线图?

谢谢

设置ChartType propetry of the series to Line:

series.ChartType = SeriesChartType.Line;