TDBChart を使用して 3 つの棒グラフのデータを表示しています。各棒系列に傾向線を追加する良い例を教えてください。TeeChart のダウンロードに付属する例は、まったく役に立ちません。
ありがとう
ここでは、ランダムな値を使用して 3 つの TBarSeries を作成し、次に 3 つの TTrendFunction (それぞれの TLineSeries を使用) を作成する簡単な例を示します。
uses Series, CurvFitt;
procedure TForm1.FormCreate(Sender: TObject);
var
tmpBar:TBarSeries;
tmpTrend:TTrendFunction;
tmpLine: TLineSeries;
i, nSeries: Integer;
begin
Chart1.Legend.Visible:=false;
Chart1.View3D:=false;
for i:=0 to 2 do
begin
tmpBar:=Chart1.AddSeries(TBarSeries) as TBarSeries;
with tmpBar do
begin
Marks.Visible:=false;
FillSampleValues;
end;
end;
nSeries:=Chart1.SeriesCount;
for i:=0 to nSeries-1 do
begin
tmpBar:=Chart1[i] as TBarSeries;
tmpTrend:=TTrendFunction.Create(Self);
tmpTrend.Period:=3;
tmpLine:=Chart1.AddSeries(TLineSeries) as TLineSeries;
with tmpLine do
begin
Color:=tmpBar.Color;
SetFunction(tmpTrend);
DataSource:=tmpBar;
end;
end;
end;