mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-10 20:28:23 +01:00
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:
parent
ca17997c57
commit
17114c5ab7
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user