Class TBWGraph (unit BWGraphs)

Inherits from

TGraphicControl

TGraphType = (gtMoveCurrent, gtMoveAll);

Constructors


constructor Create( AOwner : TComponent ) ;

Public declarations

Destroy



Functions

function AddEntry : TDataEntry ;

Adds the entry to the list

CreateEntry } { Adds the entry to the list


procedure DeleteEntry( index:integer ) ;

InsertEntry

destructor Destroy;

SetColumnEntry

function InsertEntry( index: integer ) : TDataEntry ;

AddEntry

procedure Print ;

Prints the graph

SetShowGrid } (* procedure TBWGraph.


procedure Refresh ;

Refreshes the graph

DeleteEntry } { Refreshes the graph


function CreateEntry : TDataEntry ;

Protected declarations

Print


procedure DoDrawGraph( Surface : TCanvas ) ;

Performs actual drawing

Refresh } { Performs actual drawing


function GetLegendRect : TRect ;

Returns the rectangle for legend

Paint } { Returns the rectangle for legend


function GetMainRect : TRect ;

Returns the rectangle for the graph

SetLegendWidth } { Returns the rectangle for the graph


function GetMinMaxRect : TRect ;

Returns rectangle for MinMaxInfo

GetLegendRect } { Returns rectangle for MinMaxInfo


procedure Paint ;

DoDrawGraph

procedure TriggerResizeEvent ;

WMSize

function GetColumnEntry : TDataEntry ;

SetVGridLines

function GetDataList( index :integer ) : TDataEntry ;

SetLimit

function GetEntriesCount : Integer ;

SetShowMinMax

procedure SetColumnEntry( newValue : TDataEntry ) ;

GetColumnEntry

procedure SetHGridLines( newValue : Integer ) ;

SetMinMaxEntry

procedure SetLegendAtRight( newValue : Boolean ) ;

procedure SetGraphType( newValue : TGraphType ) ;

GetMinMaxRect


procedure SetLegendBkColor( newValue : TColor ) ;

GetMainRect

procedure SetLegendWidth( newValue : Integer ) ;

SetLegendAtRight

procedure SetMinMaxEntry( newValue : TDataEntry ) ;

TriggerResizeEvent

procedure SetShowGrid( newValue : Boolean ) ;

GetEntriesCount

procedure SetShowLegend( newValue : Boolean ) ;

GetDataList

procedure SetShowMinMax( newValue : Boolean ) ;

SetShowLegend

procedure SetVGridLines( newValue : Integer ) ;

SetHGridLines

procedure WMSize( var Msg : TWMSize ) ;

Calls OnResize handler

SetLegendBkColor


Properties

property Align :

Published } // property GraphType : TGraphType read FGraphType write SetGraphType ; { Published } { Inherited properties:

property Canvas :


property Color :


property Enabled :


property Font :


property HGridLines : Integer

Ammount of horizontal lines of the grid

property LegendAtRight : Boolean

Legend is positioned at the right side of the graph

property LegendBkColor : TColor

Published } { Background color for legend and MinMax Info

property LegendWidth : Integer

Published } { Legend panel width

property ParentColor :


property ParentFont :


property ParentShowHint :


property ShowGrid : Boolean

Published } { Show grid lines?

property ShowHint :


property ShowLegend : Boolean

Published properties and events } { Does the graph show the legend?

property ShowMinMax : Boolean

Published } { Show min, max and average values of the selected entry?

property VGridLines : Integer

Published } { Ammount of vertical lines of the grid

property Visible :


property ColumnEntry : TDataEntry

Public } { Entry, that has attribute "Column"

property DataList : TDataEntry

Arrays of integer values for graph entry

property EntriesCount : Integer

Public } { Ammount of entries

property MinMaxEntry : TDataEntry

Public

Events

event OnClick :

Inherited events:

event OnDblClick :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


event OnResize : TNotifyEvent

Published } { Occurs when the graph is resized

Variables

FColumnEntry : TDataEntry ;


FEntryList : TList ;

List of all graph entries

FHGridLines : Integer ;


FLegendAtRight : Boolean ;


FLegendBkColor : TColor ;

Defined in Classes unit.

FLegendWidth : Integer ;


FMinMaxEntry : TDataEntry;

FGraphType : TGraphType ;

FOnResize : TNotifyEvent ;


FShowGrid : Boolean ;


FShowLegend : Boolean ;

- Initialized to nil.

FShowMinMax : Boolean ;


FVGridLines : Integer ;



Constructors


constructor Create( AOwner : TComponent ) ;

Public declarations

Destroy


Functions


function AddEntry : TDataEntry ;

Adds the entry to the list

CreateEntry } { Adds the entry to the list


procedure DeleteEntry( index:integer ) ;

InsertEntry


destructor Destroy;

SetColumnEntry


function InsertEntry( index: integer ) : TDataEntry ;

AddEntry


procedure Print ;

Prints the graph

SetShowGrid } (* procedure TBWGraph.SetGraphType( newValue : TGraphType ) ; { Sets data member FGraphType to newValue. } begin if FGraphType <> newValue then begin FGraphType := newValue ; Repaint; end ; { if } end ; { SetGraphType } *) { Prints the graph


procedure Refresh ;

Refreshes the graph

DeleteEntry } { Refreshes the graph


function CreateEntry : TDataEntry ;

Protected declarations

Print


procedure DoDrawGraph( Surface : TCanvas ) ;

Performs actual drawing

Refresh } { Performs actual drawing


function GetLegendRect : TRect ;

Returns the rectangle for legend

Paint } { Returns the rectangle for legend


function GetMainRect : TRect ;

Returns the rectangle for the graph

SetLegendWidth } { Returns the rectangle for the graph


function GetMinMaxRect : TRect ;

Returns rectangle for MinMaxInfo

GetLegendRect } { Returns rectangle for MinMaxInfo


procedure Paint ;

DoDrawGraph


procedure TriggerResizeEvent ;

WMSize


function GetColumnEntry : TDataEntry ;

SetVGridLines


function GetDataList( index :integer ) : TDataEntry ;

SetLimit


function GetEntriesCount : Integer ;

SetShowMinMax


procedure SetColumnEntry( newValue : TDataEntry ) ;

GetColumnEntry


procedure SetHGridLines( newValue : Integer ) ;

SetMinMaxEntry


procedure SetLegendAtRight( newValue : Boolean ) ;

procedure SetGraphType( newValue : TGraphType ) ;

GetMinMaxRect


procedure SetLegendBkColor( newValue : TColor ) ;

GetMainRect


procedure SetLegendWidth( newValue : Integer ) ;

SetLegendAtRight


procedure SetMinMaxEntry( newValue : TDataEntry ) ;

TriggerResizeEvent


procedure SetShowGrid( newValue : Boolean ) ;

GetEntriesCount


procedure SetShowLegend( newValue : Boolean ) ;

GetDataList


procedure SetShowMinMax( newValue : Boolean ) ;

SetShowLegend


procedure SetVGridLines( newValue : Integer ) ;

SetHGridLines


procedure WMSize( var Msg : TWMSize ) ;

Calls OnResize handler

SetLegendBkColor


Properties


property Align :

Published } // property GraphType : TGraphType read FGraphType write SetGraphType ; { Published } { Inherited properties:


property Canvas :


property Color :


property Enabled :


property Font :


property HGridLines : Integer

Ammount of horizontal lines of the grid


property LegendAtRight : Boolean

Legend is positioned at the right side of the graph


property LegendBkColor : TColor

Published } { Background color for legend and MinMax Info


property LegendWidth : Integer

Published } { Legend panel width


property ParentColor :


property ParentFont :


property ParentShowHint :


property ShowGrid : Boolean

Published } { Show grid lines?


property ShowHint :


property ShowLegend : Boolean

Published properties and events } { Does the graph show the legend?


property ShowMinMax : Boolean

Published } { Show min, max and average values of the selected entry?


property VGridLines : Integer

Published } { Ammount of vertical lines of the grid


property Visible :


property ColumnEntry : TDataEntry

Public } { Entry, that has attribute "Column"


property DataList : TDataEntry

Arrays of integer values for graph entry


property EntriesCount : Integer

Public } { Ammount of entries


property MinMaxEntry : TDataEntry

Public


Events


event OnClick :

Inherited events:


event OnDblClick :


event OnMouseDown :


event OnMouseMove :


event OnMouseUp :


event OnResize : TNotifyEvent

Published } { Occurs when the graph is resized


Variables


FColumnEntry : TDataEntry ;


FEntryList : TList ;

List of all graph entries


FHGridLines : Integer ;


FLegendAtRight : Boolean ;


FLegendBkColor : TColor ;

Defined in Classes unit.


FLegendWidth : Integer ;


FMinMaxEntry : TDataEntry;

FGraphType : TGraphType ;


FOnResize : TNotifyEvent ;


FShowGrid : Boolean ;


FShowLegend : Boolean ;

- Initialized to nil.


FShowMinMax : Boolean ;


FVGridLines : Integer ;