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
get_alignment() -> constants.SideStr | None
Return current alignment.
Source code in prettyqt/charts/abstractaxis.py
get_orientation() -> constants.OrientationStr | None
Return current orientation.
Source code in prettyqt/charts/abstractaxis.py
AbstractBarSeriesMixin
Bases: AbstractSeriesMixin, _AbstractBarSeriesBase
Source code in prettyqt/charts/abstractbarseries.py
__delitem__(item: int | charts.QBarSet)
__getitem__(index: int) -> charts.QBarSet
get_labels_position() -> LabelsPositionStr
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
BarCategoryAxis
Bases: AbstractAxisMixin, QBarCategoryAxis
Source code in prettyqt/charts/barcategoryaxis.py
__add__(other: str) -> BarCategoryAxis
__delitem__(index: str)
__getitem__(index: int) -> str
BarSet
Bases: ObjectMixin, QBarSet
Source code in prettyqt/charts/barset.py
__delitem__(index: int)
__getitem__(index: int) -> float
BoxSet
Bases: ObjectMixin, QBoxSet
Source code in prettyqt/charts/boxset.py
__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
__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
CategoryAxis
Bases: ValueAxisMixin, QCategoryAxis
Source code in prettyqt/charts/categoryaxis.py
__add__(other: tuple[str, int]) -> CategoryAxis
__delitem__(index: str)
__getitem__(label: int | slice) -> str | list[str]
__iter__() -> Iterator[str]
__len__()
__setitem__(index: str, value: str)
get_labels_position() -> LabelsPositionStr
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
ChartMixin
Bases: GraphicsWidgetMixin, _ChartBase
Source code in prettyqt/charts/chart.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |
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
apply_nice_numbers()
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
set_legend_alignment(alignment: constants.SideStr | constants.AlignmentFlag)
update_boundaries()
Set new min/max values based on the value axes.
Source code in prettyqt/charts/chart.py
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
ChartView
Bases: GraphicsViewMixin, QChartView
Source code in prettyqt/charts/chartview.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
get_chart() -> charts.Chart
get_rubber_band() -> RubberBandStr
Return current rubber band type.
Source code in prettyqt/charts/chartview.py
get_rubber_bands() -> list[RubberBandStr]
Return active rubber band flags.
Source code in prettyqt/charts/chartview.py
keyPressEvent(event: gui.QKeyEvent)
Handle keypress events to allow navigation via keyboard.
Source code in prettyqt/charts/chartview.py
mouseMoveEvent(event: gui.QMouseEvent)
Override to allow dragging the chart.
Source code in prettyqt/charts/chartview.py
mousePressEvent(event: gui.QMouseEvent)
Override to allow dragging the chart.
Source code in prettyqt/charts/chartview.py
mouseReleaseEvent(event: gui.QMouseEvent)
Override to allow dragging the chart.
Source code in prettyqt/charts/chartview.py
save_as_image()
Let user choose folder and save chart as an image file.
Source code in prettyqt/charts/chartview.py
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 |
wheelEvent(event: gui.QWheelEvent)
DateTimeAxis
Bases: AbstractAxisMixin, QDateTimeAxis
Source code in prettyqt/charts/datetimeaxis.py
set_max(maximum: datatypes.DateTimeType)
set_min(minimum: datatypes.DateTimeType)
set_range(minimum: datatypes.DateTimeType, maximum: datatypes.DateTimeType)
Legend
Bases: GraphicsWidgetMixin
Source code in prettyqt/charts/legend.py
get_alignment() -> constants.SideStr
get_marker_shape() -> MarkerShapeStr
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 |
set_marker_shape(shape: MarkerShapeStr)
Set the marker shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
MarkerShapeStr
|
marker shape |
required |
LineSeries
Bases: XYSeriesMixin, QLineSeries
QLineSeries with some custom properties.
Source code in prettyqt/charts/lineseries.py
PieSlice
Bases: ObjectMixin, QPieSlice
Source code in prettyqt/charts/pieslice.py
get_label_position() -> LabelPositionStr
set_label_position(position: LabelPositionStr | QtCharts.QPieSlice.LabelPosition)
Set the label position.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
LabelPositionStr | LabelPosition
|
label position |
required |
PolarChart
Bases: ChartMixin, QPolarChart
Source code in prettyqt/charts/polarchart.py
add_axis(axis: charts.QAbstractAxis, orientation: PolarOrientationStr | charts.QPolarChart.PolarOrientation)
Add axis with given orientation.
ValueAxisMixin
Bases: AbstractAxisMixin, _ValueAxisBase
Source code in prettyqt/charts/valueaxis.py
get_tick_type() -> TickTypeStr
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 |
XYSeriesMixin
Bases: AbstractSeriesMixin, _XYSeriesBase