Platforms to show: All Mac Windows Linux Cross-Platform
Back to CDLayerMBS class.
CDLayerMBS.getDataSet(dataSet as Integer) as CDDataSetMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
| Argument | Default | Description |
|---|---|---|
| dataSet | (Mandatory) | A data set number, starting from 0. The first data set object is 0, and the nth data set is (n-1). |
The requested DataSet object.
Some examples using this method:
CDLayerMBS.getDataSetByZ(z as Integer) as CDDataSetMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
In certain layer types, the data sets are drawn in a certain order. For example, in a line layer, the data sets represent lines and they are drawn one by one. In contrast, for a candlestick layer, the high, low, open and close data sets are combined into candlestick symbols, and there is no specific order on which data sets are drawn.
This method can be used to get the data set based on the order it is being drawn. If the data sets are not drawn in any specific order, this method will return the data sets in the reverse order to which it is added to the layer.
| Argument | Default | Description |
|---|---|---|
| zIndex | (Mandatory) | The z-index of the required data set. The z-index of the first data set drawn is 0. The z-index for the Nth data set drawn is N - 1. |
Returns the DataSet object at the specified z-order.
Some examples using this method:
- /ChartDirector/Finance Chart Track Line Retina
- /ChartDirector/RealTime ViewPort
- /ChartDirector/Tracking Cursor/Finance Chart Track Line
- /ChartDirector/Tracking Cursor/Track Box with Legend
- /ChartDirector/Tracking Cursor/Track Line Web
- /ChartDirector/Tracking Cursor/Track Line with Axis Labels
- /ChartDirector/Tracking Cursor/Track Line with Data Labels
- /ChartDirector/Tracking Cursor/Track Line with Legend
CDLayerMBS.getDataSetCount as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns the number of data sets in the layer.
Some examples using this method:
- /ChartDirector/Finance Chart Track Line Retina
- /ChartDirector/RealTime ViewPort
- /ChartDirector/Tracking Cursor/Finance Chart Track Line
- /ChartDirector/Tracking Cursor/Track Box with Legend
- /ChartDirector/Tracking Cursor/Track Line Web
- /ChartDirector/Tracking Cursor/Track Line with Axis Labels
- /ChartDirector/Tracking Cursor/Track Line with Data Labels
- /ChartDirector/Tracking Cursor/Track Line with Legend
CDLayerMBS.getHTMLImageMap(url as string, queryFormat as string = "", extraAttr as string = "", offsetX as Integer = 0, offsetY as Integer = 0) as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please refer to BaseChart.getHTMLImageMap for the detail description of this method.
This method should be called only after creating the chart image (eg. using BaseChart.makeChart, BaseChart.makeChart2 or BaseChart.makeChart3). The image map cannot be determined without creating the chart image first.
| Argument | Default | Description |
|---|---|---|
| url | (Mandatory) | The URL to be used in the "href" attribute of the image map. Parameter Substitution and Formatting is supported. Use an empty string if no href attribute is needed. |
| queryFormat | "" | A text string representing the template of the query parameters to be appended to the URL. Parameter Substitution and Formatting is supported. |
The special keyword "{default}" represents the default query parameters. This is useful for specifying appending to the default.
Note that an empty string means to use the default query query parameters. To specify no query parameter, use a space character.
| extraAttr | "" | A text string to specify additional attributes to add to the <area> tag. Parameter Substitution and Formatting is supported. |
| offsetX | 0 | An offset to be added to all x coordinates in the image map. This is useful if the current image will be shifted and inserted into another image. In this case, the image map will need to be shifted by the same offset. |
| offsetY | 0 | An offset to be added to all y coordinates in the image map. See offsetX above for description. |
A text string containing the image map generated.
CDLayerMBS.getImageCoor(dataSet as Integer, dataItem as Integer = &h80000001, offsetX as Integer = 0, offsetY as Integer = 0) as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The image map coordinates will be in the following format:
shape="[shape]" cords="[x1],[y1],[x2],[y2] ..."
This format is specially designed so that it can easily be incorporated into HTML image maps.
This method should be called only after creating the chart image (eg. using BaseChart.makeChart, BaseChart.makeChart2 or BaseChart.makeChart3). The image map cannot be determined without creating the chart image first.
| Argument | Default | Description |
|---|---|---|
| dataSet | (Mandatory) | The data set number for the data point. The first data set is 0, while the nth data set is (n-1). |
| dataItem | (Mandatory) | The index of the data point within the data set. The first data point is 0, while the nth data point is (n-1). |
| offsetX | 0 | An offset to be added to all x coordinates in the image map. This is useful if the current image will be shifted and inserted into another image. In this case, the image map will need to be shifted by the same offset. |
| offsetY | 0 | An offset to be added to all y coordinates in the image map. See offsetX above for description. |
A text string representing the coordinates of the data point as represented in the layer in HTML image map attribute format.
CDLayerMBS.getImageCoor2(dataItem as Integer, offsetX as Integer = 0, offsetY as Integer = 0) as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
For example, in a stacked bar chart, this method will obtain the image map coordinates of the whole stacked bar, which contains multiple data points at the same x-position.
The image map coordinates will be in the following format:
shape="" cords="[x1],[y1],[x2],[y2] ..."
This format is specially designed so that it can easily be included into HTML image maps.
This method should be called only after creating the chart image (eg. using BaseChart.makeChart, BaseChart.makeChart2 or BaseChart.makeChart3). The image map cannot be determined without creating the chart image first.
| Argument | Default | Description |
|---|---|---|
| dataItem | (Mandatory) | The x-position of the data points. |
| offsetX | 0 | An offset to be added to all x coordinates in the image map. This is useful if the current image will be shifted and inserted into another image. In this case, the image map will need to be shifted by the same offset. |
| offsetY | 0 | An offset to be added to all y coordinates in the image map. See offsetX above for description. |
A text string representing the image map coordinates of a region containing all data points at the given x-position as HTML image map attributes.
CDLayerMBS.getLegendIcon(dataSetNo as Integer) as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The textual representation can be used in any ChartDirector API that supports the ChartDirector Mark Up Language. A common usage is to insert the icon to a cell in a CDMLTable to label the data series in the table, or to create a custom legend table.
The legend icon is the same legend icon that would be used in the CDLegendBoxMBS. If you modify the icon appearance using the methods of the CDLegendBoxMBS object (such as using CDLegendBoxMBS.setKeyBorder to configure the legend key border), the modification will also apply to the icon returned this method.
Arguments:
| Argument | Default | Description |
|---|---|---|
| dataSetNo | (Mandatory) | The data set for which the legend icon represents. |
Return Value
The textual representation of the legend icon for the data set.
CDLayerMBS.getNearestXValue(target as Double) as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method will search all x data values in the Layer to look for the x data value that is nearest to the given x coordinate. If there are two x data values equally near to the specified x pixel coordinate, this method will arbitrarily return one of the values.
| Argument | Default | Description |
|---|---|---|
| xCoor | (Mandatory) | The x pixel coordinate to search for. |
Returns the x data value that is nearest to the specified x coordinate.
CDLayerMBS.getXCoor(value as Double) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Note: You must call BaseChart.layout first before calling this method. It is because ChartDirector needs to perform auto-scaling and determine the axis scale first before it can compute the coordinates.
| Argument | Default | Description |
|---|---|---|
| v | (Mandatory) | The x data value. |
The x coordinate of the x data value.
CDLayerMBS.getXIndexOf(xValue as Double, tolerance as Double = 0) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The index can be used in DataSet.getValue and DataSet.getPosition to obtain the y values and positions of the data points for all data sets in the layer.
The tolerance argument is to allow this method to consider data points that are not exactly at xValue, but are within tolerance from it.
If multiple data points at within tolerance, this method will return the index of the data point nearest to xValue. If multiple data points are equally near to xValue, this method will choose one arbitrarily and return its data point index. If no data points are found, this method will return -1.
| Argument | Default | Description |
|---|---|---|
| xValue | (Mandatory) | The x data value used to look for the data points in order to get the data point index of the nearest data point. |
| tolerance | 0 | The tolerance allowed for for data points that are not exactly at the specified xValue. |
Returns the data point index of the data point nearest to the specified x data value up to the specified tolerance, or -1 if no data points are found.
Some examples using this method:
- /ChartDirector/Finance Chart Track Line Retina
- /ChartDirector/RealTime ViewPort
- /ChartDirector/Tracking Cursor/Finance Chart Track Line
- /ChartDirector/Tracking Cursor/Track Box with Legend
- /ChartDirector/Tracking Cursor/Track Line Web
- /ChartDirector/Tracking Cursor/Track Line with Axis Labels
- /ChartDirector/Tracking Cursor/Track Line with Data Labels
- /ChartDirector/Tracking Cursor/Track Line with Legend
CDLayerMBS.getXPosition(i as Integer) as Double
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
| Argument | Default | Description |
|---|---|---|
| i | (Mandatory) | The data point index of the data point. The first data point is 0; the nth data point is (n - 1). |
CDLayerMBS.getYCoor(value as Double, axis as boolean=true) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Note: You must call BaseChart.layout first before calling this method. It is because ChartDirector needs to perform auto-scaling and determine the axis scale first before it can compute the coordinates.
| Argument | Default | Description |
|---|---|---|
| v | (Mandatory) | The y data value. |
| yAxis | nil | The y-axis to use to determine the pixel coordinates of data values. The y-axis may be obtained using XYChart.yAxis, XYChart.yAxis2 or XYChart.addAxis. The default is to use the primary y-axis. |
For backward compatibility, the axis argument can also be a boolean value. A true value means the primary y-axis. A false value means the secondary y-axis.
Return Value
The y coordinate of the y data value.
See also:
CDLayerMBS.getYCoor(value as Double, axis as CDAxisMBS) as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Note: You must call BaseChart.layout first before calling this method. It is because ChartDirector needs to perform auto-scaling and determine the axis scale first before it can compute the coordinates.
| Argument | Default | Description |
|---|---|---|
| v | (Mandatory) | The y data value. |
| yAxis | nil | The y-axis to use to determine the pixel coordinates of data values. The y-axis may be obtained using XYChart.yAxis, XYChart.yAxis2 or XYChart.addAxis. The default is to use the primary y-axis. |
For backward compatibility, the axis argument can also be a boolean value. A true value means the primary y-axis. A false value means the secondary y-axis.
Return Value
The y coordinate of the y data value.
See also:
The items on this page are in the following plugins: MBS ChartDirector Plugin.