Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

CDAxisMBS.addLabel(pos as Double, label as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds an extra label on the axis.
Notes:
ParameterDefaultDescription
pos(Mandatory)The position on the axis to add the label.
label(Mandatory)The text label to add.

Feedback, Comments & Corrections

CDAxisMBS.addMark(value as Double, lineColor as color, text as string = "", font as string = "", fontsize as Double = 8) as CDMarkMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 11.1 Yes Yes Yes Yes No
Function: Same as the other addMark method, but uses color instead of integer data type for passing color values.

See also:

Feedback, Comments & Corrections

CDAxisMBS.addMark(value as Double, lineColor as Integer, text as string = "", font as string = "", fontsize as Double = 8) as CDMarkMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a mark line to the chart.
Notes:
A mark line is a line drawn on the plot area. This line is usually used to indicate some special values, such as a "target value", "threshold value", "target date", etc.

A mark line attached to the horizontal axis will be vertical across the plot area. A mark line drawn using the vertical axis will be horizontal across the plot area. In either case, the mark line label will be added to the axis at the mark line position.

The location of the mark line label can be changed by using
TextBox.setAlignment. For example, by setting the alignment to TopCenter, the mark line label will be drawn on the top center of the mark line.

By default, the mark line is drawn at the front of the chart layers. You may change it to draw at the back of the plot area (that is, like grid lines) using
Mark.setDrawOnTop.

ParameterDefaultDescription
value(Mandatory)The value on the axis to draw the mark line.
lineColor(Mandatory)The color of the mark line.
text""The text label for the mark line. An empty string means there is no text label. By default, the text label and the tick on the axis will be drawn using the same color as the mark line. You can modify the colors by using the Mark.setMarkColor method.
font""The font used to draw the text label.
fontSize8The font size used to draw the text label in points.

See also:

Feedback, Comments & Corrections

CDAxisMBS.addZone(startValue as Double, endValue as Double, colorvalue as color)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 11.1 Yes Yes Yes Yes No
Function: Same as the other addZone method, but uses color instead of integer data type for passing color values.

See also:

Feedback, Comments & Corrections

CDAxisMBS.addZone(startValue as Double, endValue as Double, colorvalue as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Adds a zone to the chart.
Notes:
A zone is a range of values. For example, "10 to 20" is a zone. Typically, a zones are used to classify data ranges. For example, you may classify 0 - 60 as the normal zone, 60 - 90 as the warning zone, and 90 - 100 as the critical zone.

A zone based on a horizontal axis will be drawn as a vertical band. A zone based on a vertical axis will be drawn as a horizontal band. Zones are always drawn at the back of the plot area.

ParameterDefaultDescription
startValue(Mandatory)The start value (the lower bound) for the zone.
endValue(Mandatory)The end value (the upper bound) for the zone.
color(Mandatory)The color of the zone.

See also:

Feedback, Comments & Corrections

CDAxisMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 15.2 Yes Yes Yes Yes No
Function: The private constructor.

Feedback, Comments & Corrections

CDAxisMBS.copyAxis(axis as CDAxisMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Copies the scale and labels from another axis.
Notes:
This method is typically used to ensure the axes on different charts are identical. For example, if multiple charts are draw and are stacked up, and you want the x-axes of the charts to be the same for easy comparison, you may copy the x-axis from one chart to the other charts.

The differences between copyAxis and Axis.syncAxis are:

Axis.syncAxis relates the axes with a linear relationship, so the axes may not be exact copies of one another.

Axis.syncAxis synchronizes axis scale and copies only scale related labels, such as the labels generated by auto-scaling, Axis.setLinearScale, Axis.setLogScale or Axis.setDateScale.

copyAxis copies all labels, including labels created using
Axis.setLabels, which may be arbitrary text.

ParameterDefaultDescription
axis(Mandatory)The axis to copy from.

Feedback, Comments & Corrections

CDAxisMBS.getAlignment as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 12.3 Yes Yes Yes Yes No
Function: Gets the side of the plot area that the axis is associated with.
Notes: This method is only applicable to XYChart objects.

Feedback, Comments & Corrections

CDAxisMBS.getAxisImageMap(noOfSegments as Integer, mapWidth as Integer, url as string, queryFormat as string = "", extraAttr as string = "", offsetX as Integer = 0, offsetY as Integer = 0) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Generates an HTML image map for the axis itself.
Notes:
This method is similar to Axis.getHTMLImageMap. The difference is instead of generating an image map for the labels, it generates an image map for the axis itself. The axis will be divided into a number of segments, with an image map entry created for each segment.

ParameterDefaultDescription
noOfSegments(Mandatory)The number of segments to divide the axis into.
mapWidth(Mandatory)The width of the axis used for the purpose of generating the image map.
url(Mandatory)The URL to be used in the "href" attribute of the image map. Parameter Substitution and Formatting is supported. Use an empty string if no href attribute is needed.
queryFormat""A text string representing the template of the query parameters to be appended to the URL. Parameter Substitution and Formatting is supported.The special keyword "{default}" represents the default query parameters. This is useful for specifying appending to the default. Note that an empty string means to use the default query query parameters. To specify no query parameter, use a space character.
extraAttr""A text string to specify additional attributes to add to the <area> tag. Parameter Substitution and Formatting is supported.
offsetX0An offset to be added to all x coordinates in the image map. This is useful if the current image will be shifted and inserted into another image. In this case, the image map will need to be shifted by the same offset.
offsetY0An offset to be added to all y coordinates in the image map. See offsetX above for description.

Feedback, Comments & Corrections

CDAxisMBS.getCoor(value as Double) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the geometric coordinates given the data value.

Feedback, Comments & Corrections

CDAxisMBS.getFormattedLabel(v as Double, options as string = "") as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 12.3 Yes Yes Yes Yes No
Function: Gets the label at the specified position on the axis, formatting one if necessary.
Notes:
ArgumentDefaultDescription
v(Mandatory)The position specified as a value on the axis scale.
formatString""The format string used to format a label if necessary. Please refer to Axis.setLabelFormat for the syntax of the format string. An empty string means the format will be automatically determined.

Feedback, Comments & Corrections

CDAxisMBS.getHTMLImageMap(url as string, queryFormat as string = "", extraAttr as string = "", offsetX as Integer = 0, offsetY as Integer = 0) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Generates an HTML image map for the axis labels.
Notes:
This method should be called only after creating the chart image (eg. using BaseChart.makeChart). The image map cannot be determined without creating the chart image first.

This method accepts a URL as its argument. When generating an image map, it appends query parameters to the URL to indicate which legend entry the user has clicked.

The following is an example image map generated for an axis with 3 labels.

<area shape="rect" coords="30,220,70,239" href="handler.asp?value=0&label=John">
<area shape="rect" coords="70,220,110,239" href="handler.asp?value=1&label=Mary">
<area shape="rect" coords="110,220,150,239" href="handler.asp?value=2&label=Peter">

The image map consists of multiple <area> tags, one for each label. In the "href" attributes, query parameters are appended to the URL to provide information on the label clicked.

The image map produces by ChartDirector does not include the <map> and </map> tag. This is intentional so that you can add additional custom <area> tags to the image map, or append multiple image maps together.

The format of the appended URL parameters is determined using the
queryFormat argument, which by default is:

value={value}&label={label}

The texts in curly brackets (i.e. {value}, {label}) will be replaced by the actual values when generating the image map. For example, {label} will be replaced by the label text.

Please refer to Parameter Substitution and Formatting on all available parameters and how to format them.

In addition to customizing the query parameters, ChartDirector supports additional HTML attributes in the <area> tags using the extraAttr argument.

For example, the following extraAttr will add a "title" HTML attribute to every <area> tag. The "title" attribute will be displayed as "tool tip" when the mouse moves over the image map.

title='Click me for details on {label}'

Another common usage of the extraAttr argument is to add "onmouseover" and "onmouseout" HTML attributes to handle user interaction using Javascript on the browser.

ParameterDefaultDescription
url(Mandatory)The URL to be used in the "href" attribute of the image map.
Parameter Substitution and Formatting is supported. Use an empty string if no href attribute is needed.
queryFormat""A text string representing the template of the query parameters to be appended to the URL. Parameter Substitution and Formatting is supported. The special keyword "{default}" represents the default query parameters. This is useful for specifying appending to the default. Note that an empty string means to use the default query query parameters. To specify no query parameter, use a space character.
extraAttr""A text string to specify additional attributes to add to the <area> tag. Parameter Substitution and Formatting is supported.
offsetX0An offset to be added to all x coordinates in the image map. This is useful if the current image will be shifted and inserted into another image. In this case, the image map will need to be shifted by the same offset.
offsetY0An offset to be added to all y coordinates in the image map. See offsetX above for description.

Feedback, Comments & Corrections

CDAxisMBS.getLabel(i as Double) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the label at the specified position on the axis.
Notes:
ParameterDefaultDescription
i(Mandatory)The position specified as a value on the axis scale.

Return Value
Returns the label at the specified position, or a "" string if there is no label at that position.

Feedback, Comments & Corrections

CDAxisMBS.getLabelTable as CDMLTableMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Gets the CDML table created by CDAxisMBS.makeLabelTable.

Feedback, Comments & Corrections

CDAxisMBS.getMaxValue as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the upper bound of the axis.
Notes: The upper bound of an axis is known only after auto-scaling. So this method should be called only after ChartDirector has finished auto-scaling (e.g. after calling BaseChart.layout to explicitly auto-scale the axis).

Feedback, Comments & Corrections

CDAxisMBS.getMinValue as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the lower bound of the axis.
Notes: The lower bound of an axis is known only after auto-scaling. So this method should be called only after ChartDirector has finished auto-scaling (e.g. after calling BaseChart.layout to explicitly auto-scale the axis).

Feedback, Comments & Corrections

CDAxisMBS.getThickness as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Gets the thickness of the axis.
Notes:
The axis can be considered as a line, with one side facing the internal of the plot area, and the other side not facing the plot area. By default, the latter side includes the axis labels and axis title (although ChartDirector allows the axis to be configured so that the labels and titles are internal to the plot area).

The thickness of an axis only refers to the thickness of the side not facing the plot area. For a vertical axis, it is the width of the bounding box of that side, including the axis ticks, labels and title if they are on that side. For a horizontal axis, it is the height of the bounding box.

The intention of this method is to allow the chart to be adjusted to leave enough space for the axis labels and title.

This method should be called only after axis layout (after calling CDXYChartMBS.layoutAxes, CDBaseChartMBS.layout or CDXYChartMBS.packPlotArea).

Arguments:
None

Return Value
The thickness of the axis in pixels.

Feedback, Comments & Corrections

CDAxisMBS.getTicks as CDArrayMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Gets the values of the ticks.
Notes:
Return Value
An array of numbers representing the values of the ticks.

Feedback, Comments & Corrections

CDAxisMBS.getX as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 12.3 Yes Yes Yes Yes No
Function: Gets the x-coordinate of starting point of the axis.
Notes: For an XYChart object, the starting point of a horizontal axis is its left end point, and the starting point of a vertical axis is its bottom end point. For a PolarChart object, the starting point of a radial axis is the origin. For other types of charts, the starting point of an axis is undefined.

Feedback, Comments & Corrections

CDAxisMBS.getY as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 12.3 Yes Yes Yes Yes No
Function: Gets the y-coordinate of starting point of the axis.
Notes: For an XYChart object, the starting point of a horizontal axis is its left end point, and the starting point of a vertical axis is its bottom end point. For a PolarChart object, the starting point of a radial axis is the origin. For other types of charts, the starting point of an axis is undefined.

Feedback, Comments & Corrections

CDAxisMBS.makeLabelTable as CDMLTableMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Creates a CDML table and docks it to the axis, with one row (for horizontal axis) or column (for vertical axis) containing the axis labels.
Notes:
Before calling this method, it is necessarily to set the labels on the axis first using CDAxisMBS.setLabels. You should only use this method on a label based axis with no label stepping.

This method will automatically indent the axis (see CDAxisMBS.setIndent), and set the tick offset to 0.5 (see CDAxisMBS.setTickOffset). This is to ensure the plot area grid lines align with the table grid lines (instead of align with the labels).

You may use the returned CDMLTableMBS object to insert additional rows and/or columns to the table. A common application of this method is to insert the data values to the table, so the chart will have a data table docked to the axis, aligned with the chart contents.

Arguments:
None

Return Value
A CDMLTable object containing the axis labels.

Feedback, Comments & Corrections

CDAxisMBS.setAngle(angle as Double)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Sets the angular coordinates of the data points.

Feedback, Comments & Corrections

CDAxisMBS.setAutoScale(topExtension as Double = 0.1, bottomExtension as Double = 0.1, zeroAffinity as Double = 0.8)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Sets the margins at the two ends of the axis during auto-scaling, and whether to start the axis from zero.
Notes:
During auto-scaling, it is often desirable to leave some margins at the ends of the axis. For example, suppose in a bar chart, the longest bar is 10 units. If auto-scaling chooses 0 - 10 as the scale, the longest bar will touch the top edge of the plot area. In many cases, the chart will look better if there is some margin so that the longest bar does not touch the top edge.

The setAutoScale can be used to reserve some margins at the ends of the axis by using a scale that is larger than necessary. For example, in the above case, if a scale of 0 - 12 is used, then the longest bar will not touch the top edge.

Other common reasons for reserving margins at the ends of the axis include making sure the data labels (which may be drawn on top of the data points) will not go outside the plot area, and that objects put at the top or bottom of the plot area (such as legend box and custom text box) will not overlap with the data points.

Note that there is an alternative way to reserve space at the ends of the axis - the Axis.setMargin method.

In the setAutoScale method, the amount of margins reserved is controlled by the topExtension and bottomExtension arguments. These arguments determine the portion of the axis where no data point can reach. For example, a topExtension of 0.2 will ensure no data point can fall within the top 20% of the axis.

Note that ChartDirector will not extend the scale across the 0 point.

For example, suppose the data range is 0.1 - 9.9. If 10% margin is added to the bottom end of the axis, the bottom end may become negative. In this case, ChartDirector will extend the bottom end to 0 at most.

In other words, if the data range is completely positive, ChartDirector will not extend the axis to negative, as it would be undesirable in most applications. The same applies if the data range is completely negative.

For a purely positive axis, the bottom end has "zero affinity". That means ChartDirector will tend to choose 0 as the bottom end because zero is a natural starting point for the axis. However, if the data range is too extreme (e.g. the data is in the range 10000 - 10005), it may be "unreasonable" to choose 0 as the axis starting point. In this case, ChartDirector will not use 0 as the axis starting point.

ChartDirector will determine that it is "unreasonable" to use 0 as the axis starting point if the data fluctuation (the difference between the maximum and minimum data values) is too small compare with the data value. ChartDirector test the "too small" condition using the formula:

maxDataValue * zeroAffinity < minDataValue

where zeroAffinity by default is 0.8.

Similar "zero affinity" mechanism applies to the top end of the axis for a purely negative axis. If the data range contains both positive and negative values, the zero point is always included.

The zeroAffinity argument of the setAutoScale method allows you to modify the zero affinity when performing auto-scaling. Zero affinity should be between 0 and 1. A large value encourages ChartDirector to start the axis from zero.

A zero affinity of 1 means the axis always includes the zero point. A zero affinity of 0 means that the axis is scaled purely according to the data range, without any preference for the zero point.

Note that zero affinity is ignored for log scale axis as log scale axis cannot contain 0.

ParameterDefaultDescription
topExtension0.1The top portion of the axis that no data point should fall into. For example, a value of 0.2 means no data value will fall within the top 20% of the axis. The topExtension must be between 0 to 1.
bottomExtension0.1The bottom portion of the axis that no data point should fall into. For example, a value of 0.2 means no data value will fall within the bottom 20% of the axis. The bottomExtension must be between 0 to 1.
zeroAffinity0.8The tendency of ChartDirector to include zero in the axis during auto-scaling. The value must be between 0 and 1. A large value encourages ChartDirector to start the axis from zero. A value of 1 means the axis always includes the zero point. A value of 0 means there is no preference for the zero point during auto-scaling.

Feedback, Comments & Corrections

CDAxisMBS.setColors(axisColor as color, labelColor as color, titleColor as color, tickColor as color)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 11.1 Yes Yes Yes Yes No
Function: Same as the other setColors method, but uses color instead of integer data type for passing color values.

See also:

Feedback, Comments & Corrections

CDAxisMBS.setColors(axisColor as Integer, labelColor as Integer = &hffff0002, titleColor as Integer = -1, tickColor as Integer = -1)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Sets the colors of the axis itself, axis label, axis title and axis ticks.
Notes:
By default, the axis and axis ticks are drawn using the LineColor, while the axis label and axis title are drawn using the TextColor. You may use this method to change their colors.

ParameterDefaultDescription
axisColor(Mandatory)The color of the axis itself.
labelColorTextColorThe color of the axis labels.
titleColor-1The color of the axis title. -1 means the axis title color is the same as the axis label color.
tickColor-1The color of the axis ticks. -1 means the axis ticks color is the same as the axis color.

See also:

Feedback, Comments & Corrections

CDAxisMBS.setDateScale(formatString as string = "")
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Sets the axis to use date auto-scale.
Notes:
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:

Feedback, Comments & Corrections

CDAxisMBS.setDateScale(lowerLimit as Double, upperLimit as Double, labels() as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Sets the axis to use the given date scale and the given labels.
Notes:
ParameterDefaultDescription
lowerLimit(Mandatory)The lower bound of the axis, representing using one of the ChartDirector supported date format.
upperLimit(Mandatory)The upper bound of the axis, representing using one of the ChartDirector supported date format.
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:

Feedback, Comments & Corrections

CDAxisMBS.setDateScale(lowerLimit as Double, upperLimit as Double, majorTickInc as Double = 0, minorTickInc as Double = 0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Sets the axis to use the given date scale.
Notes:
ParameterDefaultDescription
lowerLimit(Mandatory)The lower bound of the axis, representing using one of the ChartDirector supported date format.
upperLimit(Mandatory)The upper bound of the axis, representing using one of the ChartDirector supported date format.
majorTickInc0Adds major ticks to the axis, where the major ticks are separated by majorTickInc seconds. Each major tick will have an associated text label for the value if the axis at the tick. The value 30 * 86400 will be assume to mean one month (which actually contains a variable number of seconds), and 60 * 86400 will be assumed to mean 2 months and so on. The value 360 * 86400 therefore means 12 months, or 1 year. 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 x-axis, where the minor ticks are separated by minorTickInc seconds.

The value 30 * 86400 will be assume to mean one month (which actually contains a variable number of seconds), and 60 * 86400 will be assumed to mean 2 months and so on. The value 360 * 86400 therefore means 12 months, or 1 year.

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

See also:

Feedback, Comments & Corrections

CDAxisMBS.setFormatCondition(condition as string, operand as Double = 0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Specifies the condition that subsequent Axis.setLabelFormat and Axis.setMultiFormat will become applicable.
Notes:
In some applications, the axis range can vary greatly. For example, for a date/time axis, the ticks on the axis can be hourly ticks if the duration is short, or daily ticks (or even monthly or yearly) if the duration is long. One can always use a universal axis format that is applicable in all cases (such as "mmm dd, yyyy<*br*>hh:nn:ss"), or one can leave ChartDirector to automatically come up with a suitable axis format.

Sometimes it may be desirable to explicitly specify different axis formats depending on tick types. For example, one may want to specify a certain format if the ticks are hourly, and another format if the ticks are daily.

If it is possible to predict which kind of ticks will be on the axis, one can always use "if" statements to specify different axis formats for various cases.

The setFormatCondition method is for cases in which it is difficult to predict which type of ticks would appear on the axis. For example, in an auto-scaled axis in which the duration can vary continuously, in some marginal cases, it is difficult to predict if auto-scaling will choose hourly or daily ticks.

The setFormatCondition method allows you to specify a condition to be tested against the auto-scaling result, so that subsequent
Axis.setLabelFormat or Axis.setMultiFormat will be applicable only if the condition is true.

The types of condition supported are:

Condition
Description

"align"Test if all the ticks are aligned to the operand. Use 3600 for testing hourly alignment, 86400 (1 day = 86400) for daily alignment, 30 * 86400 for monthly alignment and 360 * 86400 for yearly alignment. (Note: The values for monthly and yearly alignments are special values recognized by ChartDirector. They works even if a month or year is not exactly 30 or 360 days.)
">"Test if the maximum absolute value of the ticks are larger than the operand. This is useful when one needs to apply different formats to large numbers (eg. use scientific formats if the axis range exceed certain values).
">="Test if the maximum absolute value of the ticks is larger than or equal to the operand.
"<"Test if the maximum absolute value of the ticks is less than the operand.
"<="Test if the maximum absolute value of the ticks is less than or equal to the operand.
"=="Test if the maximum absolute value of the ticks is equal to the operand.
"="Same as "==" above.
"!="Test if the maximum absolute value of the ticks is not equal to the operand.
"<>"Same as "!=" above.
"else"This condition is true if and only if the previous condition is false.
"true"This condition is always true. It is useful as a "catch all" condition.
"false"This condition is always false.

ParameterDefaultDescription
condition(Mandatory)The type of condition to test. Must be one of the condition types in the above table. This text string is case sensitive.
operand0The operand for condition types that need an operand.

Feedback, Comments & Corrections

Next items

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





Links
MBS Xojo Chart Plugins