Specifies the title of a given axis.

object->SetAxisTitle( int axis_number, string title )

Arguments

object
Required. A Chart object.
axis_number
Required. An integer value that specifies the axis (see table below).
title
Required. A string that specifies the title.

Remarks

By default, none of the axis of a new chart has title.

The axis is defined by an integer value (the axis_number parameter) which is interpreted as follows:

Code Definition
0
Horizontal Axis
1
Vertical Axis
2
Secondary Horizontal Axis
3
Secondary Vertical Axis

PHP Sample Code

The following PHP code illustrates use of the SetAxisTitle method.

// Create the chart series
$categories= array();
$values= array();

$categories[0] = "Jan";
$categories[1] = "Feb";
$categories[2] = "Mar";

$values[0] = 10;
$values[1] = 20;
$values[2] = 30;

$chart->SetCategoriesFromArray( $categories );

$chart->SetSeriesValuesFromArray( 0, $values );

// Set the chart title
$chart->SetTitle( "My Chart" );

// Set the horizontal axis title
$chart->SetAxisTitle( 0, "Months" );

// Set the vertical axis title
$chart->SetAxisTitle( 1, "Values in million" );

// Set the graphics settings from a style file
$chart->LoadStyle( "C:\\myStyle.scs" );

// The chart is complete, we can now generate the movie
$chart->ExportAsResponse();

See Also

GetAxisTitle Method

Applies To: Chart Object