Skip to content

AbstractBarSeriesMixin

Base classes

Name Children Inherits
AbstractSeriesMixin
prettyqt.charts.abstractseries

Subclasses

Class Module Description
AbstractBarSeries prettyqt.charts.abstractbarseries
BarSeries prettyqt.charts.barseries
PercentBarSeries prettyqt.charts.percentbarseries
HorizontalBarSeries prettyqt.charts.horizontalbarseries
HorizontalPercentBarSeries prettyqt.charts.horizontalpercentbarseries
StackedBarSeries prettyqt.charts.stackedbarseries
HorizontalStackedBarSeries prettyqt.charts.horizontalstackedbarseries

⋔ Inheritance diagram

graph TD
  1473367682000["charts.AbstractBarSeriesMixin"]
  1473367658576["charts.AbstractSeriesMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473367658576 --> 1473367682000
  1473299815024 --> 1473367658576
  140713234304496 --> 1473299815024

🛈 DocStrings

Bases: AbstractSeriesMixin

Source code in prettyqt\charts\abstractbarseries.py
class AbstractBarSeriesMixin(charts.AbstractSeriesMixin):
    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))