Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ChartObject.Font Property

Allows you to change the text font for all chart elements.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v24.2.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

ShapeTextFont Font { get; }

#Property Value

Type Description
ShapeTextFont

A ShapeTextFont object containing font settings.

#Remarks

The following code changes all fonts used in the chart to Segoe Script, Bold, Navy.

View Example

Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet["B2:D4"]);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];

// Set the chart font.
chart.Font.Name = "Segoe Script";
chart.Font.Bold = true;
chart.Font.Color = Color.Navy;

ChartFont

See Also