QAbstractAxis Class

The QAbstractAxis class is a base class used for specialized axis classes. More...

Header: #include <QAbstractAxis>
Instantiated By: AbstractAxis
Inherits: QObject
Inherited By:

QBarCategoryAxis, QDateTimeAxis, QLogValueAxis, and QValueAxis

Public Types

enum AxisType { AxisTypeNoAxis, AxisTypeValue, AxisTypeBarCategory, AxisTypeCategory, AxisTypeDateTime, AxisTypeLogValue }

Properties

Public Functions

Qt::Alignment alignment() const
QColor gridLineColor()
QPen gridLinePen() const
bool isGridLineVisible() const
bool isLineVisible() const
bool isMinorGridLineVisible() const
bool isReverse() const
bool isTitleVisible() const
bool isVisible() const
int labelsAngle() const
QBrush labelsBrush() const
QColor labelsColor() const
QFont labelsFont() const
bool labelsVisible() const
QPen linePen() const
QColor linePenColor() const
QColor minorGridLineColor()
QPen minorGridLinePen() const
Qt::Orientation orientation() const
void setGridLineColor(const QColor &color)
void setGridLinePen(const QPen &pen)
void setGridLineVisible(bool visible = true)
void setLabelsAngle(int angle)
void setLabelsBrush(const QBrush &brush)
void setLabelsColor(QColor color)
void setLabelsFont(const QFont &font)
void setLabelsVisible(bool visible = true)
void setLinePen(const QPen &pen)
void setLinePenColor(QColor color)
void setLineVisible(bool visible = true)
void setMinorGridLineColor(const QColor &color)
void setMinorGridLinePen(const QPen &pen)
void setMinorGridLineVisible(bool visible = true)
void setReverse(bool reverse = true)
void setShadesBorderColor(QColor color)
void setShadesBrush(const QBrush &brush)
void setShadesColor(QColor color)
void setShadesPen(const QPen &pen)
void setShadesVisible(bool visible = true)
void setTitleBrush(const QBrush &brush)
void setTitleFont(const QFont &font)
void setTitleText(const QString &title)
void setTitleVisible(bool visible = true)
void setVisible(bool visible = true)
QColor shadesBorderColor() const
QBrush shadesBrush() const
QColor shadesColor() const
QPen shadesPen() const
bool shadesVisible() const
QBrush titleBrush() const
QFont titleFont() const
QString titleText() const

Signals

void colorChanged(QColor color)
void gridLineColorChanged(const QColor &color)
void gridLinePenChanged(const QPen &pen)
void gridVisibleChanged(bool visible)
void labelsAngleChanged(int angle)
void labelsBrushChanged(const QBrush &brush)
void labelsColorChanged(QColor color)
void labelsFontChanged(const QFont &pen)
void labelsVisibleChanged(bool visible)
void linePenChanged(const QPen &pen)
void lineVisibleChanged(bool visible)
void minorGridLineColorChanged(const QColor &color)
void minorGridLinePenChanged(const QPen &pen)
void minorGridVisibleChanged(bool visible)
void reverseChanged(bool reverse)
void shadesBorderColorChanged(QColor color)
void shadesBrushChanged(const QBrush &brush)
void shadesColorChanged(QColor color)
void shadesPenChanged(const QPen &pen)
void shadesVisibleChanged(bool visible)
void titleBrushChanged(const QBrush &brush)
void titleFontChanged(const QFont &font)
void titleTextChanged(const QString &title)
void titleVisibleChanged(bool visible)
void visibleChanged(bool visible)

Detailed Description

Each series can be bound to one or more horizontal and vertical axes, but mixing axis types that would result in different domains is not supported, such as specifying QValueAxis and QLogValueAxis on the same orientation.

The properties and visibility of various axis elements, such as axis line, title, labels, grid lines, and shades, can be individually controlled.

Member Type Documentation

enum QAbstractAxis::AxisType

This enum type specifies the type of the axis object.

ConstantValue
QAbstractAxis::AxisTypeNoAxis0x0
QAbstractAxis::AxisTypeValue0x1
QAbstractAxis::AxisTypeBarCategory0x2
QAbstractAxis::AxisTypeCategory0x4
QAbstractAxis::AxisTypeDateTime0x8
QAbstractAxis::AxisTypeLogValue0x10

Property Documentation

alignment : const Qt::Alignment

This property holds the alignment of the axis.

Can be Qt::AlignLeft, Qt::AlignRight, Qt::AlignBottom, or Qt::AlignTop.

Access functions:

Qt::Alignment alignment() const

color : QColor

This property holds the color of the axis and tick marks.

Access functions:

QColor linePenColor() const
void setLinePenColor(QColor color)

Notifier signal:

void colorChanged(QColor color)

gridLineColor : QColor

This property holds the color of the grid line.

Access functions:

QColor gridLineColor()
void setGridLineColor(const QColor &color)

Notifier signal:

void gridLineColorChanged(const QColor &color)

gridLinePen : QPen

This property holds the pen used to draw the grid line.

Access functions:

QPen gridLinePen() const
void setGridLinePen(const QPen &pen)

Notifier signal:

void gridLinePenChanged(const QPen &pen)

gridVisible : bool

This property holds the visibility of the grid lines.

Access functions:

bool isGridLineVisible() const
void setGridLineVisible(bool visible = true)

Notifier signal:

void gridVisibleChanged(bool visible)

labelsAngle : int

This property holds the angle of the axis labels in degrees.

Access functions:

int labelsAngle() const
void setLabelsAngle(int angle)

Notifier signal:

void labelsAngleChanged(int angle)

labelsBrush : QBrush

This property holds the brush used to draw the labels.

Only the color of the brush is relevant.

Access functions:

QBrush labelsBrush() const
void setLabelsBrush(const QBrush &brush)

Notifier signal:

void labelsBrushChanged(const QBrush &brush)

labelsColor : QColor

This property holds the color of the axis labels.

Access functions:

QColor labelsColor() const
void setLabelsColor(QColor color)

Notifier signal:

void labelsColorChanged(QColor color)

labelsFont : QFont

This property holds the font of the axis labels.

Access functions:

QFont labelsFont() const
void setLabelsFont(const QFont &font)

Notifier signal:

void labelsFontChanged(const QFont &pen)

labelsVisible : bool

This property holds whether axis labels are visible.

Access functions:

bool labelsVisible() const
void setLabelsVisible(bool visible = true)

Notifier signal:

void labelsVisibleChanged(bool visible)

linePen : QPen

This property holds the pen used to draw the line.

Access functions:

QPen linePen() const
void setLinePen(const QPen &pen)

Notifier signal:

void linePenChanged(const QPen &pen)

lineVisible : bool

This property holds the visibility of the axis line.

Access functions:

bool isLineVisible() const
void setLineVisible(bool visible = true)

Notifier signal:

void lineVisibleChanged(bool visible)

minorGridLineColor : QColor

This property holds the color of the minor grid line.

Applies only to axes that support minor grid lines.

Access functions:

QColor minorGridLineColor()
void setMinorGridLineColor(const QColor &color)

Notifier signal:

void minorGridLineColorChanged(const QColor &color)

minorGridLinePen : QPen

This property holds the pen used to draw the minor grid line.

Applies only to axes that support minor grid lines.

Access functions:

QPen minorGridLinePen() const
void setMinorGridLinePen(const QPen &pen)

Notifier signal:

void minorGridLinePenChanged(const QPen &pen)

minorGridVisible : bool

This property holds the visibility of the minor grid lines.

Applies only to axes that support minor grid lines.

Access functions:

bool isMinorGridLineVisible() const
void setMinorGridLineVisible(bool visible = true)

Notifier signal:

void minorGridVisibleChanged(bool visible)

orientation : const Qt::Orientation

This property holds the orientation of the axis.

Fixed to either Qt::Horizontal or Qt::Vertical when the axis is added to a chart.

Access functions:

Qt::Orientation orientation() const

reverse : bool

This property holds whether a reverse axis is used.

By default, the value is false.

The reverse axis is supported with a line, spline, and scatter series, as well as an area series with a cartesian chart. All axes of the same orientation attached to the same series must be reversed if one is reversed or the behavior is undefined.

Access functions:

bool isReverse() const
void setReverse(bool reverse = true)

Notifier signal:

void reverseChanged(bool reverse)

shadesBorderColor : QColor

This property holds the border (pen) color of the axis shades.

Access functions:

QColor shadesBorderColor() const
void setShadesBorderColor(QColor color)

Notifier signal:

void shadesBorderColorChanged(QColor color)

shadesBrush : QBrush

This property holds the brush used to draw the axis shades (the area between the grid lines).

Access functions:

QBrush shadesBrush() const
void setShadesBrush(const QBrush &brush)

Notifier signal:

void shadesBrushChanged(const QBrush &brush)

shadesColor : QColor

This property holds the fill (brush) color of the axis shades.

Access functions:

QColor shadesColor() const
void setShadesColor(QColor color)

Notifier signal:

void shadesColorChanged(QColor color)

shadesPen : QPen

This property holds the pen used to draw the axis shades (the area between the grid lines).

Access functions:

QPen shadesPen() const
void setShadesPen(const QPen &pen)

Notifier signal:

void shadesPenChanged(const QPen &pen)

shadesVisible : bool

This property holds the visibility of the axis shades.

Access functions:

bool shadesVisible() const
void setShadesVisible(bool visible = true)

Notifier signal:

void shadesVisibleChanged(bool visible)

titleBrush : QBrush

This property holds the brush used to draw the title text.

Only the color of the brush is relevant.

Access functions:

QBrush titleBrush() const
void setTitleBrush(const QBrush &brush)

Notifier signal:

void titleBrushChanged(const QBrush &brush)

titleFont : QFont

This property holds the font of the title of the axis.

Access functions:

QFont titleFont() const
void setTitleFont(const QFont &font)

Notifier signal:

void titleFontChanged(const QFont &font)

titleText : QString

This property holds the title of the axis.

Empty by default. Axis titles support HTML formatting.

Access functions:

QString titleText() const
void setTitleText(const QString &title)

Notifier signal:

void titleTextChanged(const QString &title)

titleVisible : bool

This property holds the visibility of the axis title.

By default, the value is true.

Access functions:

bool isTitleVisible() const
void setTitleVisible(bool visible = true)

Notifier signal:

void titleVisibleChanged(bool visible)

visible : bool

This property holds the visibility of the axis.

Access functions:

bool isVisible() const
void setVisible(bool visible = true)

Notifier signal:

void visibleChanged(bool visible)