Xojo Conferences
MBSSep2018MunichDE
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

Previous items

CDArrayMBS.selectStartOfSecond(majorTickStep as Integer = 1, initialMargin as Double = 0.1)
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 ArrayMath object that represents a different second 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 second (or one tick per multiple seconds). This is by selecting the dates/times in the data array only if it is not the same second as the previous element in the array. The selected elements will be left unchanged, while the elements not select will be replaced by NoValue. 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 second it represents. By default, near means within 0.1 second. 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 seconds.
initialMargin0.1The 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 second it represents. The default is 0.1 second.

Feedback, Comments & Corrections

CDArrayMBS.selectStartOfWeek(majorTickStep as Integer = 1, initialMargin as Double = 172800.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 week 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 week (or one tick per multiple weeks). This is by selecting the dates/times in the data array only if it is not the same week 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 week it represents. By default, near means within 2 days (172800 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 week. A value of n means one tick per n weeks.
initialMargin172800The 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 week it represents. The default is 2 days (172800 seconds).

Feedback, Comments & Corrections

CDArrayMBS.selectStartOfYear(majorTickStep as Integer = 1, initialMargin as Double = 5184000.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 year 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 year (or one tick per multiple years). This is by selecting the dates/times in the data array only if it is not the same year 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 year it represents. By default, near means within 60 days (5184000 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 year. A value of n means one tick per n years.
initialMargin5184000The 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 year it represents. The default is 60 days (5184000 seconds).

Feedback, Comments & Corrections

CDArrayMBS.shift(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: Shifts the array "rightwards".
Notes:
If the array does not have any kNoValue data points, this method will shift the point at position "n" to "n + offset". On the "right" side of the array (the side with the largest index), points that are shifted outside the array will be discarded. On the "left" side of the array, fillValue data points will be shifted in.

If the array contains kNoValue data points, these points are not shifted. Conceptually, one can imagine the non-NoValue points being shifted to the next non-NoValue positions, and the process repeats
offset number of times.

ParameterDefaultDescription
offset1The number of positions to shift the array "rightwards."
fillValuekNoValueThe new value to be shifted into the array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.shift(offset as Integer, fillValue 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: Shifts the array "rightwards".
Notes:
If the array does not have any kNoValue data points, this method will shift the point at position "n" to "n + offset". On the "right" side of the array (the side with the largest index), points that are shifted outside the array will be discarded. On the "left" side of the array, fillValue data points will be shifted in.

If the array contains kNoValue data points, these points are not shifted. Conceptually, one can imagine the non-NoValue points being shifted to the next non-NoValue positions, and the process repeats
offset number of times.

ParameterDefaultDescription
offset1The number of positions to shift the array "rightwards."
fillValuekNoValueThe new value to be shifted into the array.

See also:

Feedback, Comments & Corrections

CDArrayMBS.stdDev 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 stdDev value of the elements of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))
MsgBox str(data.stdDev) // shows 1.118034

Feedback, Comments & Corrections

CDArrayMBS.subArray(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: Subtracts an array from the CDArrayMBS object.
Notes:
The array will be subtracted by subtracting each array element from the corresponding element of the CDArrayMBS object.

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

See also:

Feedback, Comments & Corrections

CDArrayMBS.subArray(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: Subtracts an array from the CDArrayMBS object.
Example:
dim src(-1) as Double = Array( 63.1, 10.15, 6.15, 2.88 )
dim data As New CDArrayMBS(array(1.0, 1.0, 1.0, 1.0))

data.subArray( 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 subtracted by subtracting each array element from the corresponding element of the CDArrayMBS object.

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

See also:

Feedback, Comments & Corrections

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

data.subValue(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 subtracted from every element of the CDArrayMBS object.

Feedback, Comments & Corrections

CDArrayMBS.sum 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 sum value of the elements of the CDArrayMBS object.
Example:
dim data As New CDArrayMBS(array(1.0, 2.0, 3.0, 4.0))
MsgBox str(data.sum) // shows 10.0

Feedback, Comments & Corrections

CDArrayMBS.trim(startIndex as Integer = 0, len 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: Trims the CDArrayMBS object by keeping only some elements in the middle.
Notes:
ParameterDefaultDescription
startIndex0The index for the first element to keep.
len-1The number of elements to keep. -1 means keeping all elements from the
startIndex to the end of the array.

Feedback, Comments & Corrections

CDArrayMBS.Values as Double()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method ChartDirector MBS ChartDirector Plugin 9.2 Yes Yes Yes Yes No
Function: Copies all the values of this array object into a REALbasic array.
Notes: On error the array returned is empty.

Feedback, Comments & Corrections

Previous items

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




Links
MBS FileMaker tutorial videos