QValueAxis

The QValueAxis class adds values to a chart’s axes. More

Inheritance diagram of PySide6.QtCharts.QValueAxis

Inherited by: QCategoryAxis

Synopsis

Functions

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

parentPySide6.QtCore.QObject

Constructs an axis object that is a child of parent.

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 and tickInterval 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.

PySide6.QtCharts.QValueAxis.labelFormat()
Return type

str

See also

setLabelFormat()

PySide6.QtCharts.QValueAxis.labelFormatChanged(format)
Parameters

format – str

PySide6.QtCharts.QValueAxis.max()
Return type

float

See also

setMax()

PySide6.QtCharts.QValueAxis.maxChanged(max)
Parameters

max – float

PySide6.QtCharts.QValueAxis.min()
Return type

float

See also

setMin()

PySide6.QtCharts.QValueAxis.minChanged(min)
Parameters

min – float

PySide6.QtCharts.QValueAxis.minorTickCount()
Return type

int

PySide6.QtCharts.QValueAxis.minorTickCountChanged(tickCount)
Parameters

tickCount – int

PySide6.QtCharts.QValueAxis.rangeChanged(min, max)
Parameters
  • min – float

  • max – float

PySide6.QtCharts.QValueAxis.setLabelFormat(format)
Parameters

format – str

See also

labelFormat()

PySide6.QtCharts.QValueAxis.setMax(max)
Parameters

max – float

See also

max()

PySide6.QtCharts.QValueAxis.setMin(min)
Parameters

min – float

See also

min()

PySide6.QtCharts.QValueAxis.setMinorTickCount(count)
Parameters

count – int

See also

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

tickAnchor()

PySide6.QtCharts.QValueAxis.setTickCount(count)
Parameters

count – int

See also

tickCount()

PySide6.QtCharts.QValueAxis.setTickInterval(insterval)
Parameters

insterval – float

See also

tickInterval()

PySide6.QtCharts.QValueAxis.setTickType(type)
Parameters

typeTickType

See also

tickType()

PySide6.QtCharts.QValueAxis.tickAnchor()
Return type

float

See also

setTickAnchor()

PySide6.QtCharts.QValueAxis.tickAnchorChanged(anchor)
Parameters

anchor – float

PySide6.QtCharts.QValueAxis.tickCount()
Return type

int

See also

setTickCount()

PySide6.QtCharts.QValueAxis.tickCountChanged(tickCount)
Parameters

tickCount – int

PySide6.QtCharts.QValueAxis.tickInterval()
Return type

float

PySide6.QtCharts.QValueAxis.tickIntervalChanged(interval)
Parameters

interval – float

PySide6.QtCharts.QValueAxis.tickType()
Return type

TickType

See also

setTickType()

PySide6.QtCharts.QValueAxis.tickTypeChanged(type)
Parameters

typeTickType