private void Form1_Load(object sender, EventArgs e)
{
//清除默认的series
chart1.Series.Clear();
//ChartArea area1 = new ChartArea("ChartArea1");
//chart1.ChartAreas.Add(area1);
chart1.ChartAreas[0].Axes[0].MajorGrid.Enabled = false; //X轴上网格
chart1.ChartAreas[0].Axes[1].MajorGrid.Enabled = false; //y轴上网格
chart1.ChartAreas[0].Axes[0].MajorTickMark.Enabled = false; // x轴上突出的小点
chart1.ChartAreas[0].Axes[1].MajorTickMark.Enabled = false; // y轴上突出的小点
chart1.ChartAreas[0].Axes[0].ArrowStyle = AxisArrowStyle.SharpTriangle;
chart1.ChartAreas[0].Axes[1].ArrowStyle = AxisArrowStyle.SharpTriangle;
chart1.ChartAreas[0].Axes[0].Title = "分钟";
chart1.ChartAreas[0].Axes[1].Title = "温度";
chart1.ChartAreas[0].Axes[0].TitleAlignment = StringAlignment.Far;
chart1.ChartAreas[0].Axes[1].TitleAlignment = StringAlignment.Far;
Series Strength = new Series("");
Strength.ChartType = SeriesChartType.Line;
//Strength.IsValueShownAsLabel = true;
Strength.Points.AddXY(10, 10);
Strength.Points.AddXY(20, 10);
chart1.Series.Add(Strength);
chart1.Series[0].Color = Color.Black;
ArrowAnnotation ann = new ArrowAnnotation();
//注释锚点(起点)--------------无法自定义锚点--------------
ann.AnchorDataPoint = chart1.Series[0].Points[0]; //new DataPoint(20,5)
//这两项用于设置注释终点位置
ann.Height = 20; //注释垂直高度
ann.Width = 15; //注释终点相对锚点左右移动距离
ann.ArrowSize = 1;
ann.BackColor = Color.Black;
chart1.Annotations.Add(ann);
}