pyvista.ChartPie.legend_visible#

property ChartPie.legend_visible[source]#

Return or set the visibility of the chart’s legend.

Examples

Create a pie chart with custom labels.

>>> import pyvista as pv
>>> chart = pv.ChartPie([5, 4, 3, 2, 1])
>>> chart.plot.labels = ["A", "B", "C", "D", "E"]
>>> chart.show()
../../../../_images/pyvista-ChartPie-legend_visible-2_00_00.png

Hide the legend.

>>> chart.legend_visible = False
>>> chart.show()
../../../../_images/pyvista-ChartPie-legend_visible-2_01_00.png