ChartPro.ocx 1.0.5 developer’s guide


 

The Chart Pro Control object routines are divided in 3 main categories:

 

 Category

Notes

Chart

Chart and overall management (properties, methods, events)

Style Bars

Style Bars (properties, methods, events)

Data Blocks

Data blocks (properties, methods, events)

 

 

 


 

Chart routines overview


  Index

 

The following routines are used for the Chart management in the Chart Pro Control object.

 

 Properties

 Methods

 Events

ChartBackcolor

ChartClear

ChartClick

ChartForecolor

ChartDraw

ChartDblClick

ChartFont

 

 

ChartGrad

 

 

ChartLabelForecolor

 

 

ChartLabelFont

 

 

ChartLabelX

 

 

ChartLabelY

 

 

ChartOriginX

 

 

ChartOriginY

 

 

ChartMaxDb

 

 

ChartMaxValueY

 

 

ChartDivY

 

 

ChartPile

 

 

ChartGroup

 

 

ChartToolTip

 

 

 


 

ChartBackColor Property


Sets or returns the backcolor of the Chart area.

 

 Syntax

ChartProOCX.ChartBackcolor [ =  value ]

 The ChartBackcolor property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Value

A numeric expression of the background color

 

 Remarks

The default backcolor is &H00C0FFC0& (light green).

 

  See Also

ChartDraw method


ChartForeColor Property


Sets or returns the forecolor of the Chart area.

 

 Syntax

ChartProOCX.ChartForecolor [ =  value ]

 The ChartForecolor property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Value

A numeric expression of the foreground color

 

 Remarks

The default forecolor is &H00000000& (black).

 

  See Also

ChartDraw method


ChartFont Property


Sets or returns the default chart font.

 

 Syntax

ChartProOCX.ChartFont.Prop  [ =  value ]

 The ChartFont property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Prop

Allowed properties: Name, Size, Bold, Italic, Underline, Strikethrough

Value

A font expression containing the default chart font parameters

 

 Remarks

The default font is Ms San Serif normal 8.

 

 

  See Also

ChartDraw method


 

ChartGrad Property


Sets or returns the type of gradient.

 

 Syntax

ChartProOCX.ChartGrad [ =  action ]

 The ChartGrad property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

action

An integer expression that sets the type of gradient of any data block

 

 Settings

Possible settings for action are:

action

Description

0

No Gradient

1

Vertical gradient

2

Horizontal gradient (default)

 

 

 Remarks

The default value is 2 (Horizontal gradient).

 

  See Also

ChartDraw method


 

ChartLabelForeColor Property


Sets or returns the forecolor of the Label.

 

 Syntax

ChartProOCX.ChartLabelForecolor [ =  value ]

 The ChartLabelForecolor property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Value

A numeric expression of the label foreground color

 

 Remarks

The default forecolor is &H00C00000&  (blue).

 

  See Also

ChartDraw method

 


ChartLabelFont Property


Sets or returns the default label font.

 

 Syntax

ChartProOCX.ChartLabelFont.Prop  [ =  value ]

 The ChartLabelFont property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Prop

Allowed properties: Name, Size, Bold, Italic, Underline, Strikethrough

Value

A font expression containing the default label font parameters

 

 Remarks

The default font is Arial Narrow bold 12.

 

 

  See Also

ChartDraw method


ChartLabelX Property


Sets or returns the X axis label.

 

 Syntax

ChartProOCX.ChartLableX [ =  value ]

 The ChartLabelX property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

A string expression of the X axis label

 

 Remarks

The default is “X”.

 

  See Also

ChartDraw method


ChartLabelY Property


Sets or returns the Y axis label.

 

 Syntax

ChartProOCX.ChartLableY [ =  value ]

 The ChartLabelY property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

A string expression of the Y axis label

 

 Remarks

The default is “Y”.

 

  See Also

ChartDraw method


ChartOriginX Property


Sets or returns the X coordinate of the chart origin (pixel).

 

 Syntax

ChartProOCX.ChartOriginX [ =  value ]

 The ChartOriginX property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

A single expression of the X origin (pixel)

 

 Remarks

The default is 100.

 

  See Also

ChartDraw method


ChartOriginY Property


Sets or returns the Y coordinate of the chart origin (pixel).

 

 Syntax

ChartProOCX.ChartOriginY [ =  value ]

 The ChartOriginY property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

A single expression of the Y origin (pixel)

 

 Remarks

The default is 50.

 

  See Also

ChartDraw method


ChartMaxDb Property


Sets or returns the maximum number of data blocks visible in the chart.

 

 Syntax

ChartProOCX.ChartMaxDb [ =  value ]

 The ChartMaxDb property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

An integer expression of the maximum number of visible data blocks; with a 0 value the property is ignored (no maximum limit)

 

 Remarks

The default is 0 (no maximum limit).  The number of loaded data blocks may be greater of the ChartMaxDb value.

 

  See Also

ChartDraw method


ChartMaxValueY Property


Sets or returns the maximum displayed value of the y axis.

 

 Syntax

ChartProOCX.ChartMaxValueY [ =  value ]

 The ChartMaxValueY property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

An long expression of the maximum displayed value of the y axis

 

 Remarks

The default is 1000.

 

  See Also

ChartDraw method


ChartDivY Property


Sets or returns the number of the y axis division tags.

 

 Syntax

ChartProOCX.ChartDivY [ =  value ]

 The ChartDivY property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

An integer expression of the y axis number of division tags

 

 Remarks

The default is 10.

 

  See Also

ChartDraw method


ChartPile Property


Sets or returns the number of bars of the same pile.

 

 Syntax

ChartProOCX.ChartPile [ =  value ]

 The ChartPile property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

An integer expression of number of bars on the same pile

 

 Remarks

The default is 1.

 

  See Also

ChartDraw method


ChartGroup Property


Sets or returns the number of bars of the same group.

 

 Syntax

ChartProOCX.ChartGroup [ =  value ]

 The ChartGroup property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

An integer expression of number of bars of the same group

 

 Remarks

The default is 1.

 

  See Also

ChartDraw method


 

ChartToolTip Property


Sets or returns the current ToolTip mode.

 

 Syntax

ChartProOCX.ChartToolTip [ =  action ]

 The ChartToolTip property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

action

An integer expression  of  the tooltip mode. The action value is set by adding the below numbers

 

 Settings

Possible settings for action are:

action

Description

0

The data block tooltip is displayed without parameters (default)

1

The data block tooltip is displayed with the specified parameters

 

 Remarks

The default value is 0.

The tooltip parameters can be set with the ToolTip properties

When the property is set to 1 to display the tooltip you must press the “z” key; to hide the tooltip you can either move the cursor to another block, or click on the Chart background or double click on it; you can also copy the content of the tooltip (select text, click with mouse right button and copy)

  See Also

ToolTip properties


 ChartClear Method


 

This method clears all the  elements added to the Chart (it is a complete reset of the arrays) in the ChartPro Control object.

 

 Syntax

ChartProOCX.ChartClear

 

The ChartClear method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

 

 Returns

> 0  - Clear was successful

= 0  - Clear failed (an error occurred while deleting)

 

 Remarks

This method resets the data block array and the style bar array.

 

 See Also

BarAdd method, DbAdd method

 


 

ChartDraw Method


 

This method draws the chart with the current settings (properties and added elements).

 

 Syntax

ChartProOCX.ChartDraw

 The ChartDraw method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

 

 Returns

> 0  - Drawing was successful

= 0  - Drawing failed (an error occurred while drawing the chart)

 * Remarks

This method is useful to draw and redraw the chart after a property change.

 

 See Also

ChartClear


 ChartClick Event


Fires when a mouse click occurs on the Chart background.

 

 Syntax (Visual Basic)

Private Sub ChartProOCX1_ChartClick()

 

 Remarks

The sequence of ChartPro Control is

·        ChartClick

·        ChartDblClick

 

  See Also

ChartDblClick

 


ChartDblClick Event


Fires when a mouse double click occurs on the Chart background.

 

 Syntax (Visual Basic)

Private Sub ChartProOCX1_ChartDblClick()

 

 Remarks

The sequence of ChartPro Control is

·        ChartClick

·        ChartDblClick

 

  See Also

ChartClick

 

 

 


Style Bar routines overview


 Index

The following routines are used for the Style Bar (Bar) management in the Chart Pro Control object.

 

 Properties

 Methods

 Events

BarDesc

BarAdd  

 

BarFillColor

BarClear

 

BarMax

BarIndex

 

 


BarDesc Property


 Returns the description of the style bar array element.

 

 Syntax

ChartProOCX.BarDesc  (index As Integer)

 The BarDesc property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

index

A numeric expression of the index of an existing style bar.

 

* Remarks

The index can be retrieved from the return value of the BarAdd method

The lower bound of the bar  array is 1. If the lower/upper bound is 0, the bar is empty.

This property is available only at run time.

  See Also

BarAdd method


BarFillColor Property


 Sets the fill color of the style bar array element.

 

 Syntax

ChartProOCX.BarFillColor  (index As Integer) [ =  value ]

 The BarFillColor property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

index

A numeric expression of the index of an existing style bar.

value

A variant expression for the fill color (decimal or Hex)

 

* Remarks

The index can be retrieved from the return value of the BarAdd method

The lower bound of the bar  array is 1. If the lower/upper bound is 0, the bar is empty.

 

  See Also

BarAdd method


BarMax Property


 Returns the upper bound of the style bar array (read only property).

 

 Syntax

ChartProOCX.BarMax

 The BarMax property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

 

 Remarks

The lower bound of the bar  array is 1. If the lower/upper bound is 0, the bar is empty.

 

  See Also

BarAdd method

 


BarAdd Method


 

This method loads the specified style bar (it is a template for the data blocks) in the Chart Pro Control object.

 

 Syntax

ChartProOCX.BarAdd (ID As Integer, Key As String, Desc As String, Forecolor As Variant, BackColor As Variant, FillStyle As Integer, BarSize As Integer, BarStyle As Integer, Font As String, Font Size As Single, Alignment As Integer, BarTextID As Integer)

 

The BarAdd method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

ID

A numeric expression for the user bar  ID (unique)

Key

A string expression for the user bar  Key.

Desc

A string expression for the bar description

ForeColor

A variant expression for the forecolor of the bar (decimal or Hex)

BackColor

A variant expression for the backcolor of the bar (decimal or Hex)

FillStyle

An integer expression for the user bar  style (0 solid, 1 transparent, 2 horizontal line, 3 vertical line, 4 Upword diagonal, 5 Downword diagonal, 6 Cross, 7 Diagonal Cross, 8 Vertical colors, 9 Horizontal colors, 10 Flag colors

BarSize

An integer  expression for the bar size in %  of the resource height

BarStyle

A numeric expression for the start/end symbol of the bar (0 no symbols, 10 pentagon down start symbol, 20 pentagon up start symbol, 30 arrowhead down start symbol, 40 arrowhead up start symbol)

Font

A string expression for the bar Font Name

FontSize

A numeric expression for the bar Font Size

Alignment

An integer expression for the bar text alignment (0 left, 1 center, 2 right)

BarTextID

A numeric expression for the type of text to be displayed in a data block (0 for  no text , 1 for Dbkey, 2 for DbXdesc, 3 for Dbuser)

 

 Returns

> 0  - Add was successful (returns the bar index)

= 0  - Add failed (an error occurred while adding this bar)

 

 Remarks

The Indexes of the style bar array are dynamic (can vary when deleting or adding bars). It is possible to retrieve the current index of a style bar with the BarIndex method. The ID must be a unique index.

 When a data block is added (DbAdd method), the style bar is assigned to the added data block.

 See Also

BarIndex method , DbAdd method


BarClear Method


 

This method deletes the specified existing bar style in the Chart Pro Control object .

 

 Syntax

ChartProOCX.BarClear ([ID As Integer ])

 The BarClear method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

ID

A numeric expression for the user ID of the style bar.

 

 Returns

> 0  - Clear was successful (returns the deleted bar ID)

= 0  - Clear failed (an error occurred while deleting this style bar)

 

 Remarks

If ID =0 (or not specified) then all the existing style bars are deleted.

If  any data blocks are allocated in the Chart, bar styles cannot be deleted.

 

 See Also

BarAdd method


BarIndex Method


 

This method retrieves the style bar array index from the user ID in the Chart Pro Control object.

 

 Syntax

ChartProOCX.BarIndex (Bar As Integer)

 The BarIndex method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Bar

A numeric expression for the ID of the style bar

 

 Returns

> 0  - Retrieve was successful (returns the bar index)

= 0  - Retrieve failed (an error occurred while serching the  bar array)

 

  Remarks

The user bar ID is assigned when adding a style bar (see BarAdd method).

 

 See Also

BarAdd method

 


 Data Block routines overview


 Index

The following routines are used for the Data Block (Db) and style (Bar) management in the Chart Pro Control object.

 

 Properties

 Methods

 Events

DbBar 

DbAdd

DbClick

DbXDesc

DbClear

DbDblClick

DbID 

DbIndexFromID 

 

DbKey

DbIndexFromKey

 

DbMax

DbBarStyle  

 

DbUser

 

 

ToolTipDesc

 

 

ToolTipValue

 

 

ToolTipUser

 

 

ToolTipTitle

 

 

 

 

 


DbBar Property


Sets or returns the bar style of an existing data block.

 

 Syntax

ChartProOCX.DbBar (index As Integer) [ =  value ]

 The DbBar property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

index

A numeric expression of the index of an existing data block.

value

A numeric  expression for the data block bar style

 

 Remarks

The bar style is assigned when adding a data block (see DbAdd method).

 

  See Also

DbAdd method,  DbStyle method,  BarAdd method

 


DbXDesc Property


Sets or returns the description of an existing data block.

 

 Syntax

ChartProOCX.DbXDesc (index As Integer) [ =  value ]

 The DbXDesc property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Index

A numeric expression of the index of an existing data block.

Value

A string  expression for the data block description

 

 Remarks

The description  is assigned when adding a data block (see DbAdd method).

The description string can be displayed in the data block according to the style bar (BarTextID=2).

 

  See Also

DbAdd method

 

 


DbID Property


Sets or returns the user ID of an existing data block (can be used to ceate a user numeric index of the data block).

 

 Syntax

ChartProOCX.DbID (index As Integer) [ =  value ]

 The DbID property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

index

A numeric expression of the index of an existing data block.

value

A numeric expression for the user data block ID.

 

 Remarks

The user ID is assigned when adding a data block (see DbAdd method).

 

  See Also

DbAdd method


DbKey Property


Sets or returns the user Key of an existing data block (can be used to ceate a user string index of the data block)

 

 Syntax

ChartProOCX.DbKey (index As Integer) [ =  value ]

 The DbKey property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

index

A numeric expression of the index of an existing data block.

value

A string expression for the user data block Key.

 

 Remarks

The user Key is assigned when adding a data block (see DbAdd method).

The Key string can be displayed in the data block according to the style bar (BarTextID=1).

 

  See Also

DbAdd method

DbMax Property


 Returns the upper bound of the data block array (read only property).

 

 Syntax

ChartProOCX.DbMax

 The DbMax property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

 

 Remarks

The lower bound of the data block array is 1. If the lower/upper bound is 0, the array is empty.

 

  See Also

DbAdd method

 


DbUser Property


 Sets or returns the user string of an existing data block (can be used to store user variables).

 

 Syntax

ChartProOCX.DbUser (index As Integer) [ =  value ]

 The DbUser property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

index

A numeric expression of the index of an existing data block.

value

A string expression for the user data block string.

 

 Remarks

The user string is assigned when adding a data block (see DbAdd method).

The User string can be displayed in the data block according to the style bar (BarTextID=3).

 

  See Also

DbAdd method

 

 


ToolTip Properties


 Sets or returns the tooltip parameters of the data block.

 

 Syntax

ChartProOCX.ToolTipDesc  [ =  value ]

ChartProOCX.ToolTipValue  [ =  value ]

ChartProOCX.ToolTipUser  [ =  value ]

ChartProOCX.ToolTipTitle  [ =  value ]

 

 

 The ToolTip property has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

value

A string expression of the data block tooltip parameter description

 

* Remarks

If the property is set to an empty string, the corresponding parameter will not be visible in the data block tooltip.

Every tooltip property has a default value that can be customized  by the user at design and run time.

The data block tooltip properties are considered only if the ChartToolTip property is set to 1.

 

  See Also

ChartToolTip property
DbAdd Method


 

This method loads the specified data block in the Chart Pro Control object.

 

 Syntax

ChartProOCX.DbAdd (ID As Integer, Key As String, XDesc As String, Yvalue As Single, DBbar As Integer [, DBuser As String ])

 

The DbAdd method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

ID

A numeric expression for the user data block ID.

Key

A string expression for the user data block Key.

XDesc

A string expression for the data block description (may be displayed in the data block depending on the style bar).

Yvalue

A numeric expression to set the data block height

DBbar

A numeric expression for the ID of the style bar to be used to display the data block.

DBuser

A string expression for any user variable (may be displayed in the data block depending on the style bar).

 

 Returns

> 0  - Add was successful (returns the block index)

= 0  - Add failed (an error occurred while adding this block)

 

 Remarks

The Indexes of the data block array are dynamic (can vary when deleting or adding blocks). It is possible to retrieve the current index of a block with the DbIndexFromID method or the DbIndexFromKey method. Either the ID or the Key should be unique index to be useful.

 


Prerequisites

Before using the DbAdd method remember that the bar styles must be specified before adding data blocks (see BarAdd method)

 See Also

BarAdd method, DbIndexFromID method, DbIndexFromKey method


 DbClear Method


 

This method deletes the specified existing data block in the Chart Pro Control object .

 

 Syntax

ChartProOCX.DbClear ([Index As Integer ])

 The DbClear method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

Index

A numeric expression for the index of the data block array .

 

 Returns

> 0  - Clear was successful (returns the deleted block index)

= 0  - Clear failed (an error occurred while deleting this block)

 

 Remarks

If Index=0 (or not specified) then all the existing blocks are deleted.

 

 See Also

DbAdd method


DbIndexFromID Method


 

This method retrieves the data block array index from the user ID in the Chart Pro Control object .

 

 Syntax

ChartProOCX.DbIndexFromID (ID As Integer)

 The DbIndexFromID method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

ID

A numeric expression for the user ID of the data block array .

 

 Returns

> 0  - Retrieve was successful (returns the block index)

= 0  - Retrieve failed (an error occurred while serching the data block array)

 

  Remarks

To retrieve the index from a string key see the DbIndexFromKey method.

The user ID is assigned when adding a data block (see DbAdd method).

 

 See Also

DbAdd method,  DbIndexFromKey method,  DbID property


DbIndexFromKey Method


 

This method retrieves the data block array index from the user Key in the Chart Pro Control object .

 

 Syntax

ChartProOCX.DbIndexFromKey (key As String)

 The DbIndexFromKey method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

key

A string expression for the user key of the data block array .

 

 Returns

> 0  - Retrieve was successful (returns the block index)

= 0  - Retrieve failed (an error occurred while serching the data block array)

 

  Remarks

To retrieve the index from a numeric ID see the DbIndexFromID method.

The user Key is assigned when adding a data block (see DbAdd method).

 

 See Also

DbAdd method,  DbIndexFromID method,  DbKey property

 


DbBarStyle Method


 

This method assigns to the specified existing data block an existing style bar in the Chart Pro Control object .

 

 Syntax

ChartProOCX.DbStyle (DBindex As Integer , myBar As Integer)

 The DbStyle method has these parts:

Part

Description

ChartProOCX

An object expression that evaluates the Chart Pro Control object.

DBindex

A numeric expression for the index of the data blocks array.

myBar

A numeric expression for the ID of a specified style bar.

 

 Returns

> 0  - Style was successful (returns the modified block index)

= 0  - Style failed (an error occurred while modifying this block)

 

 Remarks

Prerequisites

Before using the DbStyle method remember that:

·         The style bar  must be added before (see BarAdd method)

·         The data block must be added before (see DbAdd method)

 

 See Also

DbAdd method,  BarAdd method


 DbClick Event


Fires when a mouse click occurs in the data block.

 

 Syntax (Visual Basic)

Private Sub ChartProOCX1_DbClick (indexDb As Integer, button As Integer)

 The DbClick event has these parts:

Part

Description

indexDB

A numeric expression of the index of the data block.

button

A numeric expression for the mouse button (1 left, 2 right)

 

 Remarks

The sequence of ChartPro Control is

·        DbClick

·        DbDblClick

 

 

  See Also

DbDblClick


DbDblClick Event


Fires when a double mouse click occurs in the data block.

 

 Syntax (Visual Basic)

Private Sub ChartProOCX1_DbDblClick (indexDb As Integer)

 The DbDblClick event has these parts:

Part

Description

Index

A numeric expression of the index of the data block.

 

 Remarks

The sequence of ChartPro Control is

·        DbClick

·        DbDblClick

 

 

  See Also

DbClick