| RMC_AddLegend function. | ||
| Add a legend to a region of an existing chart | ||
| Syntax | ||
| nResult& = RMC_AddLegend( ByVal nCtrlId&, ByVal nRegion&, ByRef asLegendtext$(), Optional ByVal nAlignment&, Optional ByVal nBackColor&, Optional ByVal nStyle&, Optional ByVal nTextColor&, Optional ByVal nFontsize&, Optional ByVal nFontbold& ) |
||
| Parameter | ||
| nCtrlId& | ||
| Unique ID of the chart control, to which the legend belongs. | ||
| nRegion& | ||
| Region to which the legend belongs. | ||
| asLegendtext$() | ||
| Array with the legend text. The maximum length of each legend text can be 100 chars. | ||
| nAlignment& | ||
| Alignment of the legend within the region as a
legend alignment constant.
If omitted or 0: RMC_LEGEND_BOTTOM. See Remarks | ||
| nBackColor& | ||
| BackColor of the legend as a Color... constant. If omitted or 0: ColorLightYellow | ||
| nStyle& | ||
| Style of the legend as a legend style constant. If omitted or 0: RMC_LEGENDRECT | ||
| nTextColor& | ||
| Textcolor of the legend text as a Color...constant. If omitted or 0: ColorBlack | ||
| nFontsize& | ||
| Fontsize of the legend text in points. If omitted or 0: 8 point | ||
| nFontbold& | ||
| If TRUE, font is bold. If omitted or 0: FALSE. | ||
| 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. | ||
| RMC_ERROR_NODATA | ||
| The array with the legend text is empty. | ||
| RMC_ERROR_ALLOC | ||
| Error while allocating memory for the legend text. | ||
| Remarks | ||
| You can choose between 19 different positions for your legend. Basically there are two "classes" of legend alignments: Custom alignments (e.g. RMC_LEGEND_CUSTOM_TOP) and non-custom alignments (e.g. RMC_LEGEND_TOP). The non-custom alignments affect the size and position of the remaining chart: first takes place the calculation of the required width and height to draw the legend, then the legend is painted and then, in the remaining space, the rest of the chart. | ||