Platforms to show: All Mac Windows Linux Cross-Platform
Back to CDAxisMBS class.
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 |
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.
| Parameter | Default | Description |
|---|---|---|
| b | true | A 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 |
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.
| Parameter | Default | Description |
|---|---|---|
| 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 |
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 |
| Parameter | Default | Description |
|---|---|---|
| majorTickColor | (Mandatory) | The color of the major ticks. |
| minorTickColor | -1 | The 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 |
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.
| Parameter | Default | Description |
|---|---|---|
| majorTickSpacing | (Mandatory) | Specify the desired distance between two major ticks in pixels. |
| minorTickSpacing | -1 | Specify 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 |
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.
| Parameter | Default | Description |
|---|---|---|
| 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 |
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.
| Parameter | Default | Description |
|---|---|---|
| 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 |
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.
| Parameter | Default | Description |
|---|---|---|
| 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 |
| Parameter | Default | Description |
|---|---|---|
| majorTickWidth | (Mandatory) | The width of the major ticks in pixels. |
| minorTickWidth | -1 | The 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 |
See Font Specification for details on various font attributes.
| Parameter | Default | Description |
|---|---|---|
| text | (Mandatory) | The title text. |
| font | "" | The font used to draw the title. If no font is specified, the default is "bold". |
| fontSize | 8 | The size of the font in points. |
| fontColor | TextColor | The 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 |
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 |
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.
| Parameter | Default | Description |
|---|---|---|
| alignment | (Mandatory) | The position of the title relative to the axis. |
| titleGap | 3 | The 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 |
| Parameter | Default | Description |
|---|---|---|
| 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 |
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.
| Parameter | Default | Description |
|---|---|---|
| axis | (Mandatory) | The axis to synchronize to. |
| slope | 1 | The slope for synchronizing this axis to the other axis. |
| intercept | 0 | The 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 |
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.
| Argument | Default | Description |
|---|---|---|
| axis | (Mandatory) | The axis to synchronize to. A value of null means not to synchronize to any axis. |
| slope | 1 | The slope for synchronizing this axis to the other axis. |
| intercept | 0 | The intercept parameter for synchronizing this axis to the other axis. |
The items on this page are in the following plugins: MBS ChartDirector Plugin.