Read Chart Subtitle from ODS File
Contents
[
Hide
]
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(GetChartSubTitleForODSFile.class) + "Charts/"; | |
String filePath = dataDir + "SampleChart.ods"; | |
Workbook workbook = new Workbook(filePath); | |
Worksheet worksheet = workbook.getWorksheets().get(0); | |
// Load the chart from source worksheet | |
Chart chart = worksheet.getCharts().get(0); | |
System.out.println("Chart Subtitle: " + chart.getSubTitle().getText()); |
Console Output
Chart Subtitle: Sample Chart Subtitle