ODSファイルからチャートサブタイトルを読む
Contents
[
Hide
]
ODSファイルからチャートサブタイトルを読む
Aspose.Cells for Python via .NETは、Chart.sub_title プロパティを使用してODSファイルのチャートサブタイトルを読み取ることができます。以下のサンプルコードは、サンプルODSファイルを読み込み、Chart.sub_title プロパティを使用してチャートのサブタイトルを取得し、コンソールに表示します。コードの出力例を参考にしてください。
サンプルコード
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
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) |
コンソール出力
Chart Subtitle: Sample Chart Subtitle