Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDBaseMeterMBS class.

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
Var 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...