チャートの操作 -- Aspose.Slides FOSS for Python
Aspose.Slides FOSS for Python は、チャートを操作するためのクラスを提供します。
概要
関係する主要なクラスは次のとおりです:
ChartChartSeriesChartSeriesCollectionChartSeriesGroupChartSeriesGroupCollection
はじめに
Aspose.Slides FOSS を Python 用にインストール:
pip install aspose-slides-foss基本的な使用方法
import aspose.slides_foss as slides
from aspose.slides_foss.charts import ChartType
from aspose.slides_foss.export import SaveFormat
with slides.Presentation() as prs:
slide = prs.slides[0]
chart = slide.shapes.add_chart(ChartType.CLUSTERED_COLUMN, 100, 100, 500, 400)
# add_chart() seeds the chart with sample series/category data
series = chart.chart_data.series[0]
print(f"Series: {series.name.as_literal_string}, {len(series.data_points)} point(s)")
prs.save("chart.pptx", SaveFormat.PPTX)ヒントとベストプラクティス
- 使用後は常にドキュメントオブジェクトを破棄してください
- ファイルの読み書き時に file I/O 例外を処理してください
- 確認してください API reference 最新の署名を
API Reference 概要
| クラス | 説明 |
|---|---|
Chart | リファレンスドキュメントを参照してください |
ChartSeries | リファレンスドキュメントを参照してください |
ChartSeriesCollection | リファレンスドキュメントをご覧ください |
ChartSeriesGroup | リファレンスドキュメントをご覧ください |
ChartSeriesGroupCollection | リファレンスドキュメントをご覧ください |
詳細については、こちらをご覧ください API Reference.