QValueAxis#
The QValueAxis
class adds values to a chart’s axes. More…
Inherited by: QCategoryAxis
Synopsis#
Properties#
labelFormat
- Label format of the axismax
- Maximum value on the axismin
- Minimum value on the axisminorTickCount
- Number of minor tick marks on the axis. This indicates how many grid lines are drawn between major ticks on the chart. Labels are not drawn for minor ticks. The default value is 0tickAnchor
- Base value where the dynamically placed tick marks and labels are started fromtickCount
- Number of tick marks on the axis. This indicates how many grid lines are drawn on the chart. The default value is 5, and the number cannot be less than 2tickInterval
- Interval between dynamically placed tick marks and labelstickType
- Positioning method of tick and labels
Functions#
def
labelFormat
()def
max
()def
min
()def
minorTickCount
()def
setLabelFormat
(format)def
setMax
(max)def
setMin
(min)def
setMinorTickCount
(count)def
setRange
(min, max)def
setTickAnchor
(anchor)def
setTickCount
(count)def
setTickInterval
(insterval)def
setTickType
(type)def
tickAnchor
()def
tickCount
()def
tickInterval
()def
tickType
()
Slots#
def
applyNiceNumbers
()
Signals#
def
labelFormatChanged
(format)def
maxChanged
(max)def
minChanged
(min)def
minorTickCountChanged
(tickCount)def
rangeChanged
(min, max)def
tickAnchorChanged
(anchor)def
tickCountChanged
(tickCount)def
tickIntervalChanged
(interval)def
tickTypeChanged
(type)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
A value axis can be set up to show an axis line with tick marks, grid lines, and shades. The values on the axis are drawn at the positions of tick marks.
The following example code illustrates how to use the QValueAxis
class:
QChartView *chartView = new QChartView; QLineSeries *series = new QLineSeries; // ... chartView->chart()->addSeries(series); QValueAxis *axisX = new QValueAxis; axisX->setRange(10, 20.5); axisX->setTickCount(10); axisX->setLabelFormat("%.2f"); chartView->chart()->setAxisX(axisX, series);
- class PySide6.QtCharts.QValueAxis([parent=None])#
- Parameters:
parent –
PySide6.QtCore.QObject
Constructs an axis object that is a child of parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtCharts.QValueAxis.labelFormat: str#
This property holds The label format of the axis..
The format string supports the following conversion specifiers, length modifiers, and flags provided by printf()
in the standard C++ library: d, i, o, x, X, f, F, e, E, g, G, c.
If localizeNumbers
is true
, the supported specifiers are limited to: d, e, E, f, g, G, and i. Also, only the precision modifier is supported. The rest of the formatting comes from the default QLocale
of the application.
See also
asprintf()
- Access functions:
labelFormat
()setLabelFormat
(format)Signal
labelFormatChanged
(format)
- property PᅟySide6.QtCharts.QValueAxis.max: float#
This property holds The maximum value on the axis..
When setting this property, the minimum value is adjusted if necessary, to ensure that the range remains valid.
- Access functions:
max
()setMax
(max)Signal
maxChanged
(max)
- property PᅟySide6.QtCharts.QValueAxis.min: float#
This property holds The minimum value on the axis..
When setting this property, the maximum value is adjusted if necessary, to ensure that the range remains valid.
- Access functions:
min
()setMin
(min)Signal
minChanged
(min)
- property PᅟySide6.QtCharts.QValueAxis.minorTickCount: int#
This property holds The number of minor tick marks on the axis. This indicates how many grid lines are drawn between major ticks on the chart. Labels are not drawn for minor ticks. The default value is 0..
- Access functions:
setMinorTickCount
(count)Signal
minorTickCountChanged
(tickCount)
- property PᅟySide6.QtCharts.QValueAxis.tickAnchor: float#
This property holds The base value where the dynamically placed tick marks and labels are started from..
- Access functions:
tickAnchor
()setTickAnchor
(anchor)Signal
tickAnchorChanged
(anchor)
- property PᅟySide6.QtCharts.QValueAxis.tickCount: int#
This property holds The number of tick marks on the axis. This indicates how many grid lines are drawn on the chart. The default value is 5, and the number cannot be less than 2..
- Access functions:
tickCount
()setTickCount
(count)Signal
tickCountChanged
(tickCount)
- property PᅟySide6.QtCharts.QValueAxis.tickInterval: float#
This property holds The interval between dynamically placed tick marks and labels..
- Access functions:
tickInterval
()setTickInterval
(insterval)Signal
tickIntervalChanged
(interval)
- property PᅟySide6.QtCharts.QValueAxis.tickType: TickType#
This property holds The positioning method of tick and labels..
- Access functions:
tickType
()setTickType
(type)Signal
tickTypeChanged
(type)
- PySide6.QtCharts.QValueAxis.TickType#
This enum describes how the ticks and labels are positioned on the axis.
Constant
Description
QValueAxis.TicksDynamic
Ticks are placed according to
tickAnchor
andtickInterval
values.QValueAxis.TicksFixed
Ticks are placed evenly across the axis range. The
tickCount
value specifies the number of ticks.
- PySide6.QtCharts.QValueAxis.applyNiceNumbers()#
Modifies the current range and number of tick marks on the axis to look nice. The algorithm considers numbers that can be expressed as a form of 1*10^n, 2* 10^n, or 5*10^n to be nice numbers. These numbers are used for setting spacing for the tick marks.
See also
- PySide6.QtCharts.QValueAxis.labelFormat()#
- Return type:
str
See also
Getter of property labelFormat
.
- PySide6.QtCharts.QValueAxis.labelFormatChanged(format)#
- Parameters:
format – str
This signal is emitted when the format
of axis labels changes.
Notification signal of property labelFormat
.
Getter of property max
.
- PySide6.QtCharts.QValueAxis.maxChanged(max)#
- Parameters:
max – float
This signal is emitted when the maximum value of the axis, specified by max
, changes.
Notification signal of property max
.
Getter of property min
.
- PySide6.QtCharts.QValueAxis.minChanged(min)#
- Parameters:
min – float
This signal is emitted when the minimum value of the axis, specified by min
, changes.
Notification signal of property min
.
- PySide6.QtCharts.QValueAxis.minorTickCount()#
- Return type:
int
See also
Getter of property minorTickCount
.
- PySide6.QtCharts.QValueAxis.minorTickCountChanged(tickCount)#
- Parameters:
tickCount – int
This signal is emitted when the number of minor tick marks on the axis, specified by minorTickCount
, changes.
Notification signal of property minorTickCount
.
- PySide6.QtCharts.QValueAxis.rangeChanged(min, max)#
- Parameters:
min – float
max – float
This signal is emitted when the minimum or maximum value of the axis, specified by min
and max
, changes.
- PySide6.QtCharts.QValueAxis.setLabelFormat(format)#
- Parameters:
format – str
See also
Setter of property labelFormat
.
Setter of property max
.
Setter of property min
.
- PySide6.QtCharts.QValueAxis.setMinorTickCount(count)#
- Parameters:
count – int
See also
Setter of property minorTickCount
.
- PySide6.QtCharts.QValueAxis.setRange(min, max)#
- Parameters:
min – float
max – float
Sets the range from min
to max
on the axis. If min
is greater than max
, this function returns without making any changes.
- PySide6.QtCharts.QValueAxis.setTickAnchor(anchor)#
- Parameters:
anchor – float
See also
Setter of property tickAnchor
.
- PySide6.QtCharts.QValueAxis.setTickCount(count)#
- Parameters:
count – int
See also
Setter of property tickCount
.
- PySide6.QtCharts.QValueAxis.setTickInterval(insterval)#
- Parameters:
insterval – float
See also
Setter of property tickInterval
.
Setter of property tickType
.
- PySide6.QtCharts.QValueAxis.tickAnchor()#
- Return type:
float
See also
Getter of property tickAnchor
.
- PySide6.QtCharts.QValueAxis.tickAnchorChanged(anchor)#
- Parameters:
anchor – float
Notification signal of property tickAnchor
.
- PySide6.QtCharts.QValueAxis.tickCount()#
- Return type:
int
See also
Getter of property tickCount
.
- PySide6.QtCharts.QValueAxis.tickCountChanged(tickCount)#
- Parameters:
tickCount – int
This signal is emitted when the number of tick marks on the axis, specified by tickCount
, changes.
Notification signal of property tickCount
.
- PySide6.QtCharts.QValueAxis.tickInterval()#
- Return type:
float
See also
Getter of property tickInterval
.
- PySide6.QtCharts.QValueAxis.tickIntervalChanged(interval)#
- Parameters:
interval – float
Notification signal of property tickInterval
.
- PySide6.QtCharts.QValueAxis.tickType()#
- Return type:
See also
Getter of property tickType
.
Notification signal of property tickType
.