Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDAxisMBS class.

Previous items

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