RMC_AddGrid function.
Add a grid to a region of an existing chart

Syntax
nResult& = RMC_AddGrid(
ByVal nCtrlId&,
ByVal nRegion&,
Optional ByVal nBackColor&,
Optional ByVal nAsGradient&,
Optional ByVal nLeft&,
Optional ByVal nTop&,
Optional ByVal nWidth&,
Optional ByVal nHeight&
)
Parameter
nCtrlId&
Unique ID of the chart control, to which the grid belongs.
nRegion&
Region to which the grid belongs.
nBackColor&
BackColor of the grid as a Color... constant. If omitted or 0, ColorWhiteSmoke.
nAsGradient&
If TRUE, the rear wall of the grid will be painted with a gradient effect. If omitted or 0: FALSE.
nLeft&
Upper left corner of the grid within the chart in pixel. If omitted: see Remarks
nTop&
Top corner of the grid within the chart in pixel. If omitted: see Remarks
nWidth&
Width of the grid in pixel. If omitted: see Remarks
nHeight&
Height of the grid in pixel. If omitted: see Remarks
Return value
0
No error, function succeeded.
RMC_ERROR_CTRLID
Wrong control ID (0 or no chart with this control ID was found).
RMC_ERROR_MAXREGION
The region index exceeds the maximum possible numbers of regions (6) within a chart control.
RMC_ERROR_WRONGREGION
The region index is inexistent in the chart control.
Remarks
Normally there is no need to define the grid's Left, Top, Width and Height. RMChart calculates the boundary of the grid, if these paramteres are omitted, depending of the region's size, the caption's and the legend's size, the size of the axis labels and so on. This should be the preferred way because it assures that everything fits together.

The only reason to set these values may be if you design a chart with e.g. 2 regions on top of each other and you want to assure that the left corners and the width of both grids are congruent. Load file 2 regions.rmc into RMCDesigner for an example for this case.