ODS ファイルからチャート サブタイトルを読み取る
Contents
[
Hide
]
ODS ファイルからチャート サブタイトルを読み取る
Aspose.Cells を使用すると、ODS ファイルのチャート サブタイトルを読み取ることができます。Chart.SubTitle財産。次のサンプル コードは、サンプル ODS ファイルを使用してチャートのサブタイトルを読み取りますChart.SubTitleプロパティを取得し、コンソール ウィンドウに出力します。以下のコードのコンソール出力を参照してください。
サンプルコード
This file contains 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()); |
コンソール出力
Chart Subtitle: Sample Chart Subtitle