PieChart#
- class qf_lib.plotting.charts.pie_chart.PieChart(sort_values: bool | None = True, arrows: bool | None = True, autotext_colour: str | None = None, **plot_settings)[source]#
Bases:
ChartInitialize the pie chart plotting class.
- Parameters:
sort_values (bool) – If True (default), the data series will be sorted in ascending order before plotting.
arrows (bool) – If True (default), use arrows to point from the pie chart to the labels outside the chart. If False, labels will be placed directly on the pie chart.
autotext_colour (str or None) – Colour to apply to the automatic percentage labels displayed on the pie chart (only applies if arrows=False). If None, the default Matplotlib color is used.
**plot_settings (Dict) – Additional keyword arguments for customizing the plot appearance, such as explode, autopct, textprops, etc.
- add_decorator(decorator: ChartDecorator) None[source]#
Adds the new decorator to the chart.
Each decorator must have a unique key that also doesn’t clash with any series keys because both are used for legend label data. If there is already a decorator registered under the specified key, the operation will raise the AssertionError.
Note: In case of PieCharts it is ensured that there exists only a single DataElementDecorator and max one LegendDecorator.
- Parameters:
decorator (ChartDecorator) – decorator to be added
- apply_data_element_decorators(data_element_decorators)[source]#
Plots all DataElementDecorators added to a chart. This function should set legend_artist field in each plotted DataElementDecorator (if applicable).
- Parameters:
data_element_decorators (List[DataElementDecorator]) – non-empty list of DataElementDecorators that should be plotted on the chart