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
>>> chart = pyvista.ChartPie([5, 4, 3, 2, 1])
>>> chart.plot.labels = ["A", "B", "C", "D", "E"]
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/62423a5af0b8f8458ea1de0f7b126b25902a4eb1/ab9fb/_images/pyvista-chartpie-legend_visible-1_00_00.png

Hide the legend.

>>> chart.legend_visible = False
>>> chart.show()
https://d33wubrfki0l68.cloudfront.net/4adacc71a4ea681526cc6b445cf723826b6d4e3d/72d14/_images/pyvista-chartpie-legend_visible-1_01_00.png