Platforms to show: All Mac Windows Linux Cross-Platform
Back to CDBaseMeterMBS class.
CDBaseMeterMBS.addColorScale(colorStops() as Double, startPos as Integer = -2147483647, startWidth as Integer = -2147483647, endPos as Integer = -2147483647, endWidth as Integer = -2147483647, edgeColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
A color scale is similar to a meter scale. Instead of using labels to denote the values, a color scale uses different colors for different values. The colors can vary continuously or in discrete steps. The width of the color scale can also vary based on the value. There can be multiple more than one color scale in a meter.
A color scale is defined with an array of numbers. For a continuous color scale, each pair of numbers represents a value and its associated color. For example, to define a continuous color scale in which 0 is blue (0000FF), 50 is yellow (FFFF00) and 100 is red (FF0000), the numbers should be:
0.0, &h0000ff, 50.0, &hffff00, 100.0, &hff0000
For a step color scale, the number of colors would be one less than the number of values. For example, to define a step color scale in which 0 to 50 is red (FF0000), and 50 to 100 is green (00FF00), the numbers will be:
0.0, &hff000, 50.0, &h00ff00, 100.0
Argument | Default | Description |
colorStops | (Mandatory) | An array of numbers alternating between values and colors. If the number count is even, the array will define a continuous color scale, otherwise it will define a step color scale. |
startPos | -&h7fffffff | The position of the starting point of the color scale. For an angular meter, the position refers to the radius, and the default is the meter scale radius (see AngularMeter.setMeter). For a linear meter, the position refers to the x or y coordinate depending on whether the meter is vertical or horizontal, and the default is the leftX or topY coordinate of the meter scale (see LinearMeter.setMeter). |
startWidth | -&h7fffffff | The width at the starting point of the color scale. A positive value means the width is in the direction of increasing "position", while a negative value means decreasing "position". Please refer to the description of startPos on the meaning of "position" for various types of meters. The default is the length of the major tick (see BaseMeter.setTickLength). |
endPos | -&h7fffffff | The position of the ending point of the color scale. Please refer to the description of startPos above on how the position parameter is interpreted. The default is for the ending position to be equal to the starting position. |
endWidth | -&h7fffffff | The width at the ending point of the color scale. Please refer to the description of startWidth above on how the width parameter is interpreted. The default is for the ending width to be equal to the starting width. |
edgeColor | -1 | The edge color of the color scale. The default is to have no edge. |
See also:
CDBaseMeterMBS.addColorScale(colorStops() as Double, startPos as Integer, startWidth as Integer, endPos as Integer, endWidth as Integer, edgeColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 15.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
A color scale is similar to a meter scale. Instead of using labels to denote the values, a color scale uses different colors for different values. The colors can vary continuously or in discrete steps. The width of the color scale can also vary based on the value. There can be multiple more than one color scale in a meter.
A color scale is defined with an array of numbers. For a continuous color scale, each pair of numbers represents a value and its associated color. For example, to define a continuous color scale in which 0 is blue (0000FF), 50 is yellow (FFFF00) and 100 is red (FF0000), the numbers should be:
0.0, &h0000ff, 50.0, &hffff00, 100.0, &hff0000
For a step color scale, the number of colors would be one less than the number of values. For example, to define a step color scale in which 0 to 50 is red (FF0000), and 50 to 100 is green (00FF00), the numbers will be:
0.0, &hff000, 50.0, &h00ff00, 100.0
Argument | Default | Description |
colorStops | (Mandatory) | An array of numbers alternating between values and colors. If the number count is even, the array will define a continuous color scale, otherwise it will define a step color scale. |
startPos | -&h7fffffff | The position of the starting point of the color scale. For an angular meter, the position refers to the radius, and the default is the meter scale radius (see AngularMeter.setMeter). For a linear meter, the position refers to the x or y coordinate depending on whether the meter is vertical or horizontal, and the default is the leftX or topY coordinate of the meter scale (see LinearMeter.setMeter). |
startWidth | -&h7fffffff | The width at the starting point of the color scale. A positive value means the width is in the direction of increasing "position", while a negative value means decreasing "position". Please refer to the description of startPos on the meaning of "position" for various types of meters. The default is the length of the major tick (see BaseMeter.setTickLength). |
endPos | -&h7fffffff | The position of the ending point of the color scale. Please refer to the description of startPos above on how the position parameter is interpreted. The default is for the ending position to be equal to the starting position. |
endWidth | -&h7fffffff | The width at the ending point of the color scale. Please refer to the description of startWidth above on how the width parameter is interpreted. The default is for the ending width to be equal to the starting width. |
edgeColor | -1 | The edge color of the color scale. The default is to have no edge. |
See also:
CDBaseMeterMBS.addLabel(v as Double, label as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
By default, all labels will be associated major ticks on the scale. To associate a label with a minor tick instead , use '-' as the first character of the label. To associate a label with a micro tick instead, use ':' as the first character of the label. To draw the label without any tick at all, use '~' as the first character of the label.
Leading '-', '~' or ':' characters are tick specification characters and will not appear on the labels. They just specify the the tick style to be associated with the labels. If you want have a label that actually begins these characters, add '\' as the first character as the escape character.
In some cases, it may be desirable to skip some labels. If you want to draw a major, minor or micro tick without any label, use ' ' (a space character), '-' or ':' as the only character in the label text. If you want leave a label position empty without a tick or a label, use an empty string.
Argument | Default | Description |
pos | (Mandatory) | The position to add the label to in meter scale unit. |
label | (Mandatory) | The label to add to the meter scale. |
CDBaseMeterMBS.addPointer(value as Double, fillColor as color, edgeColor as color) as CDMeterPointerMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseMeterMBS.addPointer(value as Double, fillColor as Integer = &hffff0001, edgeColor as Integer = -1) as CDMeterPointerMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
value | (Mandatory) | The value that the pointer will point to. |
fillColor | LineColor | The fill color of the pointer. |
edgeColor | -1 | The edge color of the pointer. The default value of -1 means the edge color is the same as the fill color. |
See also:
CDBaseMeterMBS.getCoor(v 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 |
For an angular meter, this method returns the angular position of the pointer for the given data value in degrees. The angle is measure in the clockwise direction, with 0 being the upward pointing direction.
For a linear meter, this method returns the linear pixel offset of the pointer for the given data value.
Argument | Default | Description |
v | (Mandatory) | The input data value. |
The geometric representation of the data value, which is an angle in degrees for an angular meter, and a linear pixel offset for a linear meter.
CDBaseMeterMBS.getLabel(v as Double) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
i | (Mandatory) | The position specified as a value on the meter scale. |
Returns the label at the specified position, or a null string if there is no label at that position.
CDBaseMeterMBS.getTicks as CDArrayMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Return Value
All array of numbers representing the positions of the ticks as values on the meter scale.
CDBaseMeterMBS.setLabelFormat(mainLabelFormat as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The method is mainly used when BaseMeter.setScale is used, in which case the label values are not directly specified but are computed by ChartDirector. For example, a format string of "{value|2}" will format the values with 2 decimal places.
Please refer to Parameter Substitution and Formatting on all available format parameters.
Argument | Default | Description |
formatString | (Mandatory) | The format string. |
CDBaseMeterMBS.setLabelPos(labelInside as boolean, labelOffset as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
labelInside | (Mandatory) | A true value means that the labels are on the 'inward' side of the meter scale. A false value means the labels are on the 'outward' side of the meter scale. |
For an angular meter, the default is for the labels on the 'inward' side. For a linear meter, the default is for the labels on the 'outward' side.
labelOffset | 0 | The offset, in pixels, of the labels position relative to the standard position. If the major tick is at the same side as the label, the standard starting position of the label is at the end point of the major tick. Otherwise, the standard starting position is on the meter scale. |
A positive labelOffset means the labels should move more towards the 'inward' or 'outward' side, depending on the first parameter. A negative labelOffset means moving the labels towards the opposite direction.
CDBaseMeterMBS.setLabelStyle(font as string = "", fontsize as Double = -1, fontcolor as Integer = &hffff0002, fontAngle as Double = 0) as CDTextBoxMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See Font Specification for details on various font attributes.
Argument | Default | Description |
font | "bold" | The font used to draw the labels. |
fontSize | -1 | The font size used to draw the labels in points. A value of -1 means the font size is not changed. The default font size is 10 points for angular meters, and 8 points for linear meters. |
fontColor | TextColor | The color used to draw the labels. |
fontAngle | 0 | The rotation angle of the labels. |
A TextBox object representing the prototype of the obj. This may be used to fine-tune the appearance of the obj.
See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml
See also:
CDBaseMeterMBS.setLabelStyle(font as string, fontsize as Double, fontcolor as color, fontAngle as Double = 0) as CDTextBoxMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseMeterMBS.setLineWidth(axisWidth as Integer, majorTickWidth as Integer = 1, minorTickWidth as Integer = 1, microTickWidth as Integer = 1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
axisWidth | (Mandatory) | The line width for drawing the meter scale line in pixels. For an angular meter, the default is 1 pixel. For a linear meter, the default is 2 pixels. |
majorTickWidth | 1 | The line width of the major ticks in pixels. For a linear meter, if this method is not called, the initial major tick width is set to 2 pixels. |
minorTickWidth | 1 | The line width of the minor ticks in pixels. |
microTickWidth | 1 | The line width of the micro ticks in pixels. |
CDBaseMeterMBS.setMeterColors(axisColor as color, labelColor as color, tickColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDBaseMeterMBS.setMeterColors(axisColor as Integer, labelColor as Integer = -1, tickColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
axisColor | (Mandatory) | The color for drawing the meter scale line. The default is LineColor. |
labelColor | -1 | The color for drawing the scale labels. Passing -1 in this argument means the label color is not changed. The default label color is TextColor. |
tickColor | -1 | The color for drawing the ticks. Passing -1 in this argument means the tick color is not changed. The default tick color is LineColor. |
See also:
CDBaseMeterMBS.setScale(lowerLimit as Double, upperLimit as Double, labels() as Double, formatstring as string = "")
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
ChartDirector will distribute the labels evenly on the scale. By default, all labels are associated with major ticks. If you want certain positions to show a minor or micro ticks only, use MinorTickOnly or MicroTickOnly as the label values for those positions.
Argument | Default | Description |
lowerLimit | (Mandatory) | The lower limit of the meter scale. |
upperLimit | (Mandatory) | The upper limit of the meter scale. |
labels | (Mandatory) | An array of numbers to be used as the labels on the meter scale. |
formatString | "" | The format string for formatting the numbers. An empty string means the format will be automatically determined. |
See also:
CDBaseMeterMBS.setScale(lowerLimit as Double, upperLimit as Double, labels() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
ChartDirector will distribute the labels evenly on the scale. By default, all labels are associated with major ticks. These can be modified by using '-', '~' or ':' as the first character. Please refer to BaseMeter.addLabel for details.
Argument | Default | Description |
lowerLimit | (Mandatory) | The lower limit of the meter scale. |
upperLimit | (Mandatory) | The upper limit of the meter scale. |
labels | (Mandatory) | An array of text strings to be used as the labels on the meter scale. |
See also:
CDBaseMeterMBS.setScale(lowerLimit as Double, upperLimit as Double, majorTickInc as Double = 0, minorTickInc as Double = 0, microTickInc as Double = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
lowerLimit | (Mandatory) | The lower limit of the meter scale. |
upperLimit | (Mandatory) | The upper limit of the meter scale. |
majorTickInc | 0 | The interval between major ticks. For example, a value of 10 means a major tick every 10 units in the meter scale. Each major tick will have an associated label for the value at the tick. A value of 0 disables major ticks. |
minorTickInc | 0 | The interval between minor ticks. For example, a value of 5 means a minor tick every 5 units in the meter scale. A value of 0 disables minor ticks. |
microTickInc | 0 | The interval between minor ticks. For example, a value of 1 means a minor tick every 1 units in the meter scale. A value of 0 disables micro ticks. |
See also:
CDBaseMeterMBS.setTickLength(majorLen as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
majorLen | (Mandatory) | The length of the major ticks in pixels. A positive value means the tick is at the 'outward' direction of the meter. A negative value means the tick is at the 'inward' direction. |
For an angular meter, the default is -10 (10 pixels at the inward direction). For a horizontal linear meter, the default is the same height as the meter scale region in the inward direction. For a vertical linear meter, the default is the same width as the meter scale region in the inward direction.
minorLen | -7fffffff | The length of the minor ticks in pixels. The default is 60% of the length of the major ticks. |
microLen | -7fffffff | The length of the micro ticks in pixels. The default is 50% of the length of the minor ticks. |
See also:
CDBaseMeterMBS.setTickLength(majorLen as Integer, minorLen as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
majorLen | (Mandatory) | The length of the major ticks in pixels. A positive value means the tick is at the 'outward' direction of the meter. A negative value means the tick is at the 'inward' direction. |
For an angular meter, the default is -10 (10 pixels at the inward direction). For a horizontal linear meter, the default is the same height as the meter scale region in the inward direction. For a vertical linear meter, the default is the same width as the meter scale region in the inward direction.
minorLen | -7fffffff | The length of the minor ticks in pixels. The default is 60% of the length of the major ticks. |
microLen | -7fffffff | The length of the micro ticks in pixels. The default is 50% of the length of the minor ticks. |
See also:
CDBaseMeterMBS.setTickLength(majorLen as Integer, minorLen as Integer, microLen as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
majorLen | (Mandatory) | The length of the major ticks in pixels. A positive value means the tick is at the 'outward' direction of the meter. A negative value means the tick is at the 'inward' direction. |
For an angular meter, the default is -10 (10 pixels at the inward direction). For a horizontal linear meter, the default is the same height as the meter scale region in the inward direction. For a vertical linear meter, the default is the same width as the meter scale region in the inward direction.
minorLen | -7fffffff | The length of the minor ticks in pixels. The default is 60% of the length of the major ticks. |
microLen | -7fffffff | The length of the micro ticks in pixels. The default is 50% of the length of the minor ticks. |
See also:
The items on this page are in the following plugins: MBS ChartDirector Plugin.