Specifies the title of a given axis.

object.SetAxisTitle( axis_number, 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

JScript Sample Code

The following JScript code illustrates use of the SetAxisTitle method.

//Create the chart series
var categories= new Array(3);
var values= new Array(3);

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

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

chart.SetCategoriesFromArray( categories );

chart.AddSeries();
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