mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 04:39:35 +02:00
TAChart: Add TBarSeries.AdjustBarWidth property.
git-svn-id: trunk@19611 -
This commit is contained in:
parent
563f244d92
commit
4b83c209c8
@ -108,14 +108,16 @@ type
|
|||||||
|
|
||||||
TBarSeries = class(TBasicPointSeries)
|
TBarSeries = class(TBasicPointSeries)
|
||||||
private
|
private
|
||||||
|
FAdjustBarWidth: Boolean;
|
||||||
FBarBrush: TBrush;
|
FBarBrush: TBrush;
|
||||||
FBarPen: TPen;
|
FBarPen: TPen;
|
||||||
FBarWidthPercent: Integer;
|
FBarWidthPercent: Integer;
|
||||||
|
|
||||||
|
procedure ExamineAllBarSeries(out ATotalNumber, AMyPos: Integer);
|
||||||
|
procedure SetAdjustBarWidth(AValue: Boolean);
|
||||||
procedure SetBarWidthPercent(Value: Integer);
|
procedure SetBarWidthPercent(Value: Integer);
|
||||||
procedure SetBarBrush(Value: TBrush);
|
procedure SetBarBrush(Value: TBrush);
|
||||||
procedure SetBarPen(Value: TPen);
|
procedure SetBarPen(Value: TPen);
|
||||||
procedure ExamineAllBarSeries(out ATotalNumber, AMyPos: Integer);
|
|
||||||
protected
|
protected
|
||||||
procedure DrawLegend(ACanvas: TCanvas; const ARect: TRect); override;
|
procedure DrawLegend(ACanvas: TCanvas; const ARect: TRect); override;
|
||||||
function GetSeriesColor: TColor; override;
|
function GetSeriesColor: TColor; override;
|
||||||
@ -127,6 +129,8 @@ type
|
|||||||
procedure Draw(ACanvas: TCanvas); override;
|
procedure Draw(ACanvas: TCanvas); override;
|
||||||
function AddXY(X, Y: Double; XLabel: String; Color: TColor): Longint; override;
|
function AddXY(X, Y: Double; XLabel: String; Color: TColor): Longint; override;
|
||||||
published
|
published
|
||||||
|
property AdjustBarWidth: Boolean
|
||||||
|
read FAdjustBarWidth write SetAdjustBarWidth default false;
|
||||||
property BarBrush: TBrush read FBarBrush write SetBarBrush;
|
property BarBrush: TBrush read FBarBrush write SetBarBrush;
|
||||||
property BarPen: TPen read FBarPen write SetBarPen;
|
property BarPen: TPen read FBarPen write SetBarPen;
|
||||||
property BarWidthPercent: Integer
|
property BarWidthPercent: Integer
|
||||||
@ -1206,6 +1210,11 @@ procedure TBarSeries.ExamineAllBarSeries(out ATotalNumber, AMyPos: Integer);
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
if not AdjustBarWidth then begin
|
||||||
|
ATotalNumber := 1;
|
||||||
|
AMyPos := 0;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
ATotalNumber := 0;
|
ATotalNumber := 0;
|
||||||
AMyPos := -1;
|
AMyPos := -1;
|
||||||
for i := 0 to ParentChart.SeriesCount - 1 do begin
|
for i := 0 to ParentChart.SeriesCount - 1 do begin
|
||||||
@ -1222,6 +1231,13 @@ begin
|
|||||||
Result := FBarBrush.Color;
|
Result := FBarBrush.Color;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TBarSeries.SetAdjustBarWidth(AValue: Boolean);
|
||||||
|
begin
|
||||||
|
if FAdjustBarWidth = AValue then exit;
|
||||||
|
FAdjustBarWidth := AValue;
|
||||||
|
UpdateParentChart;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TPieSeries }
|
{ TPieSeries }
|
||||||
|
|
||||||
function TPieSeries.AddPie(Value: Double; Text: String; Color: TColor): Longint;
|
function TPieSeries.AddPie(Value: Double; Text: String; Color: TColor): Longint;
|
||||||
|
Loading…
Reference in New Issue
Block a user