怎么使Chart组件上让X轴的刻度运动。 
我现在循环一组数据在Chart上,但X轴越来越浓密。 
怎么使它不停的循环呢?

解决方案 »

  1.   

    var
      Form1: TForm1;
      num:integer;            //用于设置显示范围
    implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
    begin
    chart1.BottomAxis.Minimum :=0;               //设定x轴显示最小值
    chart1.BottomAxis.Maximum :=200;             //x轴显示最大值
    chart1.BottomAxis.Automatic :=false;         //*一定要设为FALSE;
    timer1.enable:=false;       
    end;procedure TForm1.Button1Click(Sender: TObject);
    begin
    timer1.Enabled :=true;
    end;procedure TForm1.Timer1Timer(Sender: TObject);
    begin
       series1.Add(random(100)); 
       inc(num);
       if num>200 then               //此处就是循环部分了
       begin
       chart1.BottomAxis.Minimum :=chart1.BottomAxis.Maximum -200;     //更改x轴最小值
       chart1.BottomAxis.Maximum:=num;  //更改X轴最大值                          
       end;
    end;
      

  2.   

    C:\Program Files\Borland\Delphi7\Demos\TeeChart