Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDAxisMBS class.

Previous items

CDAxisMBS.setLabelOffset(offset as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Shifts the axis labels from its default position along the axis.

This method expects the offset along the axis being a value on the axis scale. The Box.setPos method of the axis label prototype (obtained using Axis.setLabelStyle) can also be used to shift the labels, with the offsets specified in pixel units.

ParameterDefaultDescription
offset(Mandatory)The distance to shift the labels along the axis as a value on the axis scale.

CDAxisMBS.setLabels(labels() as Double, formatString as string = "") 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 numeric/date/time labels to be used on the axis.

This method is typically used to set the x-axis to enumerated scale. For more details on what is enumerated axis scale, please refer to
Axis.setLabels.

This method assumes the labels are in their "native" form (that is, not formatted). Please refer to Date Representation for the native date/time formats supported in ChartDirector.

If the labels are already formatted into human readable form (that is, they are text strings), use Axis.setLabels instead.

One common issue is that there may be too many labels on the axis. In this case, the Axis.setLabelStep method may be used show only a regularly spaced subset of labels on the axis.

For date/time labels, another alternative is to use Axis.setMultiFormat, which uses filters to select important dates/times (such as dates/times representing the start of a month) for display as labels.

A third method to avoid too many labels is to remove some labels by replacing them with kNoValue before passing them to ChartDirector. If you want to remove the label text but leave a minor tick, use MinorTickOnly as the label value.

labels(Mandatory)An array of numbers/dates to be used as the axis labels.
formatString""A format string to specified how to format the labels into human readable form. Please refer to Axis.setLabelFormat for the syntax of the format string. An empty string means the format will be automatically determined.

Return Value
A TextBox object representing the prototype of the obj. This may be used to fine-tune the appearance of the obj.

See also:

CDAxisMBS.setLabels(labels() as string) 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 text labels to be used on the axis.

This method is typically used to set the x-axis to enumerated scale. In enumerated scale, the data points are associated with the x-axis by position. The first data point will be plotted at the first label position on the x-axis, the second data point at the second label position, and so on.

Enumerated axis is a very flexible axis type. It is most suitable for chart types where the data points are evenly spaced on the x-axis. The axis labels can be any text. They do not need to be numbers or dates. If they are numbers or dates, you can format them in any way you like before calling this method.

Internally, ChartDirector will assign a value of 0 to the first axis label, 1 to the second axis label, and so on. These values are not visible. Only the axis labels are visible. However, these values may be useful for some ChartDirector features that need to reference the axis position by value, such as adding mark lines using Axis.addMark.

By default, all axis labels will be associated major ticks. To associate a label with a minor tick, use '-' as the first character of the label. To draw a 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.

One common issue is that there may be too many labels on the axis. In this case, the Axis.setLabelStep method may be used show only a regularly spaced subset of labels on the axis.

Another method is to remove some labels is to replace them with empty strings before passing them to ChartDirector. If you want to remove the label text but leave a major tick, use a space character " " as the label text. If you want to remove the label text but leave a major tick, use "-" as the label text.

ParameterDefaultDescription
text(Mandatory)An array of strings containing the text 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 also:

CDAxisMBS.setLabelStep(majorTickStep as Integer, minorTickStep as Integer = 0, majorTickOffset as Integer = 0, minorTickOffset as Integer = -2147483647)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Shows a regularly spaced subset of the axis labels on the axis.

This method is typically used in conjunction with
Axis.setLabels. These two methods define the full set of labels on the axis, one for each data point in a data set. In many cases, there may be too many labels and the axis may become overcrowded with labels. The setLabelStep method will cause the axis to show a regularly spaced subset of labels instead all labels.

ParameterDefaultDescription
majorTickStep(Mandatory)The spacing between visible labels (major ticks). For example, a value of 10 means displaying 1 label for every 10 labels.
minorTickStep0For labels that are not displayed, ChartDirector can optionally put a minor tick in its place. The argument specifies the spacing between minor ticks. For example, a value of 5 means displaying 1 minor tick for every 5 labels. The default value of 0 means no minor tick is used.
majorTickOffset0The offset used for selecting the labels. For example, if majorTickStep is set to 10, by default, ChartDirector will select the labels with index 0, 10, 20, 30 and so on. If the majorTickOffset argument is set to 3, then ChartDirector will select labels with index 3, 13, 23, 33 and so on.
minorTickOffset-7fffffffThe offset used for selecting minor tick points. The usage is the same as the majorTickOffset argument, except it applies to minor tick points. The default is to use the same value as majorTickOffset.

Some examples using this method:

CDAxisMBS.setLabelStyle(font as string = "", fontsize as Double = 8, 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 axis labels.

See Font Specification for details on various font attributes.

ParameterDefaultDescription
font""The font used to draw the labels.
fontSize8The font size used to draw the labels in points.
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:

CDAxisMBS.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:

CDAxisMBS.setLength(length as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the length of the axis.

CDAxisMBS.setLinearScale(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 axis to use linear auto-scale.

ParameterDefaultDescription
formatString""The format used for the labels on the axis. Please refer to Axis.setLabelFormat for the syntax of the format string. An empty string means the format will be automatically determined.

See also:

CDAxisMBS.setLinearScale(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 axis to use the given linear scale and the given labels.

ParameterDefaultDescription
lowerLimit(Mandatory)The lower bound of the axis.
upperLimit(Mandatory)The upper bound of the axis.
labels(Mandatory)An array of text strings to be used as the labels on the axis. ChartDirector will distribute the labels evenly on the axis. By default, all labels are associated with major ticks. These can be modified by using '-' or '~' as the first character. Please refer to Axis.setLabels for details.

See also:

CDAxisMBS.setLinearScale(lowerLimit as Double, upperLimit as Double, majorTickInc as Double = 0, minorTickInc 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 axis to use the given linear scale.

ParameterDefaultDescription
lowerLimit(Mandatory)The lower bound of the axis.
upperLimit(Mandatory)The upper bound of the axis.
majorTickInc0Adds major ticks to the axis, where the major ticks are separated by majorTickInc in value. Each major tick will have an associated text label for the value if the axis at the tick. The default value of 0 means the major ticks will be automatically determined. In this case, the lowerLimit and upperLimit may be automatically adjusted to align with the ticks. Use kNoValue to disable major ticks.
minorTickInc0Adds minor ticks to the axis, where the minor ticks are separated by minorTickInc in value. The default value of 0 means no minor tick is used.

See also:

CDAxisMBS.setLogScale(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 axis to use logarithmic auto-scale.

ParameterDefaultDescription
formatString""The format used for the labels on the axis. Please refer to Axis.setLabelFormat for the syntax of the format string. An empty string means the format will be automatically determined.

See also:

CDAxisMBS.setLogScale(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 axis to use the given logarithmic scale and the given labels.

ParameterDefaultDescription
lowerLimit(Mandatory)The lower bound of the axis.
upperLimit(Mandatory)The upper bound of the axis.
labels(Mandatory)An array of text strings to be used as the labels on the axis. ChartDirector will distribute the labels evenly on the axis. By default, all labels are associated with major ticks. These can be modified by using '-' or '~' as the first character. Please refer to Axis.setLabels for details.

See also:

CDAxisMBS.setLogScale(lowerLimit as Double, upperLimit as Double, majorTickInc as Double = 0, minorTickInc 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 axis to use the given logarithmic scale.

ParameterDefaultDescription
lowerLimit(Mandatory)The lower bound of the axis.
upperLimit(Mandatory)The upper bound of the axis.
majorTickInc0Adds major ticks to the axis, where the major ticks are separated by majorTickInc in ratio. For example, a value of 10 means each tick will be 10 times the value of the previous tick. Each major tick will have an associated text label for the value if the axis at the tick. The special predefined constant LogTick ( = 1.6e308) means the tick increment will be using the non-regular ratio 1, 2, 5, 10, 20, 50, 100, .... The default value of 0 means the major ticks will be automatically determined. In this case, the lowerLimit and upperLimit may be automatically adjusted to align with the ticks. Use kNoValue to disable major ticks.
minorTickInc0Adds minor ticks to the axis, where the minor ticks are separated by minorTickInc in ratio.

The special constant LogTick means the tick increment will be using the non- regular ratio 1, 2, 5, 10, 20, 50, 100, ....

The default value of 0 means no minor tick is used.

See also:

CDAxisMBS.setMargin(topMargin as Integer, bottomMargin as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reserve margins at the ends of the axis.

This method is usually used to reserve space in the plot area. For example, if some margin is reserved at the top of the vertical y-axis, the top of the plot area will contain no data points. It is because this region would be outside the active range of the y-axis. If anything is put at the top of the plot area (such as a legend box or custom text), it will not overlap with the data points.

Note if auto-scaling is used, there is an alternative way to reserve space at the top and/or bottom of the plot area - the Axis.setAutoScale method.

ParameterDefaultDescription
topMargin(Mandatory)The margin reserved at the top end (or right end for horizontal axis) of the axis in pixels.
bottomMargin0The margin reserved at the bottom end (or left end for horizontal axis) of the axis in pixels.

CDAxisMBS.setMinTickInc(value as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the minimum distance between two ticks on the axis for auto-scaled axis.

The most common use of this method is to ensure the ticks are of integer values (the minimum distance set to 1).

ChartDirector auto-scaling will automatically determine the optimal number of ticks and labels on the axis. However, in some cases, the nature of the data may be such that the ticks should assume only certain discrete values (such as must be integers). This method will inform ChartDirector for this constraint when performing auto-scaling.

For a log scale axis, because the axis ticks are unevenly spaced, the minimum distance will be handled as the minimum value allowed for the axis scale.

ParameterDefaultDescription
inc(Mandatory)The minimum distance between two ticks on the axis as a data value.

CDAxisMBS.setMultiFormat(filter as Integer, format as string, labelSpan as Integer = 1, promoteFirst as boolean=true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds one filter and format string to the multi-format lists.

Please refer to Axis.setMultiFormat on how to use this method.

ParameterDefaultDescription
filterId(Mandatory)The filter that defines a subset of labels.
formatString(Mandatory)The format string for formatting the subset defined by the above filter.
labelSpan1The number of label positions that are claimed by one label. If a label occupies more than 1 position, ChartDirector will not put labels on nearby positions, even if they meet the filter criteria.
promoteFirsttrueIf set to true, the first label will be promoted to a higher filter category in the multi-format list.

See also:

Some examples using this method:

CDAxisMBS.setMultiFormat(filter1 as Integer, format1 as string, filter2 as Integer, format2 as string, labelSpan as Integer = 1, promoteFirst as boolean=true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets multiple formats for numeric or date/time axis labels.

This method is typically used to format date/time labels. For example, for an axis that spans 90 days, this method can be used to format the first labels of each month in bold as "mmm-dd", while other labels are shown in normal font as "dd".

The multiple formats are defined as a list of filters and format strings. If the label value satisfies the first filter, it will be formatted using the first format string. Otherwise if the label value satisfies the second filter, it will be formatted using the second format string, and so on. If a label value does not satisfy any filter, it will be discarded.

In the above example, the first filter can be a "start of month" filter (created using Chart::StartOfMonthFilter), and the first format string can be "{value|mmm-dd}". The second filter can be the "all pass" filter (created using Chart::AllPassFilter), and the format string can be "{value|dd}".

Supported filters in ChartDirector include:

FilterDescription
Chart::StartOfHourFilterCreates a data filter that matches date/times that represent the start of a new hour in a date/time series.
Chart::StartOfDayFilterCreates a data filter that matches date/times that represent the start of a new day in a date/time series.
Chart::StartOfWeekFilterCreates a data filter that matches date/times that represent the start of a new week in a date/time series.
Chart::StartOfMonthFilterCreates a data filter that matches date/times that represent the start of a new month in a date/time series.
Chart::StartOfYearFilterCreates a data filter that matches date/times that represent the start of a new year in a date/time series.
Chart::RegularSpacingFilter Creates a data filter that matches 1 out of every N elements.
Chart::AllPassFilter Creates a data filter that matches every element.
Chart::NonePassFilterCreates a data filter that matches no element.
Chart::SelectItemFilterCreates a data filter that matches one specified item.

For the format strings, please refer to Parameter Substitution and Formatting on their syntax.

A single setMultiFormat method supports two filters and two format strings. You can use multiple setMultiFormat methods to add more filters and format strings.

One common issue in putting labels on the axis is that there may be too many labels on the axis. The setMultiFormat method supports a labelSpan argument that specifies how many label positions a single label will occupy. If a label occupies more than 1 position, ChartDirector will not put labels on nearby positions, even if they meet the filter criteria.

The setMultiFormat method supports special handling of the first label on the axis. For example, in the above example, we may want to show the the first label as "mmm-dd", even if it is not actually the "start of month". The promoteFirst argument, if set to true, will cause the first label to be promoted to a higher filter category in the multi-format list. For example, if the first label satisfies only the second filter, it will be formatted as if it satisfies the first filter.

ParameterDefaultDescription
filter1(Mandatory)The filter that defines the first kind of labels.
format1(Mandatory)The format string for the first kind of labels.
filter2(Mandatory)The filter that defines the second kind of labels.
format2(Mandatory)The format string for the second kind of labels.
labelSpan1The number of label positions that are claimed by one label. If a label occupies more than 1 position, ChartDirector will not put labels on nearby positions, even if they meet the filter criteria.
promoteFirsttrueIf set to true, the first label will be promoted to a higher filter category in the multi-format list.

See also:

CDAxisMBS.setOffset(x as Integer, y as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 9.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the positional offset of the axis.

By default, ChartDirector draws horizontal axes at the top/bottom borders of the plot area, and vertical axes at the left/right borders of the plot area.

This method can be used to shift an axis from its standard position.

Arguments:
ArgumentDefaultDescription
x(Mandatory)The x offset in pixels.
y(Mandatory)The y offset in pixels.

CDAxisMBS.setReverse(value as boolean=true)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Reverse the axis.

For a normal vertical axis, the axis starts from the bottom and increase its value towards the top. For a normal horizontal axis, the axis starts from the left and increase its value towards the right. The setReverse method can be used to reverse the direction of the axis.

ParameterDefaultDescription
btrueA true value means the axis is reversed. A false value means the axis is not reversed.

CDAxisMBS.setRounding(roundMin as boolean, roundMax as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Controls whether to round the ends of the axis to align with tick positions.

For example, if the axis is from 0.33 - 9.7, ChartDirector may round it to 0 - 10 so that the ends 0 and 10 are properly aligned with the ticks.

By default, ChartDirector will round the axis ends for the y-axis, but not for the x-axis. An exception is a chart containing a scatter layer, where both x and y axes will be rounded.

ParameterDefaultDescription
roundMin(Mandatory)A true value means the lesser end of the axis should be rounded to align with tick positions. A false value means no rounding.
roundMax(Mandatory)A true value means the greater end of the axis should be rounded to align with tick positions. A false value means no rounding.

CDAxisMBS.setTickColor(majorTickColor as color, minorTickColor 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 setTickColor method, but uses color instead of integer data type for passing color values.

See also:

CDAxisMBS.setTickColor(majorTickColor as Integer, minorTickColor 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 axis ticks.

ParameterDefaultDescription
majorTickColor(Mandatory)The color of the major ticks.
minorTickColor-1The color of the major ticks. -1 means the color is the same as majorTickColor

See also:

CDAxisMBS.setTickDensity(majorTickSpacing as Integer, minorTickSpacing 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 density of the axis ticks.

Tick density is the desired distance between two ticks in pixels. When ChartDirector performs auto-scaling, it will decide how many ticks to put on the axis based on tick density.

Note that the actual tick density chosen in auto-scaling may not be exactly the same as the desired tick density. It is because ChartDirector may have other constraints in choosing the ticks, such as the ticks and axis range should be neat numbers, and the axis must contain an integral number of ticks, etc. ChartDirector may use a tick distance that is larger than suggested, but never smaller.

ParameterDefaultDescription
majorTickSpacing(Mandatory)Specify the desired distance between two major ticks in pixels.
minorTickSpacing-1Specify the desired distance between two minor ticks in pixels. -1 means minor ticks are not used.

CDAxisMBS.setTickLength(majorTickLen as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the length of the axis ticks.

A positive tick length means the ticks are drawn outside the plot area. A negative tick length means the ticks are drawn inside the plot area.

ParameterDefaultDescription
majorTickLen(Mandatory)The length of the major ticks in pixels. The length of the minor ticks will automatically be set to half the length of the major ticks.

See also:

CDAxisMBS.setTickLength(majorTickLen as Integer, minorTickLen as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the length of the major and minor axis ticks.

A positive tick length means the ticks are drawn outside the plot area. A negative tick length means the ticks are drawn inside the plot area.

ParameterDefaultDescription
majorTickLen(Mandatory)The length of the major ticks in pixels.
minorTickLen(Mandatory)The length of the minor ticks in pixels.

See also:

CDAxisMBS.setTickOffset(offset as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Shifts the position of the ticks along the axis.

By default, ChartDirector draws the ticks at the label position. This method is typically used to shift the ticks so that the ticks are between two labels, rather than aligned with the label.

The offset is specified as a value on the axis scale. For a label based axis (configured using Axis.setLabels), shifting with an offset of 0.5 means shifting half the label interval. This will achieve the effect of putting the ticks in between the labels.

ParameterDefaultDescription
offset(Mandatory)The distance to shift the ticks along the axis as a value on the axis scale.

CDAxisMBS.setTickWidth(majorTickWidth as Integer, minorTickWidth 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 width of the axis ticks.

ParameterDefaultDescription
majorTickWidth(Mandatory)The width of the major ticks in pixels.
minorTickWidth-1The width of the minor ticks in pixels. -1 means the width is the same as majorTickWidth.

CDAxisMBS.setTitle(text as string, font as string = "", fontsize as Double = 8, fontcolor as Integer = &hffff0002) as CDTextBoxMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Adds a title to the axis.

See Font Specification for details on various font attributes.

ParameterDefaultDescription
text(Mandatory)The title text.
font""The font used to draw the title. If no font is specified, the default is "bold".
fontSize8The size of the font in points.
fontColorTextColorThe color used to draw the title text.

Return Value
A TextBox object representing the axis title. This may be used to fine-tune the appearance of the axis title.

See font specification here:
http://www.monkeybreadsoftware.net/faq-chartdirectorfontspecification.shtml

See also:

CDAxisMBS.setTitle(text as string, font as string, fontsize as Double, fontcolor as color) 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 setTitle method, but uses color instead of integer data type for passing color values.

See also:

CDAxisMBS.setTitlePos(alignment as Integer, titleGap as Integer = 3)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the position of the axis title relative to the axis.

By default, the axis title will be drawn at the middle of the axis outside the plot area. You may change the location of the title. For example, instead of drawing the y-axis title at the middle of the axis, you may want draw it at the top of the axis.

ParameterDefaultDescription
alignment(Mandatory)The position of the title relative to the axis.
titleGap3The distance between the axis title and the axis in pixels.

CDAxisMBS.setWidth(width as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Sets the line width of the axis.

ParameterDefaultDescription
width(Mandatory)The line width of the axis in pixels.

CDAxisMBS.syncAxis(axis as CDAxisMBS, slope as Double = 1.0, intercept as Double = 0.0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Synchronizes this axis with another axis using a linear formula.

This method is typically used if the two axes represent the same quantity but in different units. For example, one axis may represent temperature in Celsius, and the other in Fahrenheit, or they may represent lengths in meters and feet.

The scale of this axis (value) will be related to the scale of the another axis (value2) using the following formula:

value = value2 * slope + intercept

Typically, one of the axis will be for actual charting, and its scale will be determined in the standard way using auto or manual scaling. Then the second axis is set to synchronize with the first axis.

ParameterDefaultDescription
axis(Mandatory)The axis to synchronize to.
slope1The slope for synchronizing this axis to the other axis.
intercept0The intercept parameter for synchronizing this axis to the other axis.

CDAxisMBS.syncScale(axis as CDAxisMBS = nil, slope as double = 1.0, intercept as double = 0.0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Synchronizes the scale of this axis with another axis using a linear formula.

The scale of this axis (value) will be related to the scale of the source axis (value2) using the following formula:

value = value2 * slope + intercept

The differences between syncScale and Axis.syncAxis are:

  • Axis.syncAxis assumes the two axes are of the same length. In addition to the scale, it will also synchronize the ticks and labels, and configurations that may affect the positions of ticks and labels, such as axis margins and axis indentation. This ensures the two axes scale align properly.
  • syncScale does not assume the two axes are of the same length. For example, the y-axis of one chart can be synchronized with the CDColorAxisMBS of a different chart. The two axes can have different labels to fit their different lengths.

ArgumentDefaultDescription
axis(Mandatory)The axis to synchronize to. A value of null means not to synchronize to any axis.
slope1The slope for synchronizing this axis to the other axis.
intercept0The intercept parameter for synchronizing this axis to the other axis.

Previous items

The items on this page are in the following plugins: MBS ChartDirector Plugin.


The biggest plugin in space...