2.2.4.1.2 Axis::AxisObjects

Description

Get a AxisObject from the Axis. The object is referred to by index.

Syntax

AxisObject AxisObjects( int nIndex )

Parameters

nIndex
Index indicating which object is, valid value are as follows:
typedef enum tagAXISOBJECT
{
AXISOBJPOS_MINOR_GRID = 0, // 0
AXISOBJPOS_MAJOR_GRID, // 1
AXISOBJPOS_LABEL_FIRST, // 2
AXISOBJPOS_AXIS_FIRST, // 3
AXISOBJPOS_LABEL_SECOND, // 4
AXISOBJPOS_AXIS_SECOND, // 5
AXISOBJ_TOTAL_NUM,
} AXISOBJECT;

Return

Examples

///////////////////////////////////////////////////////
// set X axis bottom ticks show
void set_x_axis_bottom_ticks_show(bool bShow=true)
{
	GraphLayer gl = Project.ActiveLayer();
	gl.XAxis.AxisObjects(AXISOBJPOS_AXIS_FIRST).BottomTicks.Show.nVal = bShow;
}

///////////////////////////////////////////////////////
// set X axis top ticks show
void set_x_axis_top_ticks_show(bool bShow=true)
{
	GraphLayer gl = Project.ActiveLayer();
	gl.XAxis.AxisObjects(AXISOBJPOS_AXIS_SECOND).TopTicks.Show.nVal = bShow;
}

///////////////////////////////////////////////////////
// set Y axis right labels show
void set_y_axis_right_labels_show(bool bShow=true)
{
	GraphLayer gl = Project.ActiveLayer();
	gl.YAxis.AxisObjects(AXISOBJPOS_LABEL_SECOND).RightLabels.Show.nVal = bShow;
}

///////////////////////////////////////////////////////
// nPos = 
//	0, // default
//	1, // percent
//	2, // real (scale)
// dVal is used to specify a specific percent or real position
void set_left_axis_position(int nPos, double dVal)
{
	GraphLayer gl = Project.ActiveLayer();
	gl.YAxis.AxisObjects(AXISOBJPOS_AXIS_FIRST).LeftTicks.Position.nVal = nPos;
	
	if( nPos > 0 )
		gl.YAxis.AxisObjects(AXISOBJPOS_AXIS_FIRST).LeftTicks.Offset.dVal = dVal;
}

void set_top_axis_color(int nColor)
{
	GraphLayer gl = Project.ActiveLayer();
	gl.XAxis.AxisObjects(AXISOBJPOS_AXIS_SECOND).TopTicks.Color.nVal = nColor;
}

int get_bottom_axis_color()
{
	GraphLayer gl = Project.ActiveLayer();
	return gl.XAxis.AxisObjects(AXISOBJPOS_AXIS_FIRST).BottomTicks.Color.nVal;
}

Remark

See Also

Header to Include

origin.h