Chart class

Chart class

Provides access to the chart shape properties. To learn more, visit the Working with Charts documentation article.

Properties

NameDescription
axesGets a collection of all axes of this chart.
axis_xProvides access to properties of the primary X axis of the chart.
axis_yProvides access to properties of the primary Y axis of the chart.
axis_zProvides access to properties of the Z axis of the chart.
data_tableProvides access to properties of a data table of this chart. The data table can be shown using the ChartDataTable.show property.
formatProvides access to fill and line formatting of the chart.
legendProvides access to the chart legend properties.
seriesProvides access to series collection.
series_groupsProvides access to a series group collection of this chart.
source_full_nameGets the path and name of an xls/xlsx file this chart is linked to.
titleProvides access to the chart title properties.

Examples

Shows how to insert a chart and set a title.

doc = aw.Document()
builder = aw.DocumentBuilder(doc=doc)
# Insert a chart shape with a document builder and get its chart.
chart_shape = builder.insert_chart(chart_type=aw.drawing.charts.ChartType.BAR, width=400, height=300)
chart = chart_shape.chart
# Use the "Title" property to give our chart a title, which appears at the top center of the chart area.
title = chart.title
title.text = 'My Chart'
title.font.size = 15
title.font.color = aspose.pydrawing.Color.blue
# Set the "Show" property to "true" to make the title visible.
title.show = True
# Set the "Overlay" property to "true" Give other chart elements more room by allowing them to overlap the title
title.overlay = True
doc.save(file_name=ARTIFACTS_DIR + 'Charts.ChartTitle.docx')

See Also