TAChart: use margins in bar series. Default scale for bar series now adujsts to display labels.

git-svn-id: trunk@18872 -
This commit is contained in:
ask 2009-03-02 15:23:13 +00:00
parent ca17997c57
commit 17114c5ab7

View File

@ -156,6 +156,7 @@ type
procedure DrawLegend(ACanvas: TCanvas; const ARect: TRect); override;
function GetSeriesColor: TColor; override;
procedure SetSeriesColor(const AValue: TColor); override;
procedure UpdateMargins(ACanvas: TCanvas; var AMargins: TRect); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -1185,6 +1186,16 @@ begin
FBarBrush.Color := AValue;
end;
procedure TBarSeries.UpdateMargins(ACanvas: TCanvas; var AMargins: TRect);
var
h: Integer;
begin
if MarksStyle = smsNone then exit;
h := ACanvas.TextHeight('0') + 10 + 2 * 2 + 4;
AMargins.Top := Max(AMargins.Top, h);
AMargins.Bottom := Max(AMargins.Bottom, h);
end;
function TBarSeries.AddXY(X, Y: Double; XLabel: String; Color: TColor): Longint;
begin
if Color = clTAColor then Color := SeriesColor;