Excel.ChartAxisTitle class

Represents the title of a chart axis.

[ API set: ExcelApi 1.1 ]

Extends
OfficeExtension.ClientObject

Properties

format

Represents the formatting of chart axis title. Read-only.

[ API set: ExcelApi 1.1 ]

text

Represents the axis title.

[ API set: ExcelApi 1.1 ]

visible

A boolean that specifies the visibility of an axis title.

[ API set: ExcelApi 1.1 ]

Methods

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

setFormula(formula)

A string value that represents the formula of chart axis title using A1-style notation.

[ API set: ExcelApi 1.8 ]

toJSON()

Property Details

format

Represents the formatting of chart axis title. Read-only.

[ API set: ExcelApi 1.1 ]

readonly format: Excel.ChartAxisTitleFormat;
Property Value

text

Represents the axis title.

[ API set: ExcelApi 1.1 ]

text: string;
Property Value
string

visible

A boolean that specifies the visibility of an axis title.

[ API set: ExcelApi 1.1 ]

visible: boolean;
Property Value
boolean

Method Details

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

load(option?: string | string[]): Excel.ChartAxisTitle;
Parameters
option
string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns
Remarks

In addition to this signature, this method has the following signatures:

load(option?: { select?: string; expand?: string; }): Excel.ChartAxisTitle - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load.

load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Excel.ChartAxisTitle - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items.

Examples

// Get the text of Chart Axis Title from the value axis of Chart1.
Excel.run(function (ctx) { 
    var chart = ctx.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1"); 
    var title = chart.axes.valueAxis.title;
    title.load('text');
    return ctx.sync().then(function() {
            console.log(title.text);
    });
}).catch(function(error) {
        console.log("Error: " + error);
        if (error instanceof OfficeExtension.Error) {
            console.log("Debug info: " + JSON.stringify(error.debugInfo));
        }
});
// Add "Values" as the title for the value Axis 
Excel.run(function (ctx) { 
    var chart = ctx.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1"); 
    chart.axes.valueAxis.title.text = "Values";
    return ctx.sync().then(function() {
            console.log("Axis Title Added ");
    });
}).catch(function(error) {
        console.log("Error: " + error);
        if (error instanceof OfficeExtension.Error) {
            console.log("Debug info: " + JSON.stringify(error.debugInfo));
        }
});

setFormula(formula)

A string value that represents the formula of chart axis title using A1-style notation.

[ API set: ExcelApi 1.8 ]

setFormula(formula: string): void;
Parameters
formula
string

a string that present the formula to set

Returns
void

toJSON()

toJSON(): Excel.Interfaces.ChartAxisTitleData;
Returns