bool ini;
int [] Y =new int[11];
private void showChart()
{
string[] X = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K" };
if (ini == false)
{
Y[0] = 1;
Y[1] = 2;
Y[2] = 3;
Y[3] = 4;
Y[4] = 5;
Y[5] = 6;
Y[6] = 5;
Y[7] = 4;
Y[8] = 3;
Y[9] = 2;
Y[10] = 1;
ini = true;
}
else
{
int relay = Y[10];
for(int i=0;i<Y.Length-1;i++)
{
Y[Y.Length - i-1] = Y[Y.Length - i-2];
}
Y[0] = relay;
}
chart1.Series[0].Points.Clear();
chart1.Series[0].Points.DataBindXY(X,Y);
}
private void button4_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Interval = Convert.ToInt32(textBox1.Text.ToString());
}
private void timer1_Tick(object sender, EventArgs e)
{
showChart();
}
c# 利用Chart 制作动图
最新推荐文章于 2024-01-31 13:21:07 发布