LINE 使用紀錄
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, TeeProcs, TeEngine, Chart, DBChart, Series;
type
TForm1 = class(TForm)
Button1: TButton;
Chart1: TChart;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
procedure Button1Click(Sender: TObject);
procedure Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries;
ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X,
Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i: Integer;
no1list,waferidlist: TStringList;
Series1,Series2: TLineSeries;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
waferidlist:= TStringList.Create;
Chart1.SeriesList.Clear;
Series1 := TLineSeries.Create(Self);
Series1.ParentChart := Chart1;
Series1.VertAxis := aLeftAxis; // 左邊Y軸
Series1.XValues.Order := loAscending; //(loNone, loAscending, loDescending)
Series1.YValues.Order := loNone; //(loNone, loAscending, loDescending)
Series1.Title := 'S1';
Series1.Color := clRed;
Series1.LinePen.Width := 1;
Series1.LinePen.Style := psSolid;
Series1.LinePen.Color := clBlue;
Series1.Dark3D := False;
Series1.Active := True;
Series1.Pointer.Visible:=True;
chart1.Title.Text.Text:='T1';
Series2 := TLineSeries.Create(Self);
Series2.ParentChart := Chart1;
Series2.Dark3D := False;
Series2.VertAxis := aRightAxis; // 右邊Y軸
Series2.Active:=True;
Series2.Pointer.Visible:=True;
i := 0;
for i := 0 to 10 do
begin
Series1.AddXY(i, i+10);
Series2.AddXY(i, i+20,IntToStr(i),clGreen);
Series1.XLabel[I]:=IntToStr(i); //可自訂顯示名稱
//Series1.AddXY(i, i+10,'顯示名稱',顏色);
end;
Chart1.Legend.Visible:=True; //圖例顯示
Chart1.LeftAxis.Automatic := false ;
Chart1.LeftAxis.Maximum:=111;
Chart1.LeftAxis.Minimum:=1;
Chart1.BottomAxis.Automatic:=False;
Chart1.BottomAxis.Maximum:=i;
Chart1.BottomAxis.Minimum:=1;
Chart1.Axes.Bottom.LabelsAngle:=90; //x軸文字翻轉90度
Chart1.Chart3DPercent:=1; //3D
end;
procedure TForm1.Chart1ClickSeries(Sender: TCustomChart;
Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Edit1.Text:= Series.XLabel[ValueIndex];
Edit2.Text:=CurrToStr(Series.YValue[ValueIndex]);
Edit3.Text:=Series.Title;
end;
end.
大家一起加入blogads 賺零用錢!!