Read Chart Subtitle from ODS File

Read Chart Subtitle from ODS File

Aspose.Cells provides you with the ability to read chart subtitles in ODS files by using the Chart.SubTitle property. The following sample code loads the sample ODS file and reads the chart subtitle using Chart.SubTitle property and prints it in the Console Window. Please see the console output of the code given below for reference.

Sample Code

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
//Source directory
string sourceDir = RunExamples.Get_SourceDirectory();
// Load excel file containing charts
Workbook workbook = new Workbook(sourceDir + "SampleChart.ods");
// Access first worksheet
Worksheet worksheet = workbook.Worksheets[0];
// Access first chart inside the worksheet
Chart chart = worksheet.Charts[0];
Console.WriteLine("Chart Subtitle: " + chart.SubTitle.Text);

Console Output

Chart Subtitle: Sample Chart Subtitle