从 ODS 文件中读取图表副标题
Contents
[
Hide
]
从 ODS 文件中读取图表副标题
Aspose.Cells 为您提供阅读 ODS 文件中图表字幕的能力图表.副标题财产。下面的示例代码加载样本 ODS 文件并使用阅读图表副标题图表.副标题属性并将其打印在控制台窗口中。请参阅下面给出的代码的控制台输出以供参考。
示例代码
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-.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); |
控制台输出
Chart Subtitle: Sample Chart Subtitle