# Chart Title

Using DsExcel, you can easily set the formula for the chart title, set format for the chart title and font style, and set text angle for chart title.

## Content

In DsExcel .NET, you can use the properties of the [IChart Interface](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Drawing.IChart.html) to set up the chart title as per your choice. When working with chart title, you can perform the following tasks:

* [Set Formula for Chart Title](/document-solutions/dot-net-excel-api/docs/online/Features/UseChart/ConfigureChart/ChartTitle#set-formula-for-chart-title)
* [Set Format for Chart Title and Font Style](/document-solutions/dot-net-excel-api/docs/online/Features/UseChart/ConfigureChart/ChartTitle#set-format-for-chart-title-and-font-style)
* [Set Direction of Chart Title](/document-solutions/dot-net-excel-api/docs/online/Features/UseChart/ConfigureChart/ChartTitle#set-direction-of-chart-title)
* [Set Text Angle for Chart Title](/document-solutions/dot-net-excel-api/docs/online/Features/UseChart/ConfigureChart/ChartTitle#set-text-angle-for-chart-title)

## Set Formula for Chart Title

Refer to the following example code to set formula for chart title.

```csharp
//Set formula for chart title.
shape.Chart.HasTitle = true;
shape.Chart.ChartTitle.Formula = "=Sheet1!$E$1";
worksheet.Range["E1"].Value = "Sample Chart";
```

## Set Format for Chart Title and Font Style

Refer to the following example code to set format for chart title and font style.

```csharp
//Set chart title's format and font style.
shape.Chart.HasTitle = true;
//shape.Chart.ChartTitle.Text = "aaaaa";
shape.Chart.ChartTitle.Font.Bold = true;
shape.Chart.ChartTitle.Format.Fill.Color.RGB = Color.Red;
shape.Chart.ChartTitle.Format.Line.Color.RGB = Color.Blue;
```

## Set Direction of Chart Title

You can set the direction of the chart title to horizontal, vertical, rotated (to 90 or 270 degree), and stacked (with text reading left-to-right or right to left). The **Direction** property in [IChartTitle](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Drawing.IChartTitle.html) and IChartTitle.[ITextFrame](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Drawing.ITextFrame.html) interfaces allows you to set the direction of the chart title using [TextDirection](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Drawing.TextDirection.html) enumeration.
Refer to the following example code to set vertical chart title:

```csharp
// Create chart.
shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], RowCol.Columns, true, true);

// Display the chart title.
shape.Chart.HasTitle = true;

// Set the chart title name.
shape.Chart.ChartTitle.Text = "Chart Title";

// Set the direction of chart title to vertical.
shape.Chart.ChartTitle.TextFrame.Direction = TextDirection.Vertical;

// OR
shape.Chart.ChartTitle.Direction = TextDirection.Vertical;
```

## Set Text Angle for Chart Title

You can also set the text angle for chart title by using the [Orientation](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Drawing.IChartTitle.Orientation.html) property of [IChartTitle](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.Drawing.IChartTitle.html) interface.
Refer to the following example code to set text angle for chart title.

```csharp
//add chart title
shape.Chart.HasTitle = true;
shape.Chart.ChartTitle.Text = "MyChartTitle";

//config chart title angle
shape.Chart.ChartTitle.Orientation = 30;
```

> !type=note
> **Note:** The Orientation property only applies if the value of Direction property is Horizontal. However, the direction and orientation of the chart title can be exported or imported into a JSON file.