IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QAbstractAxis Class

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QAbstractAxis Class

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

flags QAbstractAxis::AxisTypes

This enum type specifies the type of the axis object.

Constant

QAbstractAxis::AxisTypeNoAxis

0x0

QAbstractAxis::AxisTypeValue

0x1

QAbstractAxis::AxisTypeBarCategory

0x2

QAbstractAxis::AxisTypeCategory

0x4

QAbstractAxis::AxisTypeDateTime

0x8

QAbstractAxis::AxisTypeLogValue

0x10

QAbstractAxis::AxisTypeColor

0x20

The AxisTypes type is a typedef for QFlags<AxisType>. It stores an OR combination of AxisType values.

Property Documentation

 

[read-only] 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:

  • alignment() const

color : QColor

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

Access functions:

  • linePenColor() const

  • void setLinePenColor( color)

Notifier signal:

gridLineColor : QColor

This property holds the color of the grid line.

Access functions:

  • gridLineColor()

  • void setGridLineColor(const &color)

Notifier signal:

gridLinePen : QPen

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

Access functions:

Notifier signal:

gridVisible : bool

This property holds the visibility of the grid lines.

Access functions:

  • bool isGridLineVisible() const

  • void setGridLineVisible(bool visible = true)

Notifier signal:

labelsAngle : int

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

Access functions:

  • int labelsAngle() const

  • void setLabelsAngle(int angle)

Notifier signal:

labelsBrush : QBrush

This property holds the brush used to draw the labels.

Only the color of the brush is relevant.

Access functions:

Notifier signal:

labelsColor : QColor

This property holds the color of the axis labels.

Access functions:

  • labelsColor() const

  • void setLabelsColor( color)

Notifier signal:

labelsFont : QFont

This property holds the font of the axis labels.

Access functions:

Notifier signal:

[read-only] labelsTruncated : const bool

Returns true if at least one label on the axis is truncated.

Returned value will not be accurate before the axis is shown.

Access functions:

  • bool labelsTruncated() const

Notifier signal:

labelsVisible : bool

This property holds whether axis labels are visible.

Access functions:

  • bool labelsVisible() const

  • void setLabelsVisible(bool visible = true)

Notifier signal:

linePen : QPen

This property holds the pen used to draw the line.

Access functions:

Notifier signal:

lineVisible : bool

This property holds the visibility of the axis line.

Access functions:

Notifier signal:

minorGridLineColor : QColor

This property holds the color of the minor grid line.

Applies only to axes that support minor grid lines.

Access functions:

  • minorGridLineColor()

  • void setMinorGridLineColor(const &color)

Notifier signal:

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:

  • minorGridLinePen() const

  • void setMinorGridLinePen(const &pen)

Notifier signal:

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:

[read-only] 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:

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:

  • shadesBorderColor() const

  • void setShadesBorderColor( color)

Notifier signal:

shadesBrush : QBrush

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

Access functions:

Notifier signal:

shadesColor : QColor

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

Access functions:

  • shadesColor() const

  • void setShadesColor( color)

Notifier signal:

shadesPen : QPen

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

Access functions:

Notifier signal:

shadesVisible : bool

This property holds the visibility of the axis shades.

Access functions:

  • bool shadesVisible() const

  • void setShadesVisible(bool visible = true)

Notifier signal:

titleBrush : QBrush

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

Only the color of the brush is relevant.

Access functions:

Notifier signal:

titleFont : QFont

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

Access functions:

Notifier signal:

titleText : QString

This property holds the title of the axis.

Empty by default. Axis titles support HTML formatting.

Access functions:

  • titleText() const

  • void setTitleText(const &title)

Notifier signal:

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:

truncateLabels : bool

This property holds the truncation state of labels.

Indicates whether labels should be truncated if there is no enough space for full text. It is equal to true by default.

Access functions:

  • bool truncateLabels() const

  • void setTruncateLabels(bool truncateLabels = true)

Notifier signal:

visible : bool

This property holds the visibility of the axis.

Access functions:

  • bool isVisible() const

  • void setVisible(bool visible = true)

Notifier signal:

Member Function Documentation

 

[virtual] QAbstractAxis::~QAbstractAxis()

Destructs the axis object. When the axis is added to a chart, the chart object takes ownership.

void QAbstractAxis::colorChanged(QColor color)

This signal is emitted when the color of the axis changes to color.

Notifier signal for property color.

void QAbstractAxis::gridLineColorChanged(const QColor &color)

This signal is emitted when the color of the pen used to draw the grid line changes to color.

Notifier signal for property gridLineColor.

QPen QAbstractAxis::gridLinePen() const

Returns the pen used to draw the grid.

Getter function for property gridLinePen.

See Also

See also setGridLinePen()

void QAbstractAxis::gridLinePenChanged(const QPen &pen)

This signal is emitted when the pen used to draw the grid line changes to pen.

Notifier signal for property gridLinePen.

void QAbstractAxis::gridVisibleChanged(bool visible)

This signal is emitted when the visibility of the grid lines of the axis changes to visible.

Notifier signal for property gridVisible.

void QAbstractAxis::hide()

Makes the axis, shades, labels, and grid lines invisible.

void QAbstractAxis::labelsAngleChanged(int angle)

This signal is emitted when the angle of the axis labels changes to angle.

Notifier signal for property labelsAngle.

QBrush QAbstractAxis::labelsBrush() const

Returns the brush used to draw labels.

Getter function for property labelsBrush.

See Also

See also setLabelsBrush()

void QAbstractAxis::labelsBrushChanged(const QBrush &brush)

This signal is emitted when the brush used to draw the axis labels changes to brush.

Notifier signal for property labelsBrush.

void QAbstractAxis::labelsColorChanged(QColor color)

This signal is emitted when the color of the axis labels changes to color.

Notifier signal for property labelsColor.

[since 5.13] bool QAbstractAxis::labelsEditable() const

Returns true if axis labels are editable.

This function was introduced in Qt 5.13.

See Also

See also setLabelsEditable()

[since 5.13] void QAbstractAxis::labelsEditableChanged(bool editable)

This signal is emitted when the editable state of the label changes.

This function was introduced in Qt 5.13.

QFont QAbstractAxis::labelsFont() const

Returns the font used to draw labels.

Getter function for property labelsFont.

See Also

See also setLabelsFont()

void QAbstractAxis::labelsFontChanged(const QFont &font)

This signal is emitted when the font of the axis labels changes to font.

Notifier signal for property labelsFont.

[since 6.2] void QAbstractAxis::labelsTruncatedChanged(bool labelsTruncated)

This signal is emitted in two cases; when the axis changes from having one or more truncated labels to having no truncated labels, and when the axis changes from having no truncated labels to having one or more truncated labels. Current state is identified by labelsTruncated.

Notifier signal for property labelsTruncated.

This function was introduced in Qt 6.2.

void QAbstractAxis::labelsVisibleChanged(bool visible)

This signal is emitted when the visibility of the labels of the axis changes to visible.

Notifier signal for property labelsVisible.

QPen QAbstractAxis::linePen() const

Returns the pen used to draw the axis line and tick marks.

Getter function for property linePen.

See Also

See also setLinePen()

void QAbstractAxis::linePenChanged(const QPen &pen)

This signal is emitted when the pen used to draw the line of the axis changes to pen.

Notifier signal for property linePen.

void QAbstractAxis::lineVisibleChanged(bool visible)

This signal is emitted when the visibility of the axis line changes to visible.

Notifier signal for property lineVisible.

void QAbstractAxis::minorGridLineColorChanged(const QColor &color)

This signal is emitted when the color of the pen used to draw the minor grid line changes to color.

Notifier signal for property minorGridLineColor.

void QAbstractAxis::minorGridLinePenChanged(const QPen &pen)

This signal is emitted when the pen used to draw the minor grid line changes to pen.

Notifier signal for property minorGridLinePen.

void QAbstractAxis::minorGridVisibleChanged(bool visible)

This signal is emitted when the visibility of the minor grid lines of the axis changes to visible.

Notifier signal for property minorGridVisible.

Qt::Orientation QAbstractAxis::orientation() const

Returns the orientation of the axis (vertical or horizontal).

Getter function for property orientation.

void QAbstractAxis::setGridLinePen(const QPen &pen)

Sets the pen used to draw the grid lines to pen.

Setter function for property gridLinePen.

See Also

See also gridLinePen()

void QAbstractAxis::setLabelsBrush(const QBrush &brush)

Sets the brush used to draw labels to brush.

Setter function for property labelsBrush.

See Also

See also labelsBrush()

[since 5.13] void QAbstractAxis::setLabelsEditable(bool editable = true)

Sets axis labels editability to editable.

When the labels are editable the user will be able to change the range of the axis conveniently by editing any of the labels. This feature is only supported for the QValueAxis and the QDateTimeAxis.

By default, labels are not editable.

This function was introduced in Qt 5.13.

See Also

See also labelsEditable()

void QAbstractAxis::setLabelsFont(const QFont &font)

Sets the font used to draw labels to font.

Setter function for property labelsFont.

See Also

See also labelsFont()

void QAbstractAxis::setLinePen(const QPen &pen)

Sets the pen used to draw the axis line and tick marks to pen.

Setter function for property linePen.

See Also

See also linePen()

void QAbstractAxis::setLineVisible(bool visible = true)

Determines whether the axis line and tick marks are visible.

Setter function for property lineVisible.

See Also

See also isLineVisible()

void QAbstractAxis::setMax(const QVariant &max)

Sets the maximum value shown on the axis. Depending on the actual axis type, the max parameter is converted to the appropriate type of value. If the conversion is impossible, the function call does nothing.

void QAbstractAxis::setMin(const QVariant &min)

Sets the minimum value shown on the axis. Depending on the actual axis type, the min parameter is converted to the appropriate type of value. If the conversion is impossible, the function call does nothing.

void QAbstractAxis::setRange(const QVariant &min, const QVariant &max)

Sets the range shown on the axis. Depending on the actual axis type, the min and max parameters are converted to appropriate types of values. If the conversion is impossible, the function call does nothing.

void QAbstractAxis::setShadesBrush(const QBrush &brush)

Sets the brush used to draw shades to brush.

Setter function for property shadesBrush.

See Also

See also shadesBrush()

void QAbstractAxis::setShadesPen(const QPen &pen)

Sets the pen used to draw shades to pen.

Setter function for property shadesPen.

See Also

See also shadesPen()

void QAbstractAxis::setTitleBrush(const QBrush &brush)

Sets the brush used to draw titles to brush.

Setter function for property titleBrush.

See Also

See also titleBrush()

void QAbstractAxis::setTitleFont(const QFont &font)

Sets the font used to draw titles to font.

Setter function for property titleFont.

See Also

See also titleFont()

void QAbstractAxis::setVisible(bool visible = true)

Sets the visibility of the axis, shades, labels, and grid lines to visible.

Setter function for property visible.

See Also

See also isVisible()

void QAbstractAxis::shadesBorderColorChanged(QColor color)

This signal is emitted when the border color of the axis shades changes to color.

Notifier signal for property shadesBorderColor.

QBrush QAbstractAxis::shadesBrush() const

Returns the brush used to draw shades.

Getter function for property shadesBrush.

See Also

See also setShadesBrush()

void QAbstractAxis::shadesBrushChanged(const QBrush &brush)

This signal is emitted when the brush used to draw the axis shades changes to brush.

Notifier signal for property shadesBrush.

void QAbstractAxis::shadesColorChanged(QColor color)

This signal is emitted when the color of the axis shades changes to color.

Notifier signal for property shadesColor.

QPen QAbstractAxis::shadesPen() const

Returns the pen used to draw shades.

Getter function for property shadesPen.

See Also

See also setShadesPen()

void QAbstractAxis::shadesPenChanged(const QPen &pen)

This signal is emitted when the pen used to draw the axis shades changes to pen.

Notifier signal for property shadesPen.

void QAbstractAxis::shadesVisibleChanged(bool visible)

This signal is emitted when the visibility of the axis shades changes to visible.

Notifier signal for property shadesVisible.

void QAbstractAxis::show()

Makes the axis, shades, labels, and grid lines visible.

QBrush QAbstractAxis::titleBrush() const

Returns the brush used to draw titles.

Getter function for property titleBrush.

See Also

See also setTitleBrush()

void QAbstractAxis::titleBrushChanged(const QBrush &brush)

This signal is emitted when the brush used to draw the axis title changes to brush.

Notifier signal for property titleBrush.

QFont QAbstractAxis::titleFont() const

Returns the font used to draw titles.

Getter function for property titleFont.

See Also

See also setTitleFont()

void QAbstractAxis::titleFontChanged(const QFont &font)

This signal is emitted when the font of the axis title changes to font.

Notifier signal for property titleFont.

void QAbstractAxis::titleTextChanged(const QString &text)

This signal is emitted when the text of the axis title changes to text.

Notifier signal for property titleText.

void QAbstractAxis::titleVisibleChanged(bool visible)

This signal is emitted when the visibility of the title text of the axis changes to visible.

Notifier signal for property titleVisible.

[since 6.2] void QAbstractAxis::truncateLabelsChanged(bool truncateLabels)

This signal is emitted when the truncation of the labels changes to truncateLabels.

Notifier signal for property truncateLabels.

This function was introduced in Qt 6.2.

[pure virtual] QAbstractAxis::AxisType QAbstractAxis::type() const

Returns the type of the axis.

void QAbstractAxis::visibleChanged(bool visible)

This signal is emitted when the visibility of the axis changes to visible.

Notifier signal for property visible.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+