| RMC_GetDataLocation function. | ||
| Get the X- or Y-postion of a data value within a grid | ||
| Syntax | ||
| nResult (LONG) = RMC_GetDataLocation( ByVal nCtrlId (LONG), ByVal nRegion (LONG), ByVal nSeriesIndex (LONG), ByVal nData (DOUBLE), ByRef nXYPos (LONG) ) | ||
| Parameter | ||
| nCtrlId (LONG) | ||
| Unique ID of the chart control, to which the series belongs. | ||
| nRegion (LONG) | ||
| Index of the region, to which the series belongs. | ||
| nSeriesIndex (LONG) | ||
| Index of the series, to which the data corresponds. This is necessary to determine the alignment of the data axis, which belongs to the series in order to retrieve the correct position. | ||
| nData (DOUBLE) | ||
| The data value, whose position shall be calculated. | ||
| nXYPos (LONG) | ||
| Holds the X-position (in case the data axis is horizontally aligned) or the Y-position (in case the data axis is vertically aligned) of the data value after succesfull function call | ||
| 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_WRONGREGION | ||
| The region index is inexistent in the chart control. | ||
| RMC_ERROR_SERIESINDEX | ||
| The series index is not valid (No series with this index exists in this region). | ||
| RMC_ERROR_WRONGSERIESTYPE | ||
| The series is not grid based (either Pie/Donut/Pyramid or XY). | ||
| Example | ||
'Supposed you have a bar series with a vertical data axis from 0 to 100. 'You want to highlight an area between values 50 and 60 as a desired range 'during runtime. 'First, get the grid's location: nError = RMC_GetGridLocation(%ID_RMC1,1,nLeft,nTop,nRight,nBottom) 'Now get the Y position for values 50 and 60: nError = RMC_GetDataLocation(%ID_RMC1,1,1,50,nYPos1) nError = RMC_GetDataLocation(%ID_RMC1,1,1,60,nYPos2) 'Now draw a transparent CustomBox to highlight the area: nError = RMC_COBox(%ID_RMC1,1,nLeft,nYPos1,nRight,nYPos2,%RMC_BOX_FLAT,%ColorRed,0,80) | ||