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