プログラムでtChartを作成しています(Delphi2007、TeeChar 7無料版)。グラフの寸法を設定して縦横比を変更したいのですが、幅と高さのプロパティを変更しても意味のある結果が得られません。軸の TickLength も変更してみましたが、うまくいきませんでした。TChart の関連するプロパティを dfm ファイルからコピーしました。意味のあるものを忘れないようにします。X と Y の最大値と最小値を編集した場合にのみグラフの外観が変わりますが、これだけでは不十分です。
これが私の元のチャートと「再フォーマット」されたチャートです。チャートのサイズは両方とも 400 x 250 です。グラフのサイズを変更するための特定のプロパティはありますか? それに応じて軸のサイズを変更したいのですが、可能ですか? ご協力ありがとうございました
TChart に関連するコードは次のとおりです。
procedure CreateChart(parentform: TForm);
//actually formatChart is a CreateChart anf fChart a member of my class
begin
fchart:= TChart.Create(parentform);
fchart.Parent:= parentform;
fchart.AxisVisible := true;
fchart.AutoSize := false;
fChart.color := clWhite;
fchart.BottomAxis.Automatic := true;
fchart.BottomAxis.AutomaticMaximum := true;
fchart.BottomAxis.AutomaticMinimum := true;
fchart.LeftAxis.Automatic := true;
fchart.LeftAxis.AutomaticMaximum := true;
fchart.LeftAxis.AutomaticMinimum := true;
fchart.view3D := false;
end
procedure formatChart(width, height, xmin, xmax, ymin, ymax: double);
//actually formatChart is a method anf fChart a member of my class
begin
with fChart do
begin
Color := clWhite;
fChart.Legend.Visible := false;
AxisVisible := true;
AllowPanning := pmNone;
color := clWhite;
Title.Visible := False;
BottomAxis.Minimum := 0; //to avoid the error maximum must be > than min
BottomAxis.Maximum := xmax;
BottomAxis.Minimum := xmin;
BottomAxis.ExactDateTime := False ;
BottomAxis.Grid.Visible := False ;
BottomAxis.Increment := 5 ;
BottomAxis.MinorTickCount := 0;
BottomAxis.MinorTickLength := 5;
BottomAxis.Ticks.Color := clBlack ;
BottomAxis.TickOnLabelsOnly := False;
DepthAxis.Visible := False;
LeftAxis.Automatic := false;
LeftAxis.AutomaticMaximum := false;
LeftAxis.AutomaticMinimum := false;
LeftAxis.Minimum := ymin;
LeftAxis.Maximum := ymax;
LeftAxis.Minimum := ymin;
LeftAxis.TickLength := 5;
Width := round(width);
Height := round(height);
View3D := False ;
end;
end;