font property

ChartLegend.font property

Provides access to the default font formatting of legend entries. To override the font formatting for a specific legend entry, use theChartLegendEntry.font property.

@property
def font(self) -> aspose.words.Font:
    ...

Examples

Shows how to work with a legend font.

doc = Document(MY_DIR + "Reporting engine template - Chart series.docx")
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
chart = shape.chart

chart_legend = chart.legend
# Set default font size all legend entries.
chart_legend.font.size = 14
# Change font for specific legend entry.
chart_legend.legend_entries[1].font.italic = True
chart_legend.legend_entries[1].font.size = 12

doc.save(ARTIFACTS_DIR + "Charts.LegendFont.docx")

See Also