Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items Next items

CDArrayMBS.movCorr(interval as Integer, value() 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: Replaces each element of the CDArrayMBS object by the moving correlation with another array or with itself.
Notes:
The interval parameter specifies the window size for computing moving correlation. The moving correlation is computed as the correlation coefficient between the CDArrayMBS object and the other array, where only the current element and the previous (interval - 1) elements are considered in the computation.

If the other array is not provided, it is assumed to be the sequence of numbers 0, 1, 2, 3, 4.... This is equivalent to checking if the elements of the CDArrayMBS object is linear.

No moving correlation can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with kNoValue.

interval(Mandatory)The window size.b[Empty_Array]The array to be correlated with the CDArrayMBS object. If this argument is an empty array, the sequence of numbers 0, 1, 2, 3, 4 .... will be used instead.

Feedback, Comments & Corrections

CDArrayMBS.movMax(interval 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: Replaces each element of the CDArrayMBS object by its moving maximum.
Notes:
The interval parameter specifies the window size for computing moving average. The moving average is computed as the maximum of the current element with the previous (interval - 1) elements. No moving maximum can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with kNoValue.

ParameterDefaultDescription
interval(Mandatory)The window size.

Feedback, Comments & Corrections

CDArrayMBS.movMed(interval 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: Replaces each element of the CDArrayMBS object by its moving median.
Notes:
The interval parameter specifies the window size for computing moving average. The moving average is computed as the median of the current element with the previous (interval - 1) elements. No moving median can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with kNoValue.

ParameterDefaultDescription
interval(Mandatory)The window size.

Feedback, Comments & Corrections

CDArrayMBS.movMin(interval 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: Replaces each element of the CDArrayMBS object by its moving minimum.
Notes:
The interval parameter specifies the window size for computing moving average. The moving average is computed as the minimum of the current element with the previous (interval - 1) elements. No moving minimum can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with kNoValue.

ParameterDefaultDescription
interval(Mandatory)The window size.

Feedback, Comments & Corrections

CDArrayMBS.movPercentile(interval as Integer, percentile 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: Replaces each element of the CDArrayMBS object by its moving percentile.
Notes:
The interval parameter specifies the window size for computing moving average. The moving average is computed as the percentile of the current element with the previous (interval - 1) elements. No moving percentile can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with kNoValue.

ParameterDefaultDescription
interval(Mandatory)The window size.
percentile(Mandatory)The percentile to be computed. It should be between 0 - 100.

Feedback, Comments & Corrections

CDArrayMBS.movStdDev(interval 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: Replaces each element of the CDArrayMBS object by its moving standard deviation.
Notes:
The interval parameter specifies the window size for computing moving average. The moving average is computed as the standard deviation of the current element with the previous (interval - 1) elements. No moving standard deviation can be computed for the first (interval - 1) elements, because there are insufficient previous elements. So the first (interval - 1) elements will be replaced with kNoValue.

ParameterDefaultDescription
interval(Mandatory)The window size.

Feedback, Comments & Corrections

CDArrayMBS.mulArray(value as CDArrayMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 16.3 Yes Yes Yes Yes No
Function: Multiplies an array to the CDArrayMBS object.
Notes:
The array will be multiplied by multiplying each array element with the corresponding element of the CDArrayMBS object.

ParameterDefaultDescription
Values(Mandatory)A CDArrayMBS with numbers to be multiplied to the CDArrayMBS object.

See also:

Feedback, Comments & Corrections

CDArrayMBS.mulArray(value() 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: Multiplies an array to the CDArrayMBS object.
Example:
dim src(-1) as Double = Array( 63.1, 10.15, 6.15, 2.88 )
dim data As New CDArrayMBS(array(2.0, 2.0, 2.0, 2.0))

data.mulArray( src )

dim lines(-1) as string

lines.Append str(data.count)+" values:"
lines.Append ""
lines.Append str(Data.getvalue(0))
lines.Append str(Data.getvalue(1))
lines.Append str(Data.getvalue(2))
lines.Append str(Data.getvalue(3))

MsgBox Join(lines,EndOfLine)
Notes:
The array will be multiplied by multiplying each array element with the corresponding element of the CDArrayMBS object.

ParameterDefaultDescription
b(Mandatory)An array of numbers to be multiplied to the CDArrayMBS object.

See also:

Feedback, Comments & Corrections

CDArrayMBS.mulValue(value 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: Multiplies a number to every element of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))

data.mulValue(5)

dim lines(-1) as string

lines.Append str(data.count)+" values:"
lines.Append ""
lines.Append str(Data.getvalue(0))
lines.Append str(Data.getvalue(1))
lines.Append str(Data.getvalue(2))
lines.Append str(Data.getvalue(3))

MsgBox Join(lines,EndOfLine)
Notes:
ParameterDefaultDescription
b(Mandatory)A number to be multiplied to every element of the CDArrayMBS object.

Feedback, Comments & Corrections

CDArrayMBS.percentile(p 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 required percentile value of the elements of the CDArrayMBS object.
Notes:
ParameterDefaultDescription
p(Mandatory)The percentile to get. It should be between 0 - 100.

Feedback, Comments & Corrections

CDArrayMBS.rate(offset 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: Divides each element of the CDArrayMBS object by an earlier element in the same CDArrayMBS object.
Notes:
ParameterDefaultDescription
offset1The difference in position between an element and the earlier element to divide it.

Feedback, Comments & Corrections

CDArrayMBS.replace(a as Double, b 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: Finds elements that are equal to a given value and replace it with another value.
Notes:
ParameterDefaultDescription
a(Mandatory)The value to be replaced.
b(Mandatory)The replacing value.

Feedback, Comments & Corrections

CDArrayMBS.result as memoryblock
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 content of the CDArrayMBS object as a memoryblock.

Feedback, Comments & Corrections

CDArrayMBS.selectEQZ
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is equal to zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectEQZ(decisionArray() as Double, fillValue 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: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is equal to zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectGEZ
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is greater than or equal to zero.
Notes:
If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectGEZ(decisionArray() as Double, fillValue 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: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is greater than or equal to zero.
Notes:
If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectGTZ
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is greater than zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectGTZ(decisionArray() as Double, fillValue 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: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is greater than zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectLEZ
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is less than or equal to zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectLEZ(decisionArray() as Double, fillValue 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: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is less than or equal to zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectLTZ
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is less than zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectLTZ(decisionArray() as Double, fillValue 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: Selects the elements of the CDArrayMBS object by checking if the elements of the given decisionArray is less than zero.
Notes:
The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.

If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectNEZ
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.
Notes:
If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectNEZ(decisionArray() as Double, fillValue 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: The selected elements will be left unchanged. The remaining elements will be replaced by the given fillValue.
Notes:
If the decisionArray is empty, the CDArrayMBS object itself will function as the decision array.

ParameterDefaultDescription
decisionArray[Empty_Array]An array of numbers used to decide whether the corresponding elements in the CDArrayMBS object is selected or not.
fillValue0The value used to replace the elements that are not selected.

See also:

Feedback, Comments & Corrections

CDArrayMBS.selectRegularSpacing(majorTickStep as Integer, minorTickStep as Integer = 0, initialMargin as Integer = 0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects an evenly spaced subset of elements of the CDArrayMBS object.
Notes:
The primary purpose of this method is to select the regularly spaced elements as ticks on an enumerated axis.

For example, if the majorTickStep is 10, and minorTickStep is 5, this method will select one out of 10 elements as major tick elements, and one of out of 5 elements as minor tick elements.

Major tick elements will remain intact. The remaining minor ticks elements will have their values replaced with MinorTickOnly. Non-selected elements will have their values replaced with kNoValue, so they will not appear on the axis. The resulting array can be used directly in Axis.setLabels.

ParameterDefaultDescription
majorTickStep(Mandatory)The spacing between major ticks.
minorTickStep0The spacing between minor ticks. The default value of 0 means no minor tick will be used.
initialMargin0The position of the first tick.

Feedback, Comments & Corrections

CDArrayMBS.selectStartOfDay(majorTickStep as Integer = 1, initialMargin as Double = 10800.0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object that represents a different day from the previous element.
Notes:
This method assumes the elements of the CDArrayMBS object are dates/times.

The primary purpose of this method is to select the appropriate elements as ticks on an enumerated axis.

Suppose you want to plot a variable against time. The x-values of the data points will be an array of dates/times. If an enumerated x-axis is used (see
Axis.setLabels), there will be a tick at every data point, which may be too dense if there are too many data points.

This method can be used to reduce the ticks to one tick per day (or one tick per multiple days). This is by selecting the dates/times in the data array only if it is not the same day as the previous element in the array. The selected elements will be left unchanged, while the elements not select will be replaced by kNoValue. The resulting array can be used directly in Axis.setLabels.

For the first data point, there is no previous data point to compare, so it is handled differently. The first data point will be selected if it is near the beginning of the day it represents. By default, near means within 3 hours (10800 seconds). This is configurable using the initialMargin argument.

Note that if the data points does not have data in a certain time range, no element can be selected in that time range, and so there will be no tick for that time range. This is appropriate for many chart types, such as finance charts, in which missing time ranges (non-trading hours, holidays, etc) are traditionally skipped.

However, if the data points may contain missing time ranges, but the ticks cannot be skipped, it may be more appropriate to use a non-enumerated x-axis by using Layer.setXData and Axis.setDateScale.

ParameterDefaultDescription
majorTickStep1The tick step. The default value of 1 means one tick per day. A value of n means one tick per n days.
initialMargin10800The margin for the first data point. The first data point will be selected if it is within initialMargin number of seconds from beginning of the day it represents. The default is 3 hours (10800 seconds).

Feedback, Comments & Corrections

CDArrayMBS.selectStartOfHour(majorTickStep as Integer = 1, initialMargin as Double = 300.0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object that represents a different hour from the previous element.
Notes:
This method assumes the elements of the CDArrayMBS object are dates/times.

The primary purpose of this method is to select the appropriate elements as ticks on an enumerated axis.

Suppose you want to plot a variable against time. The x-values of the data points will be an array of dates/times. If an enumerated x-axis is used (see
Axis.setLabels), there will be a tick at every data point, which may be too dense if there are too many data points.

This method can be used to reduce the ticks to one tick per hour (or one tick per multiple hours). This is by selecting the dates/times in the data array only if it is not the same hour as the previous element in the array. The selected elements will be left unchanged, while the elements not select will be replaced by kNoValue. The resulting array can be used directly in Axis.setLabels2.

For the first data point, there is no previous data point to compare, so it is handled differently. The first data point will be selected if it is near the beginning of the hour it represents. By default, near means within 300 seconds. This is configurable using the initialMargin argument.

Note that if the data points does not have data in a certain time range, no element can be selected in that time range, and so there will be no tick for that time range. This is appropriate for many chart types, such as finance charts, in which missing time ranges (non-trading hours, holidays, etc) are traditionally skipped.

However, if the data points may contain missing time ranges, but the ticks cannot be skipped, it may be more appropriate to use a non-enumerated x-axis by using Layer.setXData and Axis.setDateScale.

ParameterDefaultDescription
majorTickStep1The tick step. The default value of 1 means one tick per hour. A value of n means one tick per n hours.
initialMargin300The margin for the first data point. The first data point will be selected if it is within initialMargin number of seconds from beginning of the hour it represents. The default is 300 seconds.

Feedback, Comments & Corrections

CDArrayMBS.selectStartOfMinute(majorTickStep as Integer = 1, initialMargin as Double = 5.0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 15.1 Yes Yes Yes Yes No
Function: Selects the elements of the array that represents a different minute from the previous element.
Notes:
This method assumes the elements of the ArrayMath object are dates/times.

The primary purpose of this method is to select the appropriate elements as ticks on an enumerated axis.

Suppose you want to plot a variable against time. The x-values of the data points will be an array of dates/times. If an enumerated x-axis is used (see CDAxisMBS.setLabels), there will be a tick at every data point, which may be too dense if there are too many data points.

This method can be used to reduce the ticks to one tick per minute (or one tick per multiple minutes). This is by selecting the dates/times in the data array only if it is not the same minute as the previous element in the array. The selected elements will be left unchanged, while the elements not select will be replaced by kNoValue. The resulting array can be used directly in CDAxisMBS.setLabels2.

For the first data point, there is no previous data point to compare, so it is handled differently. The first data point will be selected if it is near the beginning of the minute it represents. By default, near means within 5 seconds. This is configurable using the initialMargin argument.

Note that if the data points does not have data in a certain time range, no element can be selected in that time range, and so there will be no tick for that time range. This is appropriate for many chart types, such as finance charts, in which missing time ranges (non-trading hours, holidays, etc) are traditionally skipped.

However, if the data points may contain missing time ranges, but the ticks cannot be skipped, it may be more appropriate to use a non-enumerated x-axis by using CDLayerMBS.setXData and CDAxisMBS.setDateScale3 (or CDAxisMBS.setDateScale or CDAxisMBS.setDateScale2).

ArgumentDefaultDescription
majorTickStep1The tick step. A value of n means one tick per n minutes.
initialMargin5The margin for the first data point. The first data point will be selected if it is within initialMargin number of seconds from beginning of the minute it represents. The default is 5 seconds.

Feedback, Comments & Corrections

CDArrayMBS.selectStartOfMonth(majorTickStep as Integer = 1, initialMargin as Double = 432000.0)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 8.2 Yes Yes Yes Yes No
Function: Selects the elements of the CDArrayMBS object that represents a different month from the previous element.
Notes:
This method assumes the elements of the CDArrayMBS object are dates/times.

The primary purpose of this method is to select the appropriate elements as ticks on an enumerated axis.

Suppose you want to plot a variable against time. The x-values of the data points will be an array of dates/times. If an enumerated x-axis is used (see
Axis.setLabels), there will be a tick at every data point, which may be too dense if there are too many data points.

This method can be used to reduce the ticks to one tick per month (or one tick per multiple months). This is by selecting the dates/times in the data array only if it is not the same month as the previous element in the array. The selected elements will be left unchanged, while the elements not select will be replaced by kNoValue. The resulting array can be used directly in
Axis.setLabels.

For the first data point, there is no previous data point to compare, so it is handled differently. The first data point will be selected if it is near the beginning of the month it represents. By default, near means within 5 days (432000 seconds). This is configurable using the initialMargin argument.

Note that if the data points does not have data in a certain time range, no element can be selected in that time range, and so there will be no tick for that time range. This is appropriate for many chart types, such as finance charts, in which missing time ranges (non-trading hours, holidays, etc) are traditionally skipped.

However, if the data points may contain missing time ranges, but the ticks cannot be skipped, it may be more appropriate to use a non-enumerated x-axis by using Layer.setXData and Axis.setDateScale.

ParameterDefaultDescription
majorTickStep1The tick step. The default value of 1 means one tick per month. A value of n means one tick per n months.
initialMargin432000The margin for the first data point. The first data point will be selected if it is within initialMargin number of seconds from beginning of the month it represents. The default is 5 days (432000 seconds).

Feedback, Comments & Corrections

Previous items Next items

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





Links
MBS Xojo Plugins