Export (0) Print
Expand All
Expand Minimize

ChartSheetBase.ChartTitle Property

Gets a ChartTitle that represents the title of the specified Microsoft.Office.Tools.Excel.ChartSheetBase.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public ChartTitle ChartTitle { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.ChartTitle
A ChartTitle that represents the title of the specified Microsoft.Office.Tools.Excel.ChartSheetBase.

The following code example uses the ChartTitle property of the current Microsoft.Office.Tools.Excel.ChartSheetBase to modify the font color of the title.

private void SetTitleColor()
{
    Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
    Globals.Sheet1.Range["B1", "B5"].Value2 = 55;

    this.ChartWizard(Globals.Sheet1.Range["A1", "B5"],
        Excel.XlChartType.xl3DColumn,
        Excel.XlRowCol.xlColumns, false,
        "Revised chart");

    this.ChartTitle.Font.Color =
        ColorTranslator.ToOle(Color.Green);
}

Show:
© 2014 Microsoft