Skip to content

BarCategoryAxis

Base classes

Name Children Inherits
AbstractAxisMixin
prettyqt.charts.abstractaxis
QBarCategoryAxis
PySide6.QtCharts
QBarCategoryAxis(self, /, parent: PySide6.QtCore.QObject | None \= None, *, categories: collections.abc.Sequence[str] | None \= None, min: str | None \= None, max: str | None \= None, count: int | None \= None) -> None

⋔ Inheritance diagram

graph TD
  426664105["charts.BarCategoryAxis"]
  1234850145["charts.AbstractAxisMixin"]
  3227531497["core.ObjectMixin"]
  2751680898["builtins.object"]
  3894317927["QtCharts.QBarCategoryAxis"]
  964990825["QtCharts.QAbstractAxis"]
  3984060476["QtCore.QObject"]
  37984305["Shiboken.Object"]
  1234850145 --> 426664105
  3227531497 --> 1234850145
  2751680898 --> 3227531497
  2751680898 --> 1234850145
  3894317927 --> 426664105
  964990825 --> 3894317927
  3984060476 --> 964990825
  37984305 --> 3984060476
  2751680898 --> 37984305

🛈 DocStrings

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)

:fa-brands-github: Show source on GitHub