mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 00:19:37 +02:00
TAChart: Add new property TickWidth to chart axis.
This commit is contained in:
parent
647a86feb5
commit
6b24a4e57c
@ -22,6 +22,7 @@ uses
|
||||
|
||||
const
|
||||
DEF_TICK_LENGTH = 4;
|
||||
DEF_TICK_WIDTH = 1;
|
||||
|
||||
type
|
||||
|
||||
@ -43,6 +44,7 @@ type
|
||||
published
|
||||
property Marks: TChartMinorAxisMarks read GetMarks write SetMarks;
|
||||
property TickLength default DEF_TICK_LENGTH div 2;
|
||||
property TickWidth default DEF_TICK_WIDTH;
|
||||
end;
|
||||
|
||||
TChartAxis = class;
|
||||
@ -195,6 +197,7 @@ type
|
||||
read FPositionUnits write SetPositionUnits default cuPercent;
|
||||
property Range: TChartRange read FRange write SetRange;
|
||||
property TickLength default DEF_TICK_LENGTH;
|
||||
property TickWidth default DEF_TICK_WIDTH;
|
||||
property Title: TChartAxisTitle read FTitle write SetTitle;
|
||||
property Transformations: TChartAxisTransformations
|
||||
read FTransformations write SetTransformations;
|
||||
@ -352,6 +355,7 @@ begin
|
||||
MinLength := 5;
|
||||
end;
|
||||
TickLength := DEF_TICK_LENGTH div 2;
|
||||
TickWidth := DEF_TICK_WIDTH;
|
||||
end;
|
||||
|
||||
function TChartMinorAxis.GetAlignment: TChartAxisAlignment;
|
||||
@ -460,6 +464,7 @@ begin
|
||||
FPositionUnits := cuPercent;
|
||||
FRange := TChartRange.Create(ACollection.Owner as TCustomChart);
|
||||
TickLength := DEF_TICK_LENGTH;
|
||||
TickWidth := DEF_TICK_WIDTH;
|
||||
FTitle := TChartAxisTitle.Create(ACollection.Owner as TCustomChart);
|
||||
FMarginsForMarks := true;
|
||||
FMarks.SetInsideDir(1, 0);
|
||||
|
@ -163,6 +163,7 @@ type
|
||||
FTickColor: TColor;
|
||||
FTickInnerLength: Integer;
|
||||
FTickLength: Integer;
|
||||
FTickWidth: Integer;
|
||||
FVisible: Boolean;
|
||||
function GetIntervals: TChartAxisIntervalParams;
|
||||
procedure SetArrow(AValue: TChartArrow);
|
||||
@ -171,6 +172,7 @@ type
|
||||
procedure SetTickColor(AValue: TColor);
|
||||
procedure SetTickInnerLength(AValue: Integer);
|
||||
procedure SetTickLength(AValue: Integer);
|
||||
procedure SetTickWidth(AValue: Integer);
|
||||
procedure SetVisible(AValue: Boolean);
|
||||
strict protected
|
||||
FMarks: TCustomChartAxisMarks;
|
||||
@ -199,6 +201,7 @@ type
|
||||
property TickInnerLength: Integer
|
||||
read FTickInnerLength write SetTickInnerLength default 0;
|
||||
property TickLength: Integer read FTickLength write SetTickLength;
|
||||
property TickWidth: Integer read FTickWidth write SetTickWidth;
|
||||
property Visible: Boolean read FVisible write SetVisible default true;
|
||||
end;
|
||||
|
||||
@ -344,6 +347,7 @@ procedure TAxisDrawHelper.DrawMark(
|
||||
AFixedCoord: Integer; AMark: Double; const AText: String);
|
||||
var
|
||||
coord: Integer;
|
||||
clr: TColor;
|
||||
begin
|
||||
coord := GraphToImage(AMark);
|
||||
if
|
||||
@ -364,9 +368,10 @@ begin
|
||||
|
||||
if FAxis.Marks.Visible then begin
|
||||
if (FAxis.TickColor = clDefault) then
|
||||
FDrawer.PrepareSimplePen(GetDefaultPenColor)
|
||||
clr := GetDefaultPenColor
|
||||
else
|
||||
FDrawer.PrepareSimplePen(FAxis.TickColor);
|
||||
clr := FAxis.TickColor;
|
||||
FDrawer.SetPenParams(psSolid, clr, FAxis.TickWidth);
|
||||
DrawLabelAndTick(coord, AFixedCoord, AText);
|
||||
end;
|
||||
end;
|
||||
@ -807,6 +812,13 @@ begin
|
||||
StyleChanged(Self);
|
||||
end;
|
||||
|
||||
procedure TChartBasicAxis.SetTickWidth(AValue: Integer);
|
||||
begin
|
||||
if FTickWidth = AValue then exit;
|
||||
FTickWidth := AValue;
|
||||
StyleChanged(Self);
|
||||
end;
|
||||
|
||||
procedure TChartBasicAxis.SetVisible(AValue: Boolean);
|
||||
begin
|
||||
if FVisible = AValue then exit;
|
||||
|
Loading…
Reference in New Issue
Block a user