Difference between revisions of "TAChart Chart"

From Free Pascal wiki
Jump to navigationJump to search
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The Chart is the component from where you control much of the behaviour of your diagrams.
+
!! Under Construction... !!
 +
 
 +
The Chart is the component from where you control much of the behavior of your diagrams.
  
<br>
 
 
* [[#Methods_Public_id|'''Public Methods''']]
 
* [[#Methods_Public_id|'''Public Methods''']]
 +
*:Clone
 +
*:SaveToImage
 +
*:GetFullExtent
 +
*:GetLegendItems
 +
*:GraphToImage
 +
*:ImageToGraph
 +
*:XGraphToImage
 +
*:XImageToGraph
 +
*:YGraphToImage
 +
*:YImageToGraph
 +
# [[#IsPointInViewPort_id|'''IsPointInViewPort <F>''']]
 +
# [[#EraseBackground_id|'''EraseBackground <P>''']]
 +
# [[#GetChildren_id|'''Procedure GetChildren''']]
 +
# [[#Paint_id|'''Procedure Paint''']]
 +
# [[#SetChildOrder_id|'''Procedure SetChildOrder''']]
 +
# [[#DrawLineHoriz_id|'''Procedure DrawLineHoriz''']]
 +
# [[#DrawLineVert_id|'''Procedure DrawLineVert''']]
 +
# [[#DrawOnCanvas_id|'''Procedure DrawOnCanvas''']]
 +
#:AddSeries
 +
#:DeleteSeries
 +
#:RemoveSeries
 +
#:ClearSeries
 +
#:CopyToClipboardBitmap
 +
#:DisableRedrawing
 +
#:Draw
 +
#:DrawLegendOn
 +
#:EnableRedrawing
 +
#:PaintOnAuxCanvas
 +
#:PaintOnCanvas
 +
#:Prepare
 +
#:SaveToBitmapFile
 +
#:SaveToFile
 +
#:StyleChanged
 +
#:ZoomFull
 +
# [[#Properties_id|'''Properties''']]
 +
* [[#Published_prop_id|'''Published''']]
 +
*: Align
 +
*: Anchors
 +
*: BorderSpacing
 +
*: Color
 +
*: DoubleBuffered
 +
*: DragCursor
 +
*: DragMode
 +
*: Enabled
 +
*: ParentColor
 +
*: ParentShowHint
 +
*: PopupMenu
 +
*: ShowHint
 +
*: Visible
 +
*: Drawer
 +
*: AutoFocus
 +
*: AllowZoom
 +
*: AntialiasingMode
 +
*: AxisList
 +
*: AxisVisible
 +
*: BackColor
 +
*: BottomAxis
 +
*: Depth
 +
*: ExpandPercentage
 +
*: Extent
 +
*: ExtentSizeLimit
 +
*: Foot
 +
*: Frame
 +
*: GUIConnector
 +
*: LeftAxis
 +
*: Legend
 +
*: Margins
 +
*: MarginsExternal
 +
*: Proportional
 +
*: ReticuleMode
 +
*: Series
 +
*: Title
 +
*: Toolset
 +
* [[#Unpublished_prop_id|'''Unpublished''']]
 +
ActiveToolIndex <br>
 +
Broadcaster <br>
 +
ChartHeight <br>
 +
ChartWidth <br>
 +
ClipRect <br>
 +
CurrentExtent <br>
 +
ExtentBroadcaster <br>
 +
IsZoomed <br>
 +
LogicalExtent <br>
 +
OnChartPaint <br>
 +
PrevLogicalExtent <br>
 +
RenderingParams <br>
 +
ReticulePos <br>
 +
SeriesCount <br>
 +
XGraphMax <br>
 +
XGraphMin <br>
 +
YGraphMax <br>
 +
YGraphMin <br>
 +
# [[#Events_id|'''Events''']]
 +
OnAfterDraw <br>
 +
OnAfterDrawBackground <br>
 +
OnAfterDrawBackWall <br>
 +
OnAfterPaint <br>
 +
OnBeforeDrawBackground <br>
 +
OnBeforeDrawBackWall <br>
 +
OnDrawReticule <br>
 +
OnExtentChanged <br>
 +
OnExtentChanging <br>
 +
OnClick <br>
 +
OnDblClick <br>
 +
OnDragDrop <br>
 +
OnDragOver <br>
 +
OnEndDrag <br>
 +
OnMouseDown <br>
 +
OnMouseMove <br>
 +
OnMouseUp <br>
 +
OnStartDrag <br>
  
** [[#IsPointInViewPort_id|'''IsPointInViewPort [F]''']]
 
** [[#EraseBackground_id|'''EraseBackground [P]''']]
 
** [[#GetChildren_id|'''Procedure GetChildren''']]
 
** [[#Paint_id|'''Procedure Paint''']]
 
** [[#SetChildOrder_id|'''Procedure SetChildOrder''']]
 
** [[#DrawLineHoriz_id|'''Procedure DrawLineHoriz''']]
 
** [[#DrawLineVert_id|'''Procedure DrawLineVert''']]
 
** [[#DrawOnCanvas_id|'''Procedure DrawOnCanvas''']]
 
* [[#Properties_id|'''Properties''']]
 
** [[#Published_prop_id|'''Published''']]
 
** [[#Unpublished_prop_id|'''Published''']]
 
* [[#Events_id|'''Events''']]
 
  
 
<br>
 
 
* [[#Methods_Public_id|'''Public Methods''']]
 
* [[#Methods_Public_id|'''Public Methods''']]
 
** [[#Functions_id|'''Functions''']]
 
** [[#Functions_id|'''Functions''']]
Line 34: Line 132:
 
** [[#Unpublished_prop_id|'''Published''']]
 
** [[#Unpublished_prop_id|'''Published''']]
 
* [[#Events_id|'''Events''']]
 
* [[#Events_id|'''Events''']]
 
 
<br><br><br>
 
  
 
   public // Helpers for series drawing
 
   public // Helpers for series drawing
    procedure DrawLineHoriz(ADrawer: IChartDrawer; AY: Integer);
 
    procedure DrawLineVert(ADrawer: IChartDrawer; AX: Integer);
 
    procedure DrawOnCanvas(Rect: TRect; ACanvas: TCanvas); deprecated;
 
    function IsPointInViewPort(const AP: TDoublePoint): Boolean;
 
 
  public
 
    procedure AddSeries(ASeries: TBasicChartSeries);
 
    procedure ClearSeries;
 
    function Clone: TChart;
 
    procedure CopyToClipboardBitmap;
 
    procedure DeleteSeries(ASeries: TBasicChartSeries);
 
    procedure DisableRedrawing;
 
    procedure Draw(ADrawer: IChartDrawer; const ARect: TRect);
 
    procedure DrawLegendOn(ACanvas: TCanvas; var ARect: TRect);
 
    procedure EnableRedrawing;
 
    function GetFullExtent: TDoubleRect;
 
    function GetLegendItems(AIncludeHidden: Boolean = false): TChartLegendItems;
 
    procedure PaintOnAuxCanvas(ACanvas: TCanvas; ARect: TRect);
 
    procedure PaintOnCanvas(ACanvas: TCanvas; ARect: TRect);
 
    procedure Prepare;
 
    procedure RemoveSeries(ASeries: TBasicChartSeries); inline;
 
    procedure SaveToBitmapFile(const AFileName: String); inline;
 
    procedure SaveToFile(AClass: TRasterImageClass; AFileName: String);
 
    function SaveToImage(AClass: TRasterImageClass): TRasterImage;
 
    procedure StyleChanged(Sender: TObject); override;
 
    procedure ZoomFull(AImmediateRecalc: Boolean = false); override;
 
    property Drawer: IChartDrawer read FConnectorData.FDrawer;
 
 
  public // Coordinate conversion
 
    function GraphToImage(const AGraphPoint: TDoublePoint): TPoint;
 
    function ImageToGraph(const APoint: TPoint): TDoublePoint; overload;
 
    function ImageToGraph(const AX, AY: Integer): TDoublePoint; overload;
 
    function XGraphToImage(AX: Double): Integer; inline;
 
    function XImageToGraph(AX: Integer): Double; inline;
 
    function YGraphToImage(AY: Double): Integer; inline;
 
    function YImageToGraph(AY: Integer): Double; inline;
 
 
  public
 
    property ActiveToolIndex: Integer read FActiveToolIndex;
 
    property Broadcaster: TBroadcaster read FBroadcaster;
 
    property ChartHeight: Integer read GetChartHeight;
 
    property ChartWidth: Integer read GetChartWidth;
 
    property ClipRect: TRect read FClipRect;
 
    property CurrentExtent: TDoubleRect read FCurrentExtent;
 
    property ExtentBroadcaster: TBroadcaster read FExtentBroadcaster;
 
    property IsZoomed: Boolean read FIsZoomed;
 
    property LogicalExtent: TDoubleRect read FLogicalExtent write SetLogicalExtent;
 
    property OnChartPaint: TChartPaintEvent
 
      read FOnChartPaint write SetOnChartPaint; experimental;
 
    property PrevLogicalExtent: TDoubleRect read FPrevLogicalExtent;
 
    property RenderingParams: TChartRenderingParams
 
      read GetRenderingParams write SetRenderingParams;
 
    property ReticulePos: TPoint read FReticulePos write SetReticulePos;
 
    property SeriesCount: Integer read GetSeriesCount;
 
    property XGraphMax: Double read FCurrentExtent.b.X;
 
    property XGraphMin: Double read FCurrentExtent.a.X;
 
    property YGraphMax: Double read FCurrentExtent.b.Y;
 
    property YGraphMin: Double read FCurrentExtent.a.Y;
 
 
  published
 
    property AutoFocus: Boolean read FAutoFocus write FAutoFocus default false;
 
    property AllowZoom: Boolean read FAllowZoom write FAllowZoom default true;
 
    property AntialiasingMode: TChartAntialiasingMode
 
      read FAntialiasingMode write SetAntialiasingMode default amDontCare;
 
    property AxisList: TChartAxisList read FAxisList write SetAxisList;
 
    property AxisVisible: Boolean read FAxisVisible write SetAxisVisible default true;
 
    property BackColor: TColor read FBackColor write SetBackColor default clBtnFace;
 
    property BottomAxis: TChartAxis index calBottom read GetAxisByAlign write SetAxisByAlign stored false;
 
    property Depth: TChartDistance read FDepth write SetDepth default 0;
 
    property ExpandPercentage: Integer
 
      read FExpandPercentage write SetExpandPercentage default 0;
 
    property Extent: TChartExtent read FExtent write SetExtent;
 
    property ExtentSizeLimit: TChartExtent read FExtentSizeLimit write SetExtentSizeLimit;
 
    property Foot: TChartTitle read FFoot write SetFoot;
 
    property Frame: TChartPen read FFrame write SetFrame;
 
    property GUIConnector: TChartGUIConnector
 
      read FGUIConnector write SetGUIConnector;
 
    property LeftAxis: TChartAxis index calLeft read GetAxisByAlign write SetAxisByAlign stored false;
 
    property Legend: TChartLegend read FLegend write SetLegend;
 
    property Margins: TChartMargins read FMargins write SetMargins;
 
    property MarginsExternal: TChartMargins
 
      read FMarginsExternal write SetMarginsExternal;
 
    property Proportional: Boolean
 
      read FProportional write SetProportional default false;
 
    property ReticuleMode: TReticuleMode
 
      read FReticuleMode write SetReticuleMode default rmNone;
 
    property Series: TChartSeriesList read FSeries;
 
    property Title: TChartTitle read FTitle write SetTitle;
 
    property Toolset: TBasicChartToolset read FToolset write SetToolset;
 
 
  published
 
    property OnAfterDraw: TDrawEvent read FOnAfterDraw write SetOnAfterDraw;
 
    property OnAfterDrawBackground: TChartAfterDrawEvent
 
      read FOnAfterDrawBackground write SetOnAfterDrawBackground;
 
    property OnAfterDrawBackWall: TChartAfterDrawEvent
 
      read FOnAfterDrawBackWall write SetOnAfterDrawBackWall;
 
    property OnAfterPaint: TChartEvent read FOnAfterPaint write FOnAfterPaint;
 
    property OnBeforeDrawBackground: TChartBeforeDrawEvent
 
      read FOnBeforeDrawBackground write SetOnBeforeDrawBackground;
 
    property OnBeforeDrawBackWall: TChartBeforeDrawEvent
 
      read FOnBeforeDrawBackWall write SetOnBeforeDrawBackWall;
 
    property OnDrawReticule: TDrawReticuleEvent
 
      read FOnDrawReticule write SetOnDrawReticule;
 
    property OnExtentChanged: TChartEvent
 
      read FOnExtentChanged write FOnExtentChanged;
 
    property OnExtentChanging: TChartEvent
 
      read FOnExtentChanging write FOnExtentChanging;
 
 
  published
 
    property Align;
 
    property Anchors;
 
    property BorderSpacing;
 
    property Color default clBtnFace;
 
    property DoubleBuffered;
 
    property DragCursor;
 
    property DragMode;
 
    property Enabled;
 
    property ParentColor;
 
    property ParentShowHint;
 
    property PopupMenu;
 
    property ShowHint;
 
    property Visible;
 
  
  published
+
[[Category:Old or unknown pages]]
    property OnClick;
 
    property OnDblClick;
 
    property OnDragDrop;
 
    property OnDragOver;
 
    property OnEndDrag;
 
    property OnMouseDown;
 
    property OnMouseMove;
 
    property OnMouseUp;
 
    property OnStartDrag;
 

Latest revision as of 10:58, 2 February 2017

!! Under Construction... !!

The Chart is the component from where you control much of the behavior of your diagrams.

  • Public Methods
    Clone
    SaveToImage
    GetFullExtent
    GetLegendItems
    GraphToImage
    ImageToGraph
    XGraphToImage
    XImageToGraph
    YGraphToImage
    YImageToGraph
  1. IsPointInViewPort <F>
  2. EraseBackground

  3. Procedure GetChildren
  4. Procedure Paint
  5. Procedure SetChildOrder
  6. Procedure DrawLineHoriz
  7. Procedure DrawLineVert
  8. Procedure DrawOnCanvas
    AddSeries
    DeleteSeries
    RemoveSeries
    ClearSeries
    CopyToClipboardBitmap
    DisableRedrawing
    Draw
    DrawLegendOn
    EnableRedrawing
    PaintOnAuxCanvas
    PaintOnCanvas
    Prepare
    SaveToBitmapFile
    SaveToFile
    StyleChanged
    ZoomFull
  9. Properties
  • Published
    Align
    Anchors
    BorderSpacing
    Color
    DoubleBuffered
    DragCursor
    DragMode
    Enabled
    ParentColor
    ParentShowHint
    PopupMenu
    ShowHint
    Visible
    Drawer
    AutoFocus
    AllowZoom
    AntialiasingMode
    AxisList
    AxisVisible
    BackColor
    BottomAxis
    Depth
    ExpandPercentage
    Extent
    ExtentSizeLimit
    Foot
    Frame
    GUIConnector
    LeftAxis
    Legend
    Margins
    MarginsExternal
    Proportional
    ReticuleMode
    Series
    Title
    Toolset
  • Unpublished

ActiveToolIndex
Broadcaster
ChartHeight
ChartWidth
ClipRect
CurrentExtent
ExtentBroadcaster
IsZoomed
LogicalExtent
OnChartPaint
PrevLogicalExtent
RenderingParams
ReticulePos
SeriesCount
XGraphMax
XGraphMin
YGraphMax
YGraphMin

  1. Events

OnAfterDraw
OnAfterDrawBackground
OnAfterDrawBackWall
OnAfterPaint
OnBeforeDrawBackground
OnBeforeDrawBackWall
OnDrawReticule
OnExtentChanged
OnExtentChanging
OnClick
OnDblClick
OnDragDrop
OnDragOver
OnEndDrag
OnMouseDown
OnMouseMove
OnMouseUp
OnStartDrag


 public // Helpers for series drawing