//// Set fast line chart type
//曲线显示.Series["智力"].ChartType = SeriesChartType.FastLine;
//-------------------------------------------------------------
// Set primary x-axis properties
曲线显示.ChartAreas["Default"].AxisX.LabelStyle.Interval = Math.PI;
曲线显示.ChartAreas["Default"].AxisX.LabelStyle.Format = "##.##";
曲线显示.ChartAreas["Default"].AxisX.MajorGrid.Interval = Math.PI;
曲线显示.ChartAreas["Default"].AxisX.MinorGrid.Interval = Math.PI / 4;
曲线显示.ChartAreas["Default"].AxisX.MinorTickMark.Interval = Math.PI / 4;
曲线显示.ChartAreas["Default"].AxisX.MajorTickMark.Interval = Math.PI;
曲线显示.ChartAreas["Default"].AxisY.MinorGrid.Interval = 0.25;
曲线显示.ChartAreas["Default"].AxisY.MajorGrid.Interval = 0.5;
曲线显示.ChartAreas["Default"].AxisY.LabelStyle.Interval = 0.5;
// Add data points to the series that have the specified X and Y values
for (double t = 0; t <= (2.5 * Math.PI); t += Math.PI / 6)
{
double ch1 = Math.Sin(t);
double ch2 = Math.Sin(t - Math.PI / 2);
曲线显示.Series["Channel 1"].Points.AddXY(t, ch1);
曲线显示.Series["Channel 2"].Points.AddXY(t, ch2);
}
}
昨天找例子,今天修改代码,结果如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace MyClockApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}