SimChart 2.4 Reference
Hierarchy:
TGraphicControl
|
+-- TSCMain
|
+-- TSCChart
|
+-- TSCPie
|
+-- TSCHBar
New properties, events and methods:
TSCChart | ||||
Properties | ||||
BarStyle DataHLOC DataValues Kind LeftVisiblePoint MarkerSize MarkerStyle |
NSeries NVisiblePoint Options PenStyle PenWidth Percent3D ValueFormatLeft |
ValueFormatRight WallColor XAxis XCaption XGridColor YLeftAxis YLeftCaption |
YLeftGridColor YLeftInitValue YRightAxis YRightCaption YRightGridColor YRightInitValue |
|
Derived from TSCMain | ||||
AntiAlias BackColor BorderWidth BottomCaption |
BufferedDisplay Chart3D ColorValues ForeColor |
HintOptions Legend NPoint |
PointLabels SeriesLabels TopCaption |
|
Methods | ||||
AddBarSeries AddLineSeries |
AddSeries CalcXPoint |
CalcYValue DeleteSeries |
GetPercent | |
Derived from TSCMain | ||||
BeginUpdate ClearData CopyToBitmap |
CopyToMetafile EndUpdate |
PtInChart SHLPoint |
SHRPoint SwapSeries |
|
Events | ||||
Derived from TSCMain | ||||
OnClickOnChart | OnGetHint | OnAfterDraw |
TSCMain
Properties
property AntiAlias: Boolean;
Improve chart image by using anti-alias process.
property BackColor: TColor;
Specifies background color.
property BorderWidth: Integer;
BorderWidth is the distance, in pixels, between component border and the chart image.
property BottomCaption: string;
Places a text on the bottom of the chart. Can use little HTML
formating.
property BufferedDisplay: Boolean;
If set to True, the chart image is drawn to a temporary canvas and then copied to the
screen to prevent screen "flickering".
property Chart3D: Boolean;
If set to True it will display the chart in perspective view (3D). You can then change the 3D depth using Percent3D property.
property ColorValues[ASeries: Integer]: TColor;
This property is used to store color information for each series.
property ForeColor: TColor;
Specifies foreground color.
property HintOptions: THintOptions;
THintOption = ( hoSeries, hoPoint, hoValue, hoPercent, hoFocus );
THintOptions = set of THintOption;
HintOptions specifies default hint text.
property Legend: TLegend;
Change various legend display properties.
property NPoint: Integer;
Specifies number of data point for each series.
property PointLabels[APoint: Integer]: string;
This property is used to store data point labels.
property SeriesLabels[ASeries: Integer]:
string;
This property is used to store series labels. These labels are then used as
legend text to draw legend.
property TopCaption: string;
Places a text on the top of the chart, commonly used to display chart title. Can use
little HTML formating.
Methods
procedure BeginUpdate;
BeginUpdate method suspends updating of the chart until EndUpdate method is
called. Call this method before making multiple changes to the chart to prevent
multiple recalculations and redraws.
procedure ClearData( Flag: TClear );
TClear = ( clAll, clDataValue, clSeriesLabel, clPointLabel );
Clear chart data as specified by the Flag parameter.
procedure CopyToBitmap( var ABitmap: TBitmap; W, H: Integer;
BorderWidth: Integer = -1; AntiAlias: Boolean = False );
Copy the chart image to ABitmap in bitmap format.
procedure CopyToMetafile( var AMetafile: TMetafile; W, H: Integer;
BorderWidth: Integer = -1 );
Copy the chart image to AMetafile in metafile format. Unavailable on Kylix
version.
procedure EndUpdate;
EndUpdate method re-enables chart updating that was turned off with BeginUpdate method.
function PtInChart( X, Y: Integer; var ASArea: TSArea ): Boolean;
TSArea = record
Series, Point, Legend: Integer;
R: TRect;
end;
Use this method to get chart area information on coordinate (X, Y).
procedure SHLPoint( APoint: Integer );
Shift left the chart data, and fill the right side with zero.
procedure SHRPoint( APoint: Integer );
Shift right the chart data, and fill the left side with zero.
procedure SwapSeries( Series1, Series2: Integer );
Exchange the series position of two series in the chart.
Events
property OnClickOnChart: TClickOnChartEvent = procedure( Sender: TObject; Shift: TShiftState; ASeries,
APoint, ALegend: Integer ) of object;
OnClickOnChart occurs when the user clicks on the chart.
property OnGetHint: TGetHintEvent = procedure( Sender: TObject; ASeries, APoint, ALegend: Integer;
var HintText: string ) of object;
OnGetHint occurs when the hint window is about to be displayed. You can modify the HintText variable to change the default hint text. Hint text can use
little HTML formating.
property OnAfterDraw: TNotifyEvent;
OnAfterDraw occurs when the chart just has been drawn.
TSCChart
Properties
property BarStyle[ASeries: Integer]: TBarStyle;
For bar chart only. Change bar style for each series.
TBarStyle = ( bsBar, bsCylinder, bsPyramid, bsCone );
property DataHLOC[ASeries, APoint: Integer]: THLOC;
THLOC = record
Hi, Lo, Open, Close: Double;
end;
Use this property to enter data values for hi-lo, hi-lo-close, hi-lo-open-close and candle stick chart.
Values are entered in the order of hi, lo, open and then close value.
property DataValues[ASeries, APoint: Integer]: Double;
Enter chart data value using this property. ASeries is the series position and APoint is the point position of each data value.
For hi-lo, hi-lo-close, hi-lo-open-close and candle stick chart use property
DataHLOC.
property Kind[ASeries: Integer]: TChartKind;
TChartKind = ( ckLine, ckStair, ckArea, ckBar, ckHL, ckHLC, ckHLOC, ckCStick, ckCBar, ckSArea, ckSBar, ckS100Area, ckS100Bar );
Specifies chart type for each series to be drawn.
property LeftVisiblePoint: Integer;
Used to scroll the visible data point that has been set by
NVisiblePoint property.
property MarkerSize[ASeries: Integer]: Byte;
For 2D line chart (ckLine) only. Specifies the size of marker in pixels.
property MarkerStyle[ASeries: Integer]: TMarkerStyle;
TMarkerStyle = ( msNone, msSquare, msDiamond, msUpTri, msDownTri, msRound );
For 2D line chart (ckLine) only. Specifies the style used to draw the line
marker.
property NSeries: Integer;
NSeries is the number of series on the chart.
property NVisiblePoint: Integer
Set number of visible point.
property Options: TCOptions;
TCOption = ( coRotateXLabel, coStaggerXLabel, coHideWall );
TCOptions = set of TCOption;
Change chart various appearance.
property PenStyle[ASeries: Integer]: TPenStyle;
TPenStyle = ( psSolid, psDash, psDot, psDashDot, psDashDotDot, psClear, psInsideFrame
);
For 2D line and stair chart (ckLine and ckStair) only. Change pen style used to
draw the line.
property PenWidth[ASeries: Integer]: Byte;
For 2D line and stair chart (ckLine and ckStair) only. Set pen width used to
draw the line.
property Percent3D: Integer;
Change the depth ratio on 3D-chart. You can specify a percent number from 1 to 100.
property ValueFormatLeft: string;
Set text used to format y-left-axis value.
property ValueFormatRight: string;
Set text used to format y-right-axis value.
property WallColor: TColor;
Specifies the color of the chart wall.
property XAxis: TAxis;
Change display properties for x-axis.
property XCaption: string;
Set x-axis caption text.
property XGridColor: TColor;
Specifies x-axis grid line color.
property YAxis[ASeries: Integer]: TYAxis;
TYAxis = ( yaLeft, yaRight );
Specifies which y-axis used for each series.
property YLeftAxis: TAxis;
Change display properties for y-left-axis.
property YLeftCaption: string;
Set y-left-axis caption text.
property YLeftGridColor: TColor;
Specifies y-left-axis grid line color.
property YLeftInitValue: TYInitValue;
Define initial max and min values for y-left-axis.
property YRightAxis: TAxis;
Change display properties for y-right-axis.
property YRightCaption: string;
Set y-right-axis caption text.
property YRightGridColor: TColor;
Specifies y-right-axis grid line color.
property YRightInitValue: TYInitValue;
Define initial max and min values for y-right-axis.
Methods
procedure AddBarSeries( AKind: TChartKind; AYAxis: TYAxis; AColor: TColor;
ALabel: string; ABarStyle: TBarStyle );
Use this method to add a bar series with its attributes.
procedure AddLineSeries( AYAxis: TYAxis; AColor: TColor; ALabel: string; MarkerStyle: TMarkerStyle; MarkerSize, PenWidth: Byte; PenStyle: TPenStyle );
Use this method to add a 2D line series with its attributes.
procedure AddSeries( AKind: TChartKind; AYAxis: TYAxis; AColor: TColor; ALabel: string );
Use this method to add a series on the chart.
procedure DeleteSeries( ASeries: Integer );
This method is used to delete a series.
function GetPercent( ASeries, APoint: Integer ): Double;
Get percentage value of a data point. For stacked 100 area and stacked 100 bar
only.
function CalcYValue( AYAxis: TYAxis; ASeries: Integer; AYValue: Double ): Integer;
Convert a y-value to canvas Y coordinate.
function CalcXPoint( ASeries: Integer; APoint: Integer ): Integer;
Convert a point position to canvas X coordinate.
TSCPie
Properties
property DataValues[ASeries, APoint: Integer]: Double;
Enter chart data value using this property. ASeries is the series position and APoint is the point position of each data value. Negative values are forced to positive numbers in the calculation, but the data itself are not changed.
property Explode: Boolean;
If True then pie chart is in exploded state.
property Explodes[ASeries: Integer]: Boolean;
Specifies whether a series is exploded or not.
property Kind: TPieKind;
TPieKind = ( ckPie, ckDoughnut );
Specifies the type of the chart to be drawn.
property NSeries: Integer;
Specifies number of series or slices
on the chart.
property PercentExplode: Integer;
Change the explode range from center of the chart. You can specify a percent number from 1 to 100.
property ValueFormat: string;
Specifies string used to format data value.
Methods
function GetPercent( ASeries, APoint: Integer ): Double;
Get percentage value of a slice.
TSCHBar
Properties
property BarStyle: TBarStyle;
For stacked bar or stacked 100 bar chart only. Change bar style.
TBarStyle = ( bsBar, bsCylinder, bsPyramid, bsCone );
property DataValues[ASeries, APoint: Integer]: Double;
Enter chart data value using this property. ASeries is the series position and APoint is the point position of each data value.
property Kind: THKind;
Specifies chart type to be drawn.
THKind = ( ckHBar, ckSHBar, ckS100HBar );
property NSeries: Integer;
NSeries is the number of series on the chart.
property Options: THCOptions;
Change chart various appearance.
THCOption = ( coRotateYLabel, coStaggerYLabel, coHideWall, coBarShade );
THCOptions = set of THCOption;
property Percent3D: Integer;
Change the depth ratio on 3D-chart. You can specify a percent number from 1 to 100.
property SeriesBarStyle[ASeries: Integer]: TBarStyle;
For bar chart only. Change bar style for each series.
property ValueFormat: string;
Set text used to format value.
property WallColor: TColor;
Specifies the color of the chart wall.
property XAxis: TAxisOptions;
Change display properties for x-axis.
property XCaption: string;
Set x-axis caption text.
property XGridColor: TColor;
Specifies x-axis grid line color.
property XLabelPos: TXLabelPos;
Specifies x-axis label placement.
TXLabelPos = ( xlLeft, xlTop, xlMiddle );
property YAxis: TAxisOptions
Change display properties for y-axis.
property YCaption: string;
Set y-axis caption text.
property YGridColor: TColor;
Specifies y-axis grid line color.
property YInitValue: TYInitValue;
Define initial max and min values for y-axis.
Methods
procedure AddBarSeries( ABarStyle: TBarStyle; ALabel: string; AColor: TColor );
Use this method to add a bar series with its bar style.
procedure AddSeries( ALabel: string; AColor: TColor );
Use this method to add a series on the chart.
procedure DeleteSeries( ASeries: Integer );
This method is used to delete a series.
function GetPercent( ASeries, APoint: Integer ): Double;
Get percentage value of a data point. For stacked 100 bar
only.
Some caption and hint text on SimChart can use little HTML formating. Supported HTML formating include:
<b></b>
- bold<i></i>
- italic<u></u>
- underline<s></s>
- striketrough<font face=Tahoma size=14 color=#FF00C0></font>
- change font setting<br>
- line break<left>
, <right>
and
<center>
- change line alignmentCopyright © 2002 Adi P Winarso. All rights reserved. Last updated: 11/05/2002