Axis addOption

From Catglobe Wiki
Jump to: navigation, search



Axis_addOption

Adds an axis option to the end of the array containing the axis options in the axis passed as argument to the method, and returns its index in the option list.

Syntax

Axis_addOption(axis, axisOption)

Arguments

axis: Is an axis array created by Axis_new function.

axisOption: Is an axis option array, created by AxisOption_new function.

Return type

Number

Examples

array axis = Axis_new("Age groups");

axis[AXIS_TEXT] = "Choose an age group";

axis[AXIS_MATH_BASE] = "Age";

axis[AXIS_PCT_BASE] = "Age != empty";

number index1 = Axis_addOption(axis, AxisOption_new("Under 18", "Age < 18"));

number index2 = Axis_addOption(axis, AxisOption_new("18 - 29", "Age == [18-29]"));

print(index1); //Result: 0

print(index2); //Result: 1

Availability

Version 5.5