Share via


ChartSheetBase.ChartTitle Property

Definition

Gets a ChartTitle that represents the title of the specified ChartSheetBase.

public:
 property Microsoft::Office::Interop::Excel::ChartTitle ^ ChartTitle { Microsoft::Office::Interop::Excel::ChartTitle ^ get(); };
public Microsoft.Office.Interop.Excel.ChartTitle ChartTitle { get; }
member this.ChartTitle : Microsoft.Office.Interop.Excel.ChartTitle
Public ReadOnly Property ChartTitle As ChartTitle

Property Value

A ChartTitle that represents the title of the specified ChartSheetBase.

Examples

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);
}
Private Sub SetTitleColor()
    Globals.Sheet1.Range("A1", "A5").Value2 = 22
    Globals.Sheet1.Range("B1", "B5").Value2 = 55

    Me.ChartWizard(Globals.Sheet1.Range("A1", "B5"), _
        Excel.XlChartType.xl3DColumn, PlotBy:=Excel.XlRowCol.xlColumns, _
        HasLegend:=False, Title:="Revised chart")

    Me.ChartTitle.Font.Color = _
            ColorTranslator.ToOle(Color.Green)
End Sub

Applies to