Skip to content

charts

Class info

Classes

Name Children Inherits
AbstractAxis
prettyqt.charts.abstractaxis
    AbstractAxisMixin
    prettyqt.charts.abstractaxis
    AbstractBarSeries
    prettyqt.charts.abstractbarseries
      AbstractBarSeriesMixin
      prettyqt.charts.abstractbarseries
      AbstractSeries
      prettyqt.charts.abstractseries
        AbstractSeriesMixin
        prettyqt.charts.abstractseries
        BarCategoryAxis
        prettyqt.charts.barcategoryaxis
          BarSeries
          prettyqt.charts.barseries
            BarSet
            prettyqt.charts.barset
              BoxSet
              prettyqt.charts.boxset
                CandlestickSet
                prettyqt.charts.candlestickset
                  CategoryAxis
                  prettyqt.charts.categoryaxis
                    Chart
                    prettyqt.charts.chart
                      ChartMixin
                      prettyqt.charts.chart
                      ChartView
                      prettyqt.charts.chartview
                        DateTimeAxis
                        prettyqt.charts.datetimeaxis
                          HorizontalBarSeries
                          prettyqt.charts.horizontalbarseries
                            HorizontalPercentBarSeries
                            prettyqt.charts.horizontalpercentbarseries
                              HorizontalStackedBarSeries
                              prettyqt.charts.horizontalstackedbarseries
                                Legend
                                prettyqt.charts.legend
                                  LineSeries
                                  prettyqt.charts.lineseries
                                  QLineSeries with some custom properties.
                                    LogValueAxis
                                    prettyqt.charts.logvalueaxis
                                      PercentBarSeries
                                      prettyqt.charts.percentbarseries
                                        PieSlice
                                        prettyqt.charts.pieslice
                                          PolarChart
                                          prettyqt.charts.polarchart
                                            ScatterSeries
                                            prettyqt.charts.scatterseries
                                              StackedBarSeries
                                              prettyqt.charts.stackedbarseries
                                                ValueAxis
                                                prettyqt.charts.valueaxis
                                                  ValueAxisMixin
                                                  prettyqt.charts.valueaxis
                                                  XYSeries
                                                  prettyqt.charts.xyseries
                                                    XYSeriesMixin
                                                    prettyqt.charts.xyseries

                                                    🛈 DocStrings

                                                    The charts module provides a set of easy-to-use chart components.

                                                    AbstractAxisMixin

                                                    Bases: ObjectMixin, _AbstractAxisBase

                                                    Source code in prettyqt/charts/abstractaxis.py
                                                    class AbstractAxisMixin(core.ObjectMixin, _AbstractAxisBase):
                                                        def get_alignment(self) -> constants.SideStr | None:
                                                            """Return current alignment.
                                                    
                                                            Returns:
                                                                alignment
                                                            """
                                                            alignment = self.alignment()
                                                            if alignment == constants.ALIGN_NONE:
                                                                return None
                                                            return constants.SIDES.inverse[alignment]
                                                    
                                                        def get_orientation(self) -> constants.OrientationStr | None:
                                                            """Return current orientation.
                                                    
                                                            Returns:
                                                                orientation
                                                            """
                                                            orientation = self.orientation()
                                                            if orientation == constants.ORIENTATION_NONE:
                                                                return None
                                                            return constants.ORIENTATION.inverse[orientation]
                                                    
                                                        def get_grid_line_color(self) -> gui.Color:
                                                            return gui.Color(self.gridLineColor())
                                                    
                                                        def get_grid_line_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.gridLinePen())
                                                    
                                                        def get_line_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.linePen())
                                                    
                                                        def get_line_pen_color(self) -> gui.Color:
                                                            return gui.Color(self.linePenColor())
                                                    
                                                        def get_labels_color(self) -> gui.Color:
                                                            return gui.Color(self.labelsColor())
                                                    
                                                        def get_labels_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.labelsBrush())
                                                    
                                                        def get_labels_font(self) -> gui.Font:
                                                            return gui.Font(self.labelsFont())
                                                    
                                                        def get_title_font(self) -> gui.Font:
                                                            return gui.Font(self.titleFont())
                                                    
                                                        def get_title_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.titleBrush())
                                                    
                                                        def get_shades_color(self) -> gui.Color:
                                                            return gui.Color(self.shadesColor())
                                                    
                                                        def get_shades_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.shadesBrush())
                                                    
                                                        def get_shades_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.shadesPen())
                                                    
                                                        def get_shades_border_color(self) -> gui.Color:
                                                            return gui.Color(self.shadesBorderColor())
                                                    
                                                        def get_minor_grid_line_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.minorGridLinePen())
                                                    
                                                        def get_minor_grid_line_color(self) -> gui.Color:
                                                            return gui.Color(self.minorGridLineColor())
                                                    

                                                    get_alignment() -> constants.SideStr | None

                                                    Return current alignment.

                                                    Source code in prettyqt/charts/abstractaxis.py
                                                    def get_alignment(self) -> constants.SideStr | None:
                                                        """Return current alignment.
                                                    
                                                        Returns:
                                                            alignment
                                                        """
                                                        alignment = self.alignment()
                                                        if alignment == constants.ALIGN_NONE:
                                                            return None
                                                        return constants.SIDES.inverse[alignment]
                                                    

                                                    get_orientation() -> constants.OrientationStr | None

                                                    Return current orientation.

                                                    Source code in prettyqt/charts/abstractaxis.py
                                                    def get_orientation(self) -> constants.OrientationStr | None:
                                                        """Return current orientation.
                                                    
                                                        Returns:
                                                            orientation
                                                        """
                                                        orientation = self.orientation()
                                                        if orientation == constants.ORIENTATION_NONE:
                                                            return None
                                                        return constants.ORIENTATION.inverse[orientation]
                                                    

                                                    AbstractBarSeriesMixin

                                                    Bases: AbstractSeriesMixin, _AbstractBarSeriesBase

                                                    Source code in prettyqt/charts/abstractbarseries.py
                                                    class AbstractBarSeriesMixin(charts.AbstractSeriesMixin, _AbstractBarSeriesBase):
                                                        def __delitem__(self, item: int | charts.QBarSet):
                                                            """Implements `del series[0]`."""
                                                            if isinstance(item, int):
                                                                barsets = self.barSets()
                                                                item = barsets[item]
                                                            self.remove(item)
                                                    
                                                        def __getitem__(self, index: int) -> charts.QBarSet:
                                                            """Implements `barset = series[1]`."""
                                                            barsets = self.barSets()
                                                            return barsets[index]
                                                    
                                                        def set_labels_position(
                                                            self, position: LabelsPositionStr | charts.QAbstractBarSeries.LabelsPosition
                                                        ):
                                                            """Set the labels position.
                                                    
                                                            Args:
                                                                position: Labels position
                                                            """
                                                            self.setLabelsPosition(LABELS_POSITIONS.get_enum_value(position))
                                                    
                                                        def get_labels_position(self) -> LabelsPositionStr:
                                                            """Return current labels position.
                                                    
                                                            Returns:
                                                                Labels position
                                                            """
                                                            return LABELS_POSITIONS.inverse[self.labelsPosition()]
                                                    

                                                    __delitem__(item: int | charts.QBarSet)

                                                    Implements del series[0].

                                                    Source code in prettyqt/charts/abstractbarseries.py
                                                    def __delitem__(self, item: int | charts.QBarSet):
                                                        """Implements `del series[0]`."""
                                                        if isinstance(item, int):
                                                            barsets = self.barSets()
                                                            item = barsets[item]
                                                        self.remove(item)
                                                    

                                                    __getitem__(index: int) -> charts.QBarSet

                                                    Implements barset = series[1].

                                                    Source code in prettyqt/charts/abstractbarseries.py
                                                    def __getitem__(self, index: int) -> charts.QBarSet:
                                                        """Implements `barset = series[1]`."""
                                                        barsets = self.barSets()
                                                        return barsets[index]
                                                    

                                                    get_labels_position() -> LabelsPositionStr

                                                    Return current labels position.

                                                    Source code in prettyqt/charts/abstractbarseries.py
                                                    def get_labels_position(self) -> LabelsPositionStr:
                                                        """Return current labels position.
                                                    
                                                        Returns:
                                                            Labels position
                                                        """
                                                        return LABELS_POSITIONS.inverse[self.labelsPosition()]
                                                    

                                                    set_labels_position(position: LabelsPositionStr | charts.QAbstractBarSeries.LabelsPosition)

                                                    Set the labels position.

                                                    Parameters:

                                                    Name Type Description Default
                                                    position LabelsPositionStr | LabelsPosition

                                                    Labels position

                                                    required
                                                    Source code in prettyqt/charts/abstractbarseries.py
                                                    def set_labels_position(
                                                        self, position: LabelsPositionStr | charts.QAbstractBarSeries.LabelsPosition
                                                    ):
                                                        """Set the labels position.
                                                    
                                                        Args:
                                                            position: Labels position
                                                        """
                                                        self.setLabelsPosition(LABELS_POSITIONS.get_enum_value(position))
                                                    

                                                    BarCategoryAxis

                                                    Bases: AbstractAxisMixin, QBarCategoryAxis

                                                    Source code in prettyqt/charts/barcategoryaxis.py
                                                    class BarCategoryAxis(charts.AbstractAxisMixin, charts.QBarCategoryAxis):
                                                        def __delitem__(self, index: str):
                                                            """Remove category."""
                                                            self.remove(index)
                                                    
                                                        def __getitem__(self, index: int) -> str:
                                                            """Return category for given index."""
                                                            return self.categories()[index]
                                                    
                                                        def __setitem__(self, index: str, value: str):
                                                            """Set category at given index to value."""
                                                            self.replace(index, value)
                                                    
                                                        def __add__(self, other: str) -> BarCategoryAxis:
                                                            """Append another category to axis."""
                                                            self.append(other)
                                                            return self
                                                    

                                                    __add__(other: str) -> BarCategoryAxis

                                                    Append another category to axis.

                                                    Source code in prettyqt/charts/barcategoryaxis.py
                                                    def __add__(self, other: str) -> BarCategoryAxis:
                                                        """Append another category to axis."""
                                                        self.append(other)
                                                        return self
                                                    

                                                    __delitem__(index: str)

                                                    Remove category.

                                                    Source code in prettyqt/charts/barcategoryaxis.py
                                                    5
                                                    6
                                                    7
                                                    def __delitem__(self, index: str):
                                                        """Remove category."""
                                                        self.remove(index)
                                                    

                                                    __getitem__(index: int) -> str

                                                    Return category for given index.

                                                    Source code in prettyqt/charts/barcategoryaxis.py
                                                    def __getitem__(self, index: int) -> str:
                                                        """Return category for given index."""
                                                        return self.categories()[index]
                                                    

                                                    __setitem__(index: str, value: str)

                                                    Set category at given index to value.

                                                    Source code in prettyqt/charts/barcategoryaxis.py
                                                    def __setitem__(self, index: str, value: str):
                                                        """Set category at given index to value."""
                                                        self.replace(index, value)
                                                    

                                                    BarSet

                                                    Bases: ObjectMixin, QBarSet

                                                    Source code in prettyqt/charts/barset.py
                                                    class BarSet(core.ObjectMixin, QtCharts.QBarSet):
                                                        def __delitem__(self, index: int):
                                                            """Delete bar at given index."""
                                                            if not (0 <= index < self.count()):
                                                                raise KeyError(index)
                                                            self.remove(index)
                                                    
                                                        def __getitem__(self, index: int) -> float:
                                                            """Get bar from given index."""
                                                            if not (0 <= index < self.count()):
                                                                raise KeyError(index)
                                                            return self.at(index)
                                                    
                                                        def __setitem__(self, index: int, value: float):
                                                            """Set bar at given index to value."""
                                                            if not (0 <= index < self.count()):
                                                                raise KeyError(index)
                                                            self.replace(index, value)
                                                    
                                                        def __repr__(self):
                                                            return get_repr(self, self.label())
                                                    
                                                        def get_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.pen())
                                                    
                                                        def get_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.brush())
                                                    

                                                    __delitem__(index: int)

                                                    Delete bar at given index.

                                                    Source code in prettyqt/charts/barset.py
                                                    def __delitem__(self, index: int):
                                                        """Delete bar at given index."""
                                                        if not (0 <= index < self.count()):
                                                            raise KeyError(index)
                                                        self.remove(index)
                                                    

                                                    __getitem__(index: int) -> float

                                                    Get bar from given index.

                                                    Source code in prettyqt/charts/barset.py
                                                    def __getitem__(self, index: int) -> float:
                                                        """Get bar from given index."""
                                                        if not (0 <= index < self.count()):
                                                            raise KeyError(index)
                                                        return self.at(index)
                                                    

                                                    __setitem__(index: int, value: float)

                                                    Set bar at given index to value.

                                                    Source code in prettyqt/charts/barset.py
                                                    def __setitem__(self, index: int, value: float):
                                                        """Set bar at given index to value."""
                                                        if not (0 <= index < self.count()):
                                                            raise KeyError(index)
                                                        self.replace(index, value)
                                                    

                                                    BoxSet

                                                    Bases: ObjectMixin, QBoxSet

                                                    Source code in prettyqt/charts/boxset.py
                                                    class BoxSet(core.ObjectMixin, QtCharts.QBoxSet):
                                                        def __repr__(self):
                                                            return get_repr(
                                                                self,
                                                                self["lower_extreme"],
                                                                self["lower_quartile"],
                                                                self["median"],
                                                                self["upper_quartile"],
                                                                self["upper_extreme"],
                                                                self.label(),
                                                            )
                                                    
                                                        def __getitem__(
                                                            self, index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions
                                                        ) -> float:
                                                            """Returns the value of the box-and-whiskers item specified by index."""
                                                            if not isinstance(index, int):
                                                                index = VALUE_POSITION.get_enum_value(index).value
                                                            if not (0 <= index <= 4):  # noqa: PLR2004
                                                                raise KeyError(index)
                                                            return self.at(index)
                                                    
                                                        def __setitem__(
                                                            self, index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions, value: int
                                                        ):
                                                            """Sets the value specified by value in the position specified by index."""
                                                            if not isinstance(index, int):
                                                                index = VALUE_POSITION.get_enum_value(index).value
                                                            if not (0 <= index <= 4):  # noqa: PLR2004
                                                                raise KeyError(index)
                                                            self.setValue(index, value)
                                                    
                                                        def get_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.pen())
                                                    
                                                        def get_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.brush())
                                                    

                                                    __getitem__(index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions) -> float

                                                    Returns the value of the box-and-whiskers item specified by index.

                                                    Source code in prettyqt/charts/boxset.py
                                                    def __getitem__(
                                                        self, index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions
                                                    ) -> float:
                                                        """Returns the value of the box-and-whiskers item specified by index."""
                                                        if not isinstance(index, int):
                                                            index = VALUE_POSITION.get_enum_value(index).value
                                                        if not (0 <= index <= 4):  # noqa: PLR2004
                                                            raise KeyError(index)
                                                        return self.at(index)
                                                    

                                                    __setitem__(index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions, value: int)

                                                    Sets the value specified by value in the position specified by index.

                                                    Source code in prettyqt/charts/boxset.py
                                                    def __setitem__(
                                                        self, index: int | ValuePositionStr | QtCharts.QBoxSet.ValuePositions, value: int
                                                    ):
                                                        """Sets the value specified by value in the position specified by index."""
                                                        if not isinstance(index, int):
                                                            index = VALUE_POSITION.get_enum_value(index).value
                                                        if not (0 <= index <= 4):  # noqa: PLR2004
                                                            raise KeyError(index)
                                                        self.setValue(index, value)
                                                    

                                                    CategoryAxis

                                                    Bases: ValueAxisMixin, QCategoryAxis

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    class CategoryAxis(charts.ValueAxisMixin, charts.QCategoryAxis):
                                                        def __delitem__(self, index: str):
                                                            """Remove category label."""
                                                            self.remove(index)
                                                    
                                                        def __getitem__(self, label: int | slice) -> str | list[str]:
                                                            """Get category label from given index."""
                                                            return self.categoriesLabels()[label]
                                                    
                                                        def __setitem__(self, index: str, value: str):
                                                            """Set label at given index to value."""
                                                            self.replaceLabel(index, value)
                                                    
                                                        def __iter__(self) -> Iterator[str]:
                                                            """Iterate through all category labels."""
                                                            return iter(self.categoriesLabels())
                                                    
                                                        def __add__(self, other: tuple[str, int]) -> CategoryAxis:
                                                            """Append another category."""
                                                            self.append(*other)
                                                            return self
                                                    
                                                        def __len__(self):
                                                            """Return category label count from axis."""
                                                            return self.count()
                                                    
                                                        def set_labels_position(
                                                            self, position: LabelsPositionStr | charts.QCategoryAxis.AxisLabelsPosition
                                                        ):
                                                            """Set the labels position.
                                                    
                                                            Args:
                                                                position: labels position
                                                            """
                                                            self.setLabelsPosition(LABELS_POSITIONS.get_enum_value(position))
                                                    
                                                        def get_labels_position(self) -> LabelsPositionStr:
                                                            """Return current labels position.
                                                    
                                                            Returns:
                                                                labels position
                                                            """
                                                            return LABELS_POSITIONS.inverse[self.labelsPosition()]
                                                    

                                                    __add__(other: tuple[str, int]) -> CategoryAxis

                                                    Append another category.

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def __add__(self, other: tuple[str, int]) -> CategoryAxis:
                                                        """Append another category."""
                                                        self.append(*other)
                                                        return self
                                                    

                                                    __delitem__(index: str)

                                                    Remove category label.

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def __delitem__(self, index: str):
                                                        """Remove category label."""
                                                        self.remove(index)
                                                    

                                                    __getitem__(label: int | slice) -> str | list[str]

                                                    Get category label from given index.

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def __getitem__(self, label: int | slice) -> str | list[str]:
                                                        """Get category label from given index."""
                                                        return self.categoriesLabels()[label]
                                                    

                                                    __iter__() -> Iterator[str]

                                                    Iterate through all category labels.

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def __iter__(self) -> Iterator[str]:
                                                        """Iterate through all category labels."""
                                                        return iter(self.categoriesLabels())
                                                    

                                                    __len__()

                                                    Return category label count from axis.

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def __len__(self):
                                                        """Return category label count from axis."""
                                                        return self.count()
                                                    

                                                    __setitem__(index: str, value: str)

                                                    Set label at given index to value.

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def __setitem__(self, index: str, value: str):
                                                        """Set label at given index to value."""
                                                        self.replaceLabel(index, value)
                                                    

                                                    get_labels_position() -> LabelsPositionStr

                                                    Return current labels position.

                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def get_labels_position(self) -> LabelsPositionStr:
                                                        """Return current labels position.
                                                    
                                                        Returns:
                                                            labels position
                                                        """
                                                        return LABELS_POSITIONS.inverse[self.labelsPosition()]
                                                    

                                                    set_labels_position(position: LabelsPositionStr | charts.QCategoryAxis.AxisLabelsPosition)

                                                    Set the labels position.

                                                    Parameters:

                                                    Name Type Description Default
                                                    position LabelsPositionStr | AxisLabelsPosition

                                                    labels position

                                                    required
                                                    Source code in prettyqt/charts/categoryaxis.py
                                                    def set_labels_position(
                                                        self, position: LabelsPositionStr | charts.QCategoryAxis.AxisLabelsPosition
                                                    ):
                                                        """Set the labels position.
                                                    
                                                        Args:
                                                            position: labels position
                                                        """
                                                        self.setLabelsPosition(LABELS_POSITIONS.get_enum_value(position))
                                                    

                                                    ChartMixin

                                                    Bases: GraphicsWidgetMixin, _ChartBase

                                                    Source code in prettyqt/charts/chart.py
                                                    class ChartMixin(widgets.GraphicsWidgetMixin, _ChartBase):
                                                        def __init__(self, *args, **kwargs):
                                                            super().__init__(*args, **kwargs)
                                                            self.max_x = 0
                                                            self.max_y = 0
                                                            self.min_x = 0
                                                            self.min_y = 0
                                                            self.adjust_style_to_palette()
                                                            gui.GuiApplication.styleHints().colorSchemeChanged.connect(
                                                                self.adjust_style_to_palette
                                                            )
                                                    
                                                        def adjust_style_to_palette(self):
                                                            """Adjusts the chart theme to current Palette.
                                                    
                                                            Checks if palette is dark-ish and applies an appropriate theme to the chart.
                                                            """
                                                            pal = gui.GuiApplication.get_palette()
                                                            style = "Dark" if pal.is_dark() else "Light"
                                                            self.set_theme(style)
                                                    
                                                        def get_axes(
                                                            self,
                                                            orientation: constants.OrientationStr | constants.Orientation | None = None,
                                                            series: charts.QAbstractSeries | None = None,
                                                        ) -> list[charts.QAbstractAxis]:
                                                            """Get axes of chart.
                                                    
                                                            Arguments:
                                                                orientation: Orientation of the axes that should get returned.
                                                                series: Series to return axes for. Returns all axes if None.
                                                            """
                                                            if orientation is None:
                                                                orientation = constants.HORIZONTAL | constants.VERTICAL
                                                            return self.axes(constants.ORIENTATION.get_enum_value(orientation), series)
                                                    
                                                        def _get_value_axes(
                                                            self, orientation: constants.OrientationStr | None = None
                                                        ) -> list[charts.QValueAxis]:
                                                            axes = self.get_axes(orientation) if orientation else self.get_axes()
                                                            return [i for i in axes if isinstance(i, charts.QValueAxis)]
                                                    
                                                        def update_boundaries(self):
                                                            """Set new min/max values based on the value axes."""
                                                            if axis_x := self._get_value_axes("horizontal"):
                                                                self.max_x = axis_x[0].max()
                                                                self.min_x = axis_x[0].min()
                                                            if axis_y := self._get_value_axes("vertical"):
                                                                self.max_y = axis_y[0].max()
                                                                self.min_y = axis_y[0].min()
                                                    
                                                        def hide_legend(self):
                                                            self.legend().hide()
                                                    
                                                        def show_legend(self):
                                                            self.legend().show()
                                                    
                                                        def get_legend(self) -> charts.Legend:
                                                            return charts.Legend(self.legend())
                                                    
                                                        def set_legend_alignment(
                                                            self, alignment: constants.SideStr | constants.AlignmentFlag
                                                        ):
                                                            """Set alignment of the chart legend."""
                                                            self.legend().setAlignment(constants.SIDES.get_enum_value(alignment))
                                                    
                                                        def set_theme(self, theme_name: ThemeStr | charts.QChart.ChartTheme):
                                                            self.setTheme(THEMES.get_enum_value(theme_name))
                                                    
                                                        def set_margins(self, margins: datatypes.MarginsType):
                                                            margins = datatypes.to_margins(margins)
                                                            self.setMargins(margins)
                                                    
                                                        def set_animation_options(
                                                            self, option: AnimationOptionStr | charts.QChart.AnimationOption
                                                        ):
                                                            self.setAnimationOptions(ANIMATION_OPTIONS.get_enum_value(option))
                                                    
                                                        def apply_nice_numbers(self):
                                                            """Adjust both axis to display nice round numbers."""
                                                            for axis in self._get_value_axes():
                                                                axis.applyNiceNumbers()
                                                    
                                                        def zoom_by_factor(self, factor: float):
                                                            """Zoom in/out by factor (1.0 = no change).
                                                    
                                                            Make sure that we dont zoom out too far
                                                            """
                                                            if self.min_x == self.max_x == 0 and self.min_y == self.max_y == 0:
                                                                self.update_boundaries()
                                                            self.zoom(factor)
                                                            if (axis_x := self._get_value_axes("horizontal")) and self.min_x < self.max_x:
                                                                if axis_x[0].min() < self.min_x:
                                                                    axis_x[0].setMin(self.min_x)
                                                                if axis_x[0].max() > self.max_x:
                                                                    axis_x[0].setMax(self.max_x)
                                                            if (axis_y := self._get_value_axes("vertical")) and self.min_y < self.max_y:
                                                                if axis_y[0].max() > self.max_y:
                                                                    axis_y[0].setMax(self.max_y)
                                                    
                                                                # always bottom-align when zooming for now. should perhaps become optional.
                                                                # if axis_y[0].min() < self.min_y:
                                                                axis_y[0].setMin(max(0, self.min_y))
                                                    
                                                        def get_chart_type(self) -> ChartTypeStr:
                                                            return CHART_TYPES.inverse[self.chartType()]
                                                    
                                                        def get_margins(self) -> core.Margins:
                                                            return core.Margins(self.margins())
                                                    
                                                        def get_plot_area(self) -> core.RectF:
                                                            return core.RectF(self.plotArea())
                                                    
                                                        def get_locale(self) -> core.Locale:
                                                            return core.Locale(self.locale())
                                                    
                                                        def get_theme(self) -> ThemeStr:
                                                            return THEMES.inverse[self.theme()]
                                                    
                                                        def get_animation_options(self) -> list[AnimationOptionStr]:
                                                            return ANIMATION_OPTIONS.get_list(self.animationOptions())
                                                    
                                                        def get_animation_easing_curve(self) -> core.EasingCurve:
                                                            return core.EasingCurve(self.animationEasingCurve())
                                                    

                                                    adjust_style_to_palette()

                                                    Adjusts the chart theme to current Palette.

                                                    Checks if palette is dark-ish and applies an appropriate theme to the chart.

                                                    Source code in prettyqt/charts/chart.py
                                                    def adjust_style_to_palette(self):
                                                        """Adjusts the chart theme to current Palette.
                                                    
                                                        Checks if palette is dark-ish and applies an appropriate theme to the chart.
                                                        """
                                                        pal = gui.GuiApplication.get_palette()
                                                        style = "Dark" if pal.is_dark() else "Light"
                                                        self.set_theme(style)
                                                    

                                                    apply_nice_numbers()

                                                    Adjust both axis to display nice round numbers.

                                                    Source code in prettyqt/charts/chart.py
                                                    def apply_nice_numbers(self):
                                                        """Adjust both axis to display nice round numbers."""
                                                        for axis in self._get_value_axes():
                                                            axis.applyNiceNumbers()
                                                    

                                                    get_axes(orientation: constants.OrientationStr | constants.Orientation | None = None, series: charts.QAbstractSeries | None = None) -> list[charts.QAbstractAxis]

                                                    Get axes of chart.

                                                    Parameters:

                                                    Name Type Description Default
                                                    orientation OrientationStr | Orientation | None

                                                    Orientation of the axes that should get returned.

                                                    None
                                                    series QAbstractSeries | None

                                                    Series to return axes for. Returns all axes if None.

                                                    None
                                                    Source code in prettyqt/charts/chart.py
                                                    def get_axes(
                                                        self,
                                                        orientation: constants.OrientationStr | constants.Orientation | None = None,
                                                        series: charts.QAbstractSeries | None = None,
                                                    ) -> list[charts.QAbstractAxis]:
                                                        """Get axes of chart.
                                                    
                                                        Arguments:
                                                            orientation: Orientation of the axes that should get returned.
                                                            series: Series to return axes for. Returns all axes if None.
                                                        """
                                                        if orientation is None:
                                                            orientation = constants.HORIZONTAL | constants.VERTICAL
                                                        return self.axes(constants.ORIENTATION.get_enum_value(orientation), series)
                                                    

                                                    set_legend_alignment(alignment: constants.SideStr | constants.AlignmentFlag)

                                                    Set alignment of the chart legend.

                                                    Source code in prettyqt/charts/chart.py
                                                    def set_legend_alignment(
                                                        self, alignment: constants.SideStr | constants.AlignmentFlag
                                                    ):
                                                        """Set alignment of the chart legend."""
                                                        self.legend().setAlignment(constants.SIDES.get_enum_value(alignment))
                                                    

                                                    update_boundaries()

                                                    Set new min/max values based on the value axes.

                                                    Source code in prettyqt/charts/chart.py
                                                    def update_boundaries(self):
                                                        """Set new min/max values based on the value axes."""
                                                        if axis_x := self._get_value_axes("horizontal"):
                                                            self.max_x = axis_x[0].max()
                                                            self.min_x = axis_x[0].min()
                                                        if axis_y := self._get_value_axes("vertical"):
                                                            self.max_y = axis_y[0].max()
                                                            self.min_y = axis_y[0].min()
                                                    

                                                    zoom_by_factor(factor: float)

                                                    Zoom in/out by factor (1.0 = no change).

                                                    Make sure that we dont zoom out too far

                                                    Source code in prettyqt/charts/chart.py
                                                    def zoom_by_factor(self, factor: float):
                                                        """Zoom in/out by factor (1.0 = no change).
                                                    
                                                        Make sure that we dont zoom out too far
                                                        """
                                                        if self.min_x == self.max_x == 0 and self.min_y == self.max_y == 0:
                                                            self.update_boundaries()
                                                        self.zoom(factor)
                                                        if (axis_x := self._get_value_axes("horizontal")) and self.min_x < self.max_x:
                                                            if axis_x[0].min() < self.min_x:
                                                                axis_x[0].setMin(self.min_x)
                                                            if axis_x[0].max() > self.max_x:
                                                                axis_x[0].setMax(self.max_x)
                                                        if (axis_y := self._get_value_axes("vertical")) and self.min_y < self.max_y:
                                                            if axis_y[0].max() > self.max_y:
                                                                axis_y[0].setMax(self.max_y)
                                                    
                                                            # always bottom-align when zooming for now. should perhaps become optional.
                                                            # if axis_y[0].min() < self.min_y:
                                                            axis_y[0].setMin(max(0, self.min_y))
                                                    

                                                    ChartView

                                                    Bases: GraphicsViewMixin, QChartView

                                                    Source code in prettyqt/charts/chartview.py
                                                    class ChartView(widgets.GraphicsViewMixin, charts.QChartView):
                                                        def __init__(self, *args, **kwargs):
                                                            super().__init__(*args, **kwargs)
                                                            self.last_mouse_pos: core.QPointF | None = None
                                                            if not args or not isinstance(args[0], charts.QChart):
                                                                self.setChart(charts.Chart())
                                                            self.setRenderHint(gui.Painter.RenderHint.Antialiasing)
                                                            self.set_rubber_band("rectangle")
                                                            # self.setDragMode(self.RubberBandDrag)
                                                    
                                                        def get_chart(self) -> charts.Chart:
                                                            """The chart (a prettyqt Chart unless a plain QChart was passed in)."""
                                                            return cast("charts.Chart", self.chart())
                                                    
                                                        def keyPressEvent(self, event: gui.QKeyEvent):
                                                            """Handle keypress events to allow navigation via keyboard."""
                                                            match event.key():
                                                                case constants.Key.Key_Escape:
                                                                    self.get_chart().zoomReset()
                                                                case constants.Key.Key_Plus:
                                                                    self.get_chart().zoom_by_factor(ZOOM_IN_FACTOR)
                                                                case constants.Key.Key_Minus:
                                                                    self.get_chart().zoom_by_factor(ZOOM_OUT_FACTOR)
                                                                case constants.Key.Key_Left:
                                                                    self.get_chart().scroll(-SCROLL_STEP_SIZE, 0)
                                                                case constants.Key.Key_Right:
                                                                    self.get_chart().scroll(SCROLL_STEP_SIZE, 0)
                                                                case constants.Key.Key_Up:
                                                                    self.get_chart().scroll(0, SCROLL_STEP_SIZE)
                                                                case constants.Key.Key_Down:
                                                                    self.get_chart().scroll(0, -SCROLL_STEP_SIZE)
                                                                case constants.Key.Key_0:
                                                                    self.get_chart().apply_nice_numbers()
                                                                case _:
                                                                    super().keyPressEvent(event)
                                                                    return
                                                            event.accept()
                                                    
                                                        def wheelEvent(self, event: gui.QWheelEvent):
                                                            """Handle wheel event for zooming."""
                                                            fct = ZOOM_IN_FACTOR if event.angleDelta().y() > 0 else ZOOM_OUT_FACTOR
                                                            self.get_chart().zoom_by_factor(fct)
                                                            event.accept()
                                                    
                                                        def mouseReleaseEvent(self, event: gui.QMouseEvent):
                                                            """Override to allow dragging the chart."""
                                                            if event.button() == constants.MouseButton.RightButton:
                                                                widgets.Application.restoreOverrideCursor()
                                                                event.accept()
                                                                return
                                                            super().mouseReleaseEvent(event)
                                                    
                                                        def mousePressEvent(self, event: gui.QMouseEvent):
                                                            """Override to allow dragging the chart."""
                                                            if event.button() == constants.MouseButton.RightButton:
                                                                widgets.Application.set_override_cursor("size_all")
                                                                self.last_mouse_pos = event.position()
                                                                event.accept()
                                                    
                                                            super().mousePressEvent(event)
                                                    
                                                        def mouseMoveEvent(self, event: gui.QMouseEvent):
                                                            """Override to allow dragging the chart."""
                                                            # pan the chart with a middle mouse drag
                                                            if event.buttons() & constants.MouseButton.RightButton:
                                                                if not self.last_mouse_pos:
                                                                    return
                                                                pos_diff = event.position() - self.last_mouse_pos
                                                                self.get_chart().scroll(-pos_diff.x(), pos_diff.y())
                                                    
                                                                self.last_mouse_pos = event.position()
                                                                event.accept()
                                                    
                                                            super().mouseMoveEvent(event)
                                                    
                                                        @core.Slot()
                                                        def save_as_image(self):
                                                            """Let user choose folder and save chart as an image file."""
                                                            dlg = widgets.FileDialog(mode="save", caption="Save image")
                                                            filters = {"Bmp files": [".bmp"], "Jpeg files": [".jpg"], "Png files": [".png"]}
                                                            dlg.set_extension_filter(filters)
                                                            filename = dlg.open_file()
                                                            if not filename:
                                                                return
                                                            self.get_chart().show_legend()
                                                            image = self.get_image()
                                                            image.save(str(filename[0]))
                                                            self.get_chart().hide_legend()
                                                    
                                                        def set_rubber_band(self, typ: RubberBandStr | charts.QChartView.RubberBand):
                                                            """Set the rubber band type.
                                                    
                                                            Args:
                                                                typ: rubber band type
                                                            """
                                                            self.setRubberBand(RUBBER_BAND.get_enum_value(typ))
                                                    
                                                        def get_rubber_band(self) -> RubberBandStr:
                                                            """Return current rubber band type.
                                                    
                                                            Returns:
                                                                Rubber band type
                                                            """
                                                            rb = self.rubberBand()
                                                            if rb in RUBBER_BAND.inverse:
                                                                return RUBBER_BAND.inverse[rb]
                                                            base = rb & ~charts.QChartView.RubberBand.ClickThroughRubberBand
                                                            return RUBBER_BAND.inverse[base]
                                                    
                                                        def get_rubber_bands(self) -> list[RubberBandStr]:
                                                            """Return active rubber band flags.
                                                    
                                                            Returns:
                                                                List of active rubber band flag names
                                                            """
                                                            rb = self.rubberBand()
                                                            return [k for k, v in RUBBER_BAND.items() if v and (rb & v) == v]
                                                    

                                                    get_chart() -> charts.Chart

                                                    The chart (a prettyqt Chart unless a plain QChart was passed in).

                                                    Source code in prettyqt/charts/chartview.py
                                                    def get_chart(self) -> charts.Chart:
                                                        """The chart (a prettyqt Chart unless a plain QChart was passed in)."""
                                                        return cast("charts.Chart", self.chart())
                                                    

                                                    get_rubber_band() -> RubberBandStr

                                                    Return current rubber band type.

                                                    Source code in prettyqt/charts/chartview.py
                                                    def get_rubber_band(self) -> RubberBandStr:
                                                        """Return current rubber band type.
                                                    
                                                        Returns:
                                                            Rubber band type
                                                        """
                                                        rb = self.rubberBand()
                                                        if rb in RUBBER_BAND.inverse:
                                                            return RUBBER_BAND.inverse[rb]
                                                        base = rb & ~charts.QChartView.RubberBand.ClickThroughRubberBand
                                                        return RUBBER_BAND.inverse[base]
                                                    

                                                    get_rubber_bands() -> list[RubberBandStr]

                                                    Return active rubber band flags.

                                                    Source code in prettyqt/charts/chartview.py
                                                    def get_rubber_bands(self) -> list[RubberBandStr]:
                                                        """Return active rubber band flags.
                                                    
                                                        Returns:
                                                            List of active rubber band flag names
                                                        """
                                                        rb = self.rubberBand()
                                                        return [k for k, v in RUBBER_BAND.items() if v and (rb & v) == v]
                                                    

                                                    keyPressEvent(event: gui.QKeyEvent)

                                                    Handle keypress events to allow navigation via keyboard.

                                                    Source code in prettyqt/charts/chartview.py
                                                    def keyPressEvent(self, event: gui.QKeyEvent):
                                                        """Handle keypress events to allow navigation via keyboard."""
                                                        match event.key():
                                                            case constants.Key.Key_Escape:
                                                                self.get_chart().zoomReset()
                                                            case constants.Key.Key_Plus:
                                                                self.get_chart().zoom_by_factor(ZOOM_IN_FACTOR)
                                                            case constants.Key.Key_Minus:
                                                                self.get_chart().zoom_by_factor(ZOOM_OUT_FACTOR)
                                                            case constants.Key.Key_Left:
                                                                self.get_chart().scroll(-SCROLL_STEP_SIZE, 0)
                                                            case constants.Key.Key_Right:
                                                                self.get_chart().scroll(SCROLL_STEP_SIZE, 0)
                                                            case constants.Key.Key_Up:
                                                                self.get_chart().scroll(0, SCROLL_STEP_SIZE)
                                                            case constants.Key.Key_Down:
                                                                self.get_chart().scroll(0, -SCROLL_STEP_SIZE)
                                                            case constants.Key.Key_0:
                                                                self.get_chart().apply_nice_numbers()
                                                            case _:
                                                                super().keyPressEvent(event)
                                                                return
                                                        event.accept()
                                                    

                                                    mouseMoveEvent(event: gui.QMouseEvent)

                                                    Override to allow dragging the chart.

                                                    Source code in prettyqt/charts/chartview.py
                                                    def mouseMoveEvent(self, event: gui.QMouseEvent):
                                                        """Override to allow dragging the chart."""
                                                        # pan the chart with a middle mouse drag
                                                        if event.buttons() & constants.MouseButton.RightButton:
                                                            if not self.last_mouse_pos:
                                                                return
                                                            pos_diff = event.position() - self.last_mouse_pos
                                                            self.get_chart().scroll(-pos_diff.x(), pos_diff.y())
                                                    
                                                            self.last_mouse_pos = event.position()
                                                            event.accept()
                                                    
                                                        super().mouseMoveEvent(event)
                                                    

                                                    mousePressEvent(event: gui.QMouseEvent)

                                                    Override to allow dragging the chart.

                                                    Source code in prettyqt/charts/chartview.py
                                                    def mousePressEvent(self, event: gui.QMouseEvent):
                                                        """Override to allow dragging the chart."""
                                                        if event.button() == constants.MouseButton.RightButton:
                                                            widgets.Application.set_override_cursor("size_all")
                                                            self.last_mouse_pos = event.position()
                                                            event.accept()
                                                    
                                                        super().mousePressEvent(event)
                                                    

                                                    mouseReleaseEvent(event: gui.QMouseEvent)

                                                    Override to allow dragging the chart.

                                                    Source code in prettyqt/charts/chartview.py
                                                    def mouseReleaseEvent(self, event: gui.QMouseEvent):
                                                        """Override to allow dragging the chart."""
                                                        if event.button() == constants.MouseButton.RightButton:
                                                            widgets.Application.restoreOverrideCursor()
                                                            event.accept()
                                                            return
                                                        super().mouseReleaseEvent(event)
                                                    

                                                    save_as_image()

                                                    Let user choose folder and save chart as an image file.

                                                    Source code in prettyqt/charts/chartview.py
                                                    @core.Slot()
                                                    def save_as_image(self):
                                                        """Let user choose folder and save chart as an image file."""
                                                        dlg = widgets.FileDialog(mode="save", caption="Save image")
                                                        filters = {"Bmp files": [".bmp"], "Jpeg files": [".jpg"], "Png files": [".png"]}
                                                        dlg.set_extension_filter(filters)
                                                        filename = dlg.open_file()
                                                        if not filename:
                                                            return
                                                        self.get_chart().show_legend()
                                                        image = self.get_image()
                                                        image.save(str(filename[0]))
                                                        self.get_chart().hide_legend()
                                                    

                                                    set_rubber_band(typ: RubberBandStr | charts.QChartView.RubberBand)

                                                    Set the rubber band type.

                                                    Parameters:

                                                    Name Type Description Default
                                                    typ RubberBandStr | RubberBand

                                                    rubber band type

                                                    required
                                                    Source code in prettyqt/charts/chartview.py
                                                    def set_rubber_band(self, typ: RubberBandStr | charts.QChartView.RubberBand):
                                                        """Set the rubber band type.
                                                    
                                                        Args:
                                                            typ: rubber band type
                                                        """
                                                        self.setRubberBand(RUBBER_BAND.get_enum_value(typ))
                                                    

                                                    wheelEvent(event: gui.QWheelEvent)

                                                    Handle wheel event for zooming.

                                                    Source code in prettyqt/charts/chartview.py
                                                    def wheelEvent(self, event: gui.QWheelEvent):
                                                        """Handle wheel event for zooming."""
                                                        fct = ZOOM_IN_FACTOR if event.angleDelta().y() > 0 else ZOOM_OUT_FACTOR
                                                        self.get_chart().zoom_by_factor(fct)
                                                        event.accept()
                                                    

                                                    DateTimeAxis

                                                    Bases: AbstractAxisMixin, QDateTimeAxis

                                                    Source code in prettyqt/charts/datetimeaxis.py
                                                    class DateTimeAxis(charts.AbstractAxisMixin, charts.QDateTimeAxis):
                                                        def set_min(self, minimum: datatypes.DateTimeType):
                                                            """Set minimum value for axis."""
                                                            minimum = datatypes.to_datetime(minimum)
                                                            self.setMin(minimum)
                                                    
                                                        def get_min(self) -> dt.datetime:
                                                            return cast("dt.datetime", self.min().toPython())  # stub: object
                                                    
                                                        def set_max(self, maximum: datatypes.DateTimeType):
                                                            """Set maximum value for axis."""
                                                            maximum = datatypes.to_datetime(maximum)
                                                            self.setMax(maximum)
                                                    
                                                        def get_max(self) -> dt.datetime:
                                                            return cast("dt.datetime", self.max().toPython())  # stub: object
                                                    
                                                        def set_range(self, minimum: datatypes.DateTimeType, maximum: datatypes.DateTimeType):
                                                            """Set value range of datetime axis."""
                                                            self.setRange(datatypes.to_datetime(minimum), datatypes.to_datetime(maximum))
                                                    

                                                    set_max(maximum: datatypes.DateTimeType)

                                                    Set maximum value for axis.

                                                    Source code in prettyqt/charts/datetimeaxis.py
                                                    def set_max(self, maximum: datatypes.DateTimeType):
                                                        """Set maximum value for axis."""
                                                        maximum = datatypes.to_datetime(maximum)
                                                        self.setMax(maximum)
                                                    

                                                    set_min(minimum: datatypes.DateTimeType)

                                                    Set minimum value for axis.

                                                    Source code in prettyqt/charts/datetimeaxis.py
                                                    def set_min(self, minimum: datatypes.DateTimeType):
                                                        """Set minimum value for axis."""
                                                        minimum = datatypes.to_datetime(minimum)
                                                        self.setMin(minimum)
                                                    

                                                    set_range(minimum: datatypes.DateTimeType, maximum: datatypes.DateTimeType)

                                                    Set value range of datetime axis.

                                                    Source code in prettyqt/charts/datetimeaxis.py
                                                    def set_range(self, minimum: datatypes.DateTimeType, maximum: datatypes.DateTimeType):
                                                        """Set value range of datetime axis."""
                                                        self.setRange(datatypes.to_datetime(minimum), datatypes.to_datetime(maximum))
                                                    

                                                    Legend

                                                    Bases: GraphicsWidgetMixin

                                                    Source code in prettyqt/charts/legend.py
                                                    class Legend(widgets.GraphicsWidgetMixin):
                                                        def __init__(self, item: QtCharts.QLegend):
                                                            self.item = item
                                                    
                                                        def __getattr__(self, val):
                                                            return getattr(self.item, val)
                                                    
                                                        def set_alignment(self, alignment: constants.SideStr | constants.AlignmentFlag):
                                                            """Set the alignment of the legend.
                                                    
                                                            Args:
                                                                alignment: alignment for the legend
                                                            """
                                                            self.setAlignment(constants.SIDES.get_enum_value(alignment))
                                                    
                                                        def get_alignment(self) -> constants.SideStr:
                                                            """Return current alignment.
                                                    
                                                            Returns:
                                                                alignment
                                                            """
                                                            return constants.SIDES.inverse[self.alignment()]
                                                    
                                                        def set_marker_shape(self, shape: MarkerShapeStr):
                                                            """Set the marker shape.
                                                    
                                                            Args:
                                                                shape: marker shape
                                                            """
                                                            self.setMarkerShape(MARKER_SHAPES.get_enum_value(shape))
                                                    
                                                        def get_marker_shape(self) -> MarkerShapeStr:
                                                            """Return current marker shape.
                                                    
                                                            Returns:
                                                                Marker shape
                                                            """
                                                            return MARKER_SHAPES.inverse[self.markerShape()]
                                                    
                                                        def get_border_color(self) -> gui.Color:
                                                            return gui.Color(self.borderColor())
                                                    
                                                        def get_color(self) -> gui.Color:
                                                            return gui.Color(self.color())
                                                    
                                                        def get_label_color(self) -> gui.Color:
                                                            return gui.Color(self.labelColor())
                                                    
                                                        def get_font(self) -> gui.Font:
                                                            return gui.Font(self.font())
                                                    

                                                    get_alignment() -> constants.SideStr

                                                    Return current alignment.

                                                    Source code in prettyqt/charts/legend.py
                                                    def get_alignment(self) -> constants.SideStr:
                                                        """Return current alignment.
                                                    
                                                        Returns:
                                                            alignment
                                                        """
                                                        return constants.SIDES.inverse[self.alignment()]
                                                    

                                                    get_marker_shape() -> MarkerShapeStr

                                                    Return current marker shape.

                                                    Source code in prettyqt/charts/legend.py
                                                    def get_marker_shape(self) -> MarkerShapeStr:
                                                        """Return current marker shape.
                                                    
                                                        Returns:
                                                            Marker shape
                                                        """
                                                        return MARKER_SHAPES.inverse[self.markerShape()]
                                                    

                                                    set_alignment(alignment: constants.SideStr | constants.AlignmentFlag)

                                                    Set the alignment of the legend.

                                                    Parameters:

                                                    Name Type Description Default
                                                    alignment SideStr | AlignmentFlag

                                                    alignment for the legend

                                                    required
                                                    Source code in prettyqt/charts/legend.py
                                                    def set_alignment(self, alignment: constants.SideStr | constants.AlignmentFlag):
                                                        """Set the alignment of the legend.
                                                    
                                                        Args:
                                                            alignment: alignment for the legend
                                                        """
                                                        self.setAlignment(constants.SIDES.get_enum_value(alignment))
                                                    

                                                    set_marker_shape(shape: MarkerShapeStr)

                                                    Set the marker shape.

                                                    Parameters:

                                                    Name Type Description Default
                                                    shape MarkerShapeStr

                                                    marker shape

                                                    required
                                                    Source code in prettyqt/charts/legend.py
                                                    def set_marker_shape(self, shape: MarkerShapeStr):
                                                        """Set the marker shape.
                                                    
                                                        Args:
                                                            shape: marker shape
                                                        """
                                                        self.setMarkerShape(MARKER_SHAPES.get_enum_value(shape))
                                                    

                                                    LineSeries

                                                    Bases: XYSeriesMixin, QLineSeries

                                                    QLineSeries with some custom properties.

                                                    Source code in prettyqt/charts/lineseries.py
                                                    class LineSeries(charts.XYSeriesMixin, charts.QLineSeries):
                                                        """QLineSeries with some custom properties."""
                                                    

                                                    PieSlice

                                                    Bases: ObjectMixin, QPieSlice

                                                    Source code in prettyqt/charts/pieslice.py
                                                    class PieSlice(core.ObjectMixin, QtCharts.QPieSlice):
                                                        def __repr__(self):
                                                            return get_repr(self, self.label(), self.value())
                                                    
                                                        def set_label_position(
                                                            self, position: LabelPositionStr | QtCharts.QPieSlice.LabelPosition
                                                        ):
                                                            """Set the label position.
                                                    
                                                            Args:
                                                                position: label position
                                                            """
                                                            self.setLabelPosition(LABEL_POSITION.get_enum_value(position))
                                                    
                                                        def get_label_position(self) -> LabelPositionStr:
                                                            """Return current label position.
                                                    
                                                            Returns:
                                                                label position
                                                            """
                                                            return LABEL_POSITION.inverse[self.labelPosition()]
                                                    
                                                        def get_label_font(self) -> gui.Font:
                                                            return gui.Font(self.labelFont())
                                                    
                                                        def get_label_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.labelBrush())
                                                    
                                                        def get_label_color(self) -> gui.Color:
                                                            return gui.Color(self.labelColor())
                                                    
                                                        def get_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.pen())
                                                    
                                                        def get_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.brush())
                                                    
                                                        def get_color(self) -> gui.Color:
                                                            return gui.Color(self.color())
                                                    
                                                        def get_border_color(self) -> gui.Color:
                                                            return gui.Color(self.borderColor())
                                                    

                                                    get_label_position() -> LabelPositionStr

                                                    Return current label position.

                                                    Source code in prettyqt/charts/pieslice.py
                                                    def get_label_position(self) -> LabelPositionStr:
                                                        """Return current label position.
                                                    
                                                        Returns:
                                                            label position
                                                        """
                                                        return LABEL_POSITION.inverse[self.labelPosition()]
                                                    

                                                    set_label_position(position: LabelPositionStr | QtCharts.QPieSlice.LabelPosition)

                                                    Set the label position.

                                                    Parameters:

                                                    Name Type Description Default
                                                    position LabelPositionStr | LabelPosition

                                                    label position

                                                    required
                                                    Source code in prettyqt/charts/pieslice.py
                                                    def set_label_position(
                                                        self, position: LabelPositionStr | QtCharts.QPieSlice.LabelPosition
                                                    ):
                                                        """Set the label position.
                                                    
                                                        Args:
                                                            position: label position
                                                        """
                                                        self.setLabelPosition(LABEL_POSITION.get_enum_value(position))
                                                    

                                                    PolarChart

                                                    Bases: ChartMixin, QPolarChart

                                                    Source code in prettyqt/charts/polarchart.py
                                                    class PolarChart(charts.ChartMixin, charts.QPolarChart):
                                                        def add_axis(
                                                            self,
                                                            axis: charts.QAbstractAxis,
                                                            orientation: PolarOrientationStr | charts.QPolarChart.PolarOrientation,
                                                        ):
                                                            """Add axis with given orientation."""
                                                            self.addAxis(axis, POLAR_ORIENTATIONS.get_enum_value(orientation))
                                                    

                                                    add_axis(axis: charts.QAbstractAxis, orientation: PolarOrientationStr | charts.QPolarChart.PolarOrientation)

                                                    Add axis with given orientation.

                                                    Source code in prettyqt/charts/polarchart.py
                                                    def add_axis(
                                                        self,
                                                        axis: charts.QAbstractAxis,
                                                        orientation: PolarOrientationStr | charts.QPolarChart.PolarOrientation,
                                                    ):
                                                        """Add axis with given orientation."""
                                                        self.addAxis(axis, POLAR_ORIENTATIONS.get_enum_value(orientation))
                                                    

                                                    ValueAxisMixin

                                                    Bases: AbstractAxisMixin, _ValueAxisBase

                                                    Source code in prettyqt/charts/valueaxis.py
                                                    class ValueAxisMixin(charts.AbstractAxisMixin, _ValueAxisBase):
                                                        def set_tick_type(self, tick_type: TickTypeStr | charts.QValueAxis.TickType):
                                                            """Set the tick type of the legend.
                                                    
                                                            Args:
                                                                tick_type: tick type for the legend
                                                            """
                                                            self.setTickType(TICK_TYPES.get_enum_value(tick_type))
                                                    
                                                        def get_tick_type(self) -> TickTypeStr:
                                                            """Return current tick type.
                                                    
                                                            Returns:
                                                                tick_type
                                                            """
                                                            return TICK_TYPES.inverse[self.tickType()]
                                                    

                                                    get_tick_type() -> TickTypeStr

                                                    Return current tick type.

                                                    Source code in prettyqt/charts/valueaxis.py
                                                    def get_tick_type(self) -> TickTypeStr:
                                                        """Return current tick type.
                                                    
                                                        Returns:
                                                            tick_type
                                                        """
                                                        return TICK_TYPES.inverse[self.tickType()]
                                                    

                                                    set_tick_type(tick_type: TickTypeStr | charts.QValueAxis.TickType)

                                                    Set the tick type of the legend.

                                                    Parameters:

                                                    Name Type Description Default
                                                    tick_type TickTypeStr | TickType

                                                    tick type for the legend

                                                    required
                                                    Source code in prettyqt/charts/valueaxis.py
                                                    def set_tick_type(self, tick_type: TickTypeStr | charts.QValueAxis.TickType):
                                                        """Set the tick type of the legend.
                                                    
                                                        Args:
                                                            tick_type: tick type for the legend
                                                        """
                                                        self.setTickType(TICK_TYPES.get_enum_value(tick_type))
                                                    

                                                    XYSeriesMixin

                                                    Bases: AbstractSeriesMixin, _XYSeriesBase

                                                    Source code in prettyqt/charts/xyseries.py
                                                    class XYSeriesMixin(charts.AbstractSeriesMixin, _XYSeriesBase):
                                                        def __setitem__(self, index: int, val: datatypes.PointFType):
                                                            """Set point at given index to value."""
                                                            self.replace(index, datatypes.to_pointf(val))
                                                    
                                                        def __delitem__(self, index: int):
                                                            """Remove point with given index."""
                                                            self.remove(index)
                                                    
                                                        # def __setstate__(self, state):
                                                        #     self.append(state["points"])
                                                    
                                                        # def __reduce__(self):
                                                        #     return type(self), (), self.__getstate__()
                                                    
                                                        def __add__(self, other: datatypes.PointFType) -> Self:
                                                            """Append a point to the Series."""
                                                            self.append(datatypes.to_pointf(other))
                                                            return self
                                                    
                                                        def get_points(self) -> list[core.QPointF]:
                                                            if prettyqt.qt.API == "pyqt6":
                                                                return [self.at(i) for i in range(self.count())]
                                                            return self.points()
                                                    
                                                        def get_pen(self) -> gui.Pen:
                                                            return gui.Pen(self.pen())
                                                    
                                                        def get_brush(self) -> gui.Brush:
                                                            return gui.Brush(self.brush())
                                                    

                                                    __add__(other: datatypes.PointFType) -> Self

                                                    Append a point to the Series.

                                                    Source code in prettyqt/charts/xyseries.py
                                                    def __add__(self, other: datatypes.PointFType) -> Self:
                                                        """Append a point to the Series."""
                                                        self.append(datatypes.to_pointf(other))
                                                        return self
                                                    

                                                    __delitem__(index: int)

                                                    Remove point with given index.

                                                    Source code in prettyqt/charts/xyseries.py
                                                    def __delitem__(self, index: int):
                                                        """Remove point with given index."""
                                                        self.remove(index)
                                                    

                                                    __setitem__(index: int, val: datatypes.PointFType)

                                                    Set point at given index to value.

                                                    Source code in prettyqt/charts/xyseries.py
                                                    def __setitem__(self, index: int, val: datatypes.PointFType):
                                                        """Set point at given index to value."""
                                                        self.replace(index, datatypes.to_pointf(val))