Read Chart Subtitle from ODS File

Read Chart Subtitle from ODS File

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

Sample Code

from aspose.cells import Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# Source directory
sourceDir = RunExamples.Get_SourceDirectory()
# Load excel file containing charts
workbook = Workbook(sourceDir + "SampleChart.ods")
# Access first worksheet
worksheet = workbook.worksheets[0]
# Access first chart inside the worksheet
chart = worksheet.charts[0]
print("Chart Subtitle: " + chart.sub_title.text)

Console Output

Chart Subtitle: Sample Chart Subtitle