从ODS文件中读取图表副标题
Contents
[
Hide
]
从ODS文件中读取图表副标题
Aspose.Cells通过使用Chart.SubTitle属性为您提供了读取ODS文件中图表副标题的能力。以下示例代码加载了sample ODS file,使用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-.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