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
Adds a color scale to the meter.

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

ArgumentDefaultDescription
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-&h7fffffffThe 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-&h7fffffffThe 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-&h7fffffffThe 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-&h7fffffffThe 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-1The 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
Adds a color scale to the meter.

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

ArgumentDefaultDescription
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-&h7fffffffThe 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-&h7fffffffThe 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-&h7fffffffThe 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-&h7fffffffThe 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-1The 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
Adds a label to a specific position on the meter scale.

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.
ArgumentDefaultDescription
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
Same as the other addPointer method, but uses color instead of integer data type for passing color values.

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
Adds a pointer to the meter.

ArgumentDefaultDescription
value(Mandatory)The value that the pointer will point to.
fillColorLineColorThe fill color of the pointer.
edgeColor-1The 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
Gets the geometric coordinates given the data value.

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.
ArgumentDefaultDescription
v(Mandatory)The input data value.
Return 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
Gets the label at the specified position on the meter scale.

ArgumentDefaultDescription
i(Mandatory)The position specified as a value on the meter scale.
Return Value
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
Returns the positions of all ticks as values on the meter scale.

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
Sets the format of the labels computed by ChartDirector.
Example
dim c as CDBaseMeterMBS

// you can use label formats like this:

c.setLabelFormat("<*block,halign=left*><*font=timesbi.ttf,size=12,underline=1*>{label}<*/font*><*br*>US$ {value}K ({percent}%)")

// we can reduce that to this:

c.setLabelFormat("{label} {value} {percent}%")

// and it shows 3 numbers. With |1 after the variable name, we define the decimals after dot:

c.setLabelFormat("{label} {value|1} {percent|1}%")

// and

c.setLabelFormat("{label} {value|1.,} {percent|1.,}%")

// uses dot for thousands and comma for decimal separator.

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.
ArgumentDefaultDescription
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
Sets the positions of the meter scale labels.

ArgumentDefaultDescription
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.
labelOffset0The 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
Sets the font style used to for the meter labels.

See Font Specification for details on various font attributes.
ArgumentDefaultDescription
font"bold"The font used to draw the labels.
fontSize-1The 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.
fontColorTextColorThe color used to draw the labels.
fontAngle0The rotation angle of the labels.
Return Value
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
Same as the other setLabelStyle method, but uses color instead of integer data type for passing color values.

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
Sets the line widths of the scale line and the ticks on the meter.

ArgumentDefaultDescription
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.
majorTickWidth1The 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.
minorTickWidth1The line width of the minor ticks in pixels.
microTickWidth1The 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
Same as the other setMeterColors method, but uses color instead of integer data type for passing color values.

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
Sets the colors of the meter scale line, scale label and tick.

ArgumentDefaultDescription
axisColor(Mandatory)The color for drawing the meter scale line. The default is LineColor.
labelColor-1The 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-1The 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
Sets the meter to use the given scale with the given numeric labels and tick positions.

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.
ArgumentDefaultDescription
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
Sets the meter to use the given scale with the given text labels and tick positions.

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.
ArgumentDefaultDescription
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
Sets the meter to use the given scale.

ArgumentDefaultDescription
lowerLimit(Mandatory)The lower limit of the meter scale.
upperLimit(Mandatory)The upper limit of the meter scale.
majorTickInc0The 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.
minorTickInc0The 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.
microTickInc0The 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
Set the lengths of the ticks.

ArgumentDefaultDescription
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-7fffffffThe length of the minor ticks in pixels. The default is 60% of the length of the major ticks.
microLen-7fffffffThe 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
Set the lengths of the ticks.

ArgumentDefaultDescription
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-7fffffffThe length of the minor ticks in pixels. The default is 60% of the length of the major ticks.
microLen-7fffffffThe 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
Set the lengths of the ticks.

ArgumentDefaultDescription
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-7fffffffThe length of the minor ticks in pixels. The default is 60% of the length of the major ticks.
microLen-7fffffffThe 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.


The biggest plugin in space...