I create a small program for data analysis, I download data from the SQL database, sortering and display it on the dataGridView, and then, based on the data from the dataGridView, I create a chart1. I'm having trouble adding a trendline to this chart1. I'm creates a chart1 using code:
chart1.ChartAreas.Add("WY");
chart1.ChartAreas.Add("ZA");
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
this.chart1.Series["WY"].Points.AddXY(dataGridView1.Rows[i].Cells[0].Value.ToString(), Convert.ToDouble(dataGridView1.Rows[i].Cells["WY"].Value.ToString()));
this.chart1.Series["ZA"].Points.AddXY(dataGridView1.Rows[i].Cells[0].Value.ToString(), Convert.ToDouble(textBox4.Text.ToString()));
Unfortunately, I am looking for a good solution on the web, but I cannot cope with it. Does anyone know a good solution to add trend lines optionally on the chart?