📄 teengine.pas
字号:
FMaximumOffset : Integer;
FMinimumOffset : Integer;
{ axis }
FAxis : TChartAxisPen;
FPosAxis : Integer;
FZPosition : Double;
{ title }
FAxisTitle : TChartAxisTitle;
FTitleSize : Integer;
FPosTitle : Integer;
{ grid }
FGrid : TAxisGridPen;
{ labels }
FLabelsAlign : TAxisLabelAlign;
FLabelsAngle : Integer;
FItems : TAxisItems;
FLabelsOnAxis : Boolean;
FLabelsSeparation : Integer;
FLabelsSize : Integer;
FLabelStyle : TAxisLabelStyle;
FLabelsExponent : Boolean;
FLabelsMultiLine : Boolean;
FPosLabels : Integer;
FAxisValuesFormat : String;
FDateTimeFormat : String;
FExactDateTime : Boolean;
FRoundFirstLabel : Boolean;
{ ticks }
FMinorGrid : TChartHiddenPen;
FMinorTickCount : Integer;
FMinorTickLength : Integer;
FMinorTicks : TDarkGrayPen;
FTicks : TDarkGrayPen;
FTicksInner : TDarkGrayPen;
FTickInnerLength : Integer;
FTickLength : Integer;
FTickOnLabelsOnly : Boolean;
{ other }
FInverted : Boolean;
FHorizontal : Boolean;
FOtherSide : Boolean;
FParentChart : TCustomAxisPanel;
FVisible : Boolean;
FStartPosition : Double;
FEndPosition : Double;
FPositionPercent : Double;
FPosUnits : TTeeUnits;
{ internal }
IAxisDateTime : Boolean;
IAxisLogSizeRange : TChartValue;
IAxisSizeRange : TChartValue;
ICenterPos : Integer;
IDepthAxis : Boolean;
ILogMax : Double;
ILogMin : Double;
IMaximum : Double;
IMinimum : Double;
IRange : TChartValue;
IRangeLog : Double;
IRangeZero : Boolean;
ISeriesList : TChartSeriesList;
IZPos : Integer;
Procedure SetAutomatic(Value:Boolean);
Procedure SetAutomaticMinimum(Value:Boolean);
Procedure SetAutomaticMaximum(Value:Boolean);
Procedure SetAutoMinMax(Var Variable:Boolean; Var2,Value:Boolean);
Procedure SetAxis(Value:TChartAxisPen);
procedure SetAxisTitle(Value:TChartAxisTitle);
Procedure SetDateTimeFormat(Const Value:String);
Procedure SetDesiredIncrement(Const Value:Double);
Procedure SetExactDateTime(Value:Boolean);
Procedure SetGrid(Value:TAxisGridPen);
procedure SetGridCentered(Value:Boolean);
Procedure SetInverted(Value:Boolean);
Procedure SetLabels(Value:Boolean);
Procedure SetLabelsAlign(Value:TAxisLabelAlign);
Procedure SetLabelsAngle(const Value:Integer);
Procedure SetLabelsFont(Value:TTeeFont);
Procedure SetLabelsMultiLine(Value:Boolean);
Procedure SetLabelsOnAxis(Value:Boolean);
Procedure SetLabelsSeparation(Value:Integer);
Procedure SetLabelsSize(Value:Integer);
Procedure SetLabelStyle(Value:TAxisLabelStyle);
Procedure SetLogarithmic(Value:Boolean);
Procedure SetLogarithmicBase(const Value:Double);
Procedure SetMaximum(Const Value:Double);
Procedure SetMinimum(Const Value:Double);
Procedure SetMinorGrid(Value:TChartHiddenPen);
Procedure SetMinorTickCount(Value:Integer);
Procedure SetMinorTickLength(Value:Integer);
Procedure SetMinorTicks(Value:TDarkGrayPen);
procedure SetStartPosition(Const Value:Double);
procedure SetEndPosition(Const Value:Double);
procedure SetPositionPercent(Const Value:Double);
procedure SetPosUnits(const Value: TTeeUnits);
procedure SetRoundFirstLabel(Value:Boolean);
Procedure SetTickLength(Value:Integer);
Procedure SetTickInnerLength(Value:Integer);
Procedure SetTicks(Value:TDarkGrayPen);
Procedure SetTicksInner(Value:TDarkGrayPen);
procedure SetTickOnLabelsOnly(Value:Boolean);
Procedure SetTitleSize(Value:Integer);
Procedure SetValuesFormat(Const Value:String);
Procedure SetVisible(Value:Boolean);
Function ApplyPosition(APos:Integer; Const R:TRect):Integer;
Function CalcDateTimeIncrement(MaxNumLabels:Integer):Double;
Function CalcLabelsIncrement(MaxNumLabels:Integer):Double;
Procedure CalcRect(Var R:TRect; InflateChartRectangle:Boolean);
Function CalcZPos:Integer;
Procedure DrawTitle(x,y:Integer);
Function GetGridCentered:Boolean;
Function GetLabels:Boolean;
Function GetLabelsFont:TTeeFont;
Function GetRectangleEdge(Const R:TRect):Integer;
Procedure IncDecDateTime( Increment:Boolean;
Var Value:Double;
Const AnIncrement:Double;
tmpWhichDateTime:TDateTimeStep );
Function LogXPosValue(Const Value:TChartValue):Integer;
Function LogYPosValue(Const Value:TChartValue):Integer;
Function InternalCalcDepthPosValue(Const Value:TChartValue):Integer;
Procedure InternalCalcRange;
Procedure InternalCalcPositions;
Function InternalCalcSize( tmpFont:TTeeFont;
tmpAngle:Integer;
Const tmpText:String;
tmpSize:Integer):Integer;
Function InternalLabelSize(Const Value:Double; IsWidth:Boolean):Integer;
Procedure InternalSetMaximum(Const Value:Double);
Procedure InternalSetMinimum(Const Value:Double);
function IsAxisValuesFormatStored:Boolean;
function IsLogBaseStored: Boolean;
Function IsMaxStored:Boolean;
Function IsMinStored:Boolean;
Function IsPosStored:Boolean;
Function IsStartStored:Boolean;
Function IsEndStored:Boolean;
Function IsCustom:Boolean;
function IsZStored: Boolean;
Procedure RecalcSizeCenter;
procedure SetHorizontal(const Value: Boolean);
procedure SetOtherSide(const Value: Boolean);
procedure SetLabelsExponent(Value: Boolean);
procedure SetZPosition(const Value: Double);
Procedure SetCalcPosValue;
procedure SetMaximumOffset(const Value: Integer);
procedure SetMinimumOffset(const Value: Integer);
Function XPosValue(Const Value:TChartValue):Integer;
Function YPosValue(Const Value:TChartValue):Integer;
Function XPosValueCheck(Const Value:TChartValue):Integer;
Function YPosValueCheck(Const Value:TChartValue):Integer;
protected
IHideBackGrid : Boolean;
OnDrawGrids : TAxisDrawGrids;
Tick : TAxisTicks;
Function AxisRect:TRect;
Function InternalCalcLabelStyle:TAxisLabelStyle; virtual;
Procedure InternalSetInverted(Value:Boolean);
Function SizeLabels:Integer;
Function SizeTickAxis:Integer;
public
IStartPos : Integer;
IEndPos : Integer;
IAxisSize : Integer;
CalcXPosValue : TAxisCalcPos;
CalcYPosValue : TAxisCalcPos;
CalcPosValue : TAxisCalcPos;
{$IFDEF D5}
Constructor Create(Chart:TCustomAxisPanel); reintroduce; overload;
{$ENDIF}
Constructor Create(Collection:TCollection); {$IFDEF D5}overload;{$ENDIF} override;
Destructor Destroy; override;
Procedure AdjustMaxMin;
Procedure AdjustMaxMinRect(Const Rect:TRect);
procedure Assign(Source: TPersistent); override;
Function CalcIncrement:Double;
Function CalcLabelStyle:TAxisLabelStyle;
Procedure CalcMinMax(Var AMin,AMax:Double);
Function CalcPosPoint(Value:Integer):Double;
Function CalcSizeValue(Const Value:Double):Integer;
Function CalcXYIncrement(MaxLabelSize:Integer):Double;
Procedure CustomDraw( APosLabels,APosTitle,APosAxis:Integer;
GridVisible:Boolean);
Procedure CustomDrawMinMax( APosLabels,
APosTitle,
APosAxis:Integer;
GridVisible:Boolean;
Const AMinimum,AMaximum,AIncrement:Double);
Procedure CustomDrawMinMaxStartEnd( APosLabels,
APosTitle,
APosAxis:Integer;
GridVisible:Boolean;
Const AMinimum,AMaximum,AIncrement:Double;
AStartPos,AEndPos:Integer);
Procedure CustomDrawStartEnd( APosLabels,APosTitle,APosAxis:Integer;
GridVisible:Boolean; AStartPos,AEndPos:Integer);
Function Clicked(x,y:Integer):Boolean;
Procedure Draw(CalcPosAxis:Boolean);
procedure DrawAxisLabel(x,y,Angle:Integer; Const St:String; Format:TTeeCustomShape=nil);
Function IsDateTime:Boolean;
Function LabelWidth(Const Value:Double):Integer;
Function LabelHeight(Const Value:Double):Integer;
Function LabelValue(Const Value:Double):String;
Function MaxLabelsWidth:Integer;
Procedure Scroll(Const Offset:Double; CheckLimits:Boolean);
Procedure SetMinMax(AMin,AMax:Double);
{ public }
property IsDepthAxis : Boolean read IDepthAxis;
property Items : TAxisItems read FItems;
property PosAxis : Integer read FPosAxis;
property PosLabels : Integer read FPosLabels;
property PosTitle : Integer read FPosTitle;
property ParentChart : TCustomAxisPanel read FParentChart;
published
property Automatic:Boolean read FAutomatic write SetAutomatic default True;
property AutomaticMaximum:Boolean read FAutomaticMaximum write SetAutomaticMaximum default True;
property AutomaticMinimum:Boolean read FAutomaticMinimum write SetAutomaticMinimum default True;
property Axis:TChartAxisPen read FAxis write SetAxis;
property AxisValuesFormat:String read FAxisValuesFormat
write SetValuesFormat stored IsAxisValuesFormatStored;
property DateTimeFormat:String read FDateTimeFormat write SetDateTimeFormat;
property ExactDateTime:Boolean read FExactDateTime write SetExactDateTime default True;
property Grid:TAxisGridPen read FGrid write SetGrid;
property GridCentered:Boolean read GetGridCentered write SetGridCentered default False;
property Increment:Double read FDesiredIncrement write SetDesiredIncrement;
property Inverted:Boolean read FInverted write SetInverted default False;
property Horizontal : Boolean read FHorizontal write SetHorizontal stored IsCustom;
property OtherSide : Boolean read FOtherSide write SetOtherSide stored IsCustom;
property Labels:Boolean read GetLabels write SetLabels default True;
property LabelsAlign:TAxisLabelAlign read FLabelsAlign write SetLabelsAlign default alDefault;
property LabelsAngle:Integer read FLabelsAngle write SetLabelsAngle default 0;
property LabelsExponent:Boolean read FLabelsExponent write SetLabelsExponent default False;
property LabelsFont:TTeeFont read GetLabelsFont write SetLabelsFont {stored IsFontStored};
property LabelsMultiLine:Boolean read FLabelsMultiLine write SetLabelsMultiLine default False;
property LabelsOnAxis:Boolean read FLabelsOnAxis write SetLabelsOnAxis default True;
property LabelsSeparation:Integer read FLabelsSeparation
write SetLabelsSeparation default 10;
property LabelsSize:Integer read FLabelsSize write SetLabelsSize default 0;
property LabelStyle:TAxisLabelStyle read FLabelStyle write SetLabelStyle default talAuto;
property Logarithmic:Boolean read FLogarithmic write SetLogarithmic default False;
property LogarithmicBase:Double read FLogarithmicBase write SetLogarithmicBase stored IsLogBaseStored;
property Maximum:Double read FMaximumValue write SetMaximum stored IsMaxStored;
property MaximumOffset:Integer read FMaximumOffset write SetMaximumOffset default 0;
property Minimum:Double read FMinimumValue write SetMinimum stored IsMinStored;
property MinimumOffset:Integer read FMinimumOffset write SetMinimumOffset default 0;
property MinorGrid:TChartHiddenPen read FMinorGrid write SetMinorGrid;
property MinorTickCount:Integer read FMinorTickCount write SetMinorTickCount default 3;
property MinorTickLength:Integer read FMinorTickLength write SetMinorTickLength default 2;
property MinorTicks:TDarkGrayPen read FMinorTicks write SetMinorTicks;
property StartPosition:Double read FStartPosition write SetStartPosition
stored IsStartStored;
property EndPosition:Double read FEndPosition write SetEndPosition
stored IsEndStored;
property PositionPercent:Double read FPositionPercent write SetPositionPercent
stored IsPosStored;
property PositionUnits:TTeeUnits read FPosUnits write SetPosUnits default muPercent;
property RoundFirstLabel:Boolean read FRoundFirstLabel write SetRoundFirstLabel default True;
property TickInnerLength:Integer read FTickInnerLength write SetTickInnerLength default 0;
property TickLength:Integer read FTickLength write SetTickLength default 4;
property Ticks:TDarkGrayPen read FTicks write SetTicks;
property TicksInner:TDarkGrayPen read FTicksInner write SetTicksInner;
property TickOnLabelsOnly:Boolean read FTickOnLabelsOnly write SetTickOnLabelsOnly default True;
property Title:TChartAxisTitle read FAxisTitle write SetAxisTitle;
property TitleSize:Integer read FTitleSize write SetTitleSize default 0;
property Visible:Boolean read FVisible write SetVisible default True;
property ZPosition:Double read FZPosition write SetZPosition stored IsZStored;
end;
TChartDepthAxis=class(TChartAxis)
protected
Function InternalCalcLabelStyle:TAxisLabelStyle; override;
published
property Visible default False;
end;
TAxisOnGetLabel=Procedure( Sender:TChartAxis; Series:TChartSeries;
ValueIndex:Integer; Var LabelText:String) of object;
TAxisOnGetNextLabel=Procedure( Sender:TChartAxis; LabelIndex:Integer;
Var LabelValue:Double; Var Stop:Boolean) of object;
TSeriesClick=procedure( Sender:TChartSeries;
ValueIndex:Integer;
Button:TMouseButton;
Shift: TShiftState;
X, Y: Integer) of object;
TValueEvent=(veClear,veAdd,veDelete,veRefresh,veModify);
THorizAxis = (aTopAxis,aBottomAxis,aBothHorizAxis,aCustomHorizAxis);
TVertAxis = (aLeftAxis,aRightAxis,aBothVertAxis,aCustomVertAxis);
TChartClickedPartStyle=( cpNone,
cpLegend,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -