Class QAccelPlot::NumericTickLabelFormatter¶
ClassList > QAccelPlot > NumericTickLabelFormatter
The default tick label formatter — produces numeric labels with automatic decimal precision. More...
#include <NumericTickLabelFormatter.hpp>
Inherits the following classes: QAccelPlot::TickLabelFormatter
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1NumericTickLabelFormatter["QAccelPlot::NumericTickLabelFormatter"]
classQAccelPlot_1_1TickLabelFormatter["QAccelPlot::TickLabelFormatter"]
classQAccelPlot_1_1TickLabelFormatter --> classQAccelPlot_1_1NumericTickLabelFormatter
click classQAccelPlot_1_1TickLabelFormatter "../classQAccelPlot_1_1TickLabelFormatter/" "Open QAccelPlot::TickLabelFormatter"
external_base_classQAccelPlot_1_1TickLabelFormatter_1["QObject"]
external_base_classQAccelPlot_1_1TickLabelFormatter_1 --> classQAccelPlot_1_1TickLabelFormatter
Public Properties inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| property QML_ANONYMOUSQJSValue | tickLabel Optional JavaScript callback function(value, tickStep) that overridesdoFormat() . |
Public Signals inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| signal void | formatChanged Emitted whenever a property that affects formatted output changes. |
| signal void | tickLabelChanged Emitted when the tickLabel property changes. |
Public Functions¶
| Type | Name |
|---|---|
| NumericTickLabelFormatter (QObject * parent=nullptr) Constructs a NumericTickLabelFormatter with the given__parent . |
Public Functions inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| TickLabelFormatter (QObject * parent=nullptr) Constructs an TickLabelFormatter with the given__parent . |
|
| QString | format (qreal value, qreal tickStep) const Returns the display string for value at the given__tickStep . |
| QString | formatLogTick (qreal value) const Returns the display string for a major tick at value on a logarithmic axis. |
| virtual qreal | minimumTickStep () const Returns the smallest major tick step a linear axis may use with this formatter. |
| void | setTickLabel (const QJSValue & tickLabel) Sets the JavaScript override callback to tickLabel . |
| QJSValue | tickLabel () const Returns the optional JavaScript override callback. |
Protected Functions¶
| Type | Name |
|---|---|
| virtual QString | doFormat (qreal value, qreal tickStep) override const Returns a numeric string for value , precision matched to__tickStep . |
| virtual QString | doFormatLogTick (qreal value) override const Returns a decade tick as a superscript power of ten, for example "10²" for 100. |
Protected Functions inherited from QAccelPlot::TickLabelFormatter¶
See QAccelPlot::TickLabelFormatter
| Type | Name |
|---|---|
| virtual QString | doFormat (qreal value, qreal tickStep) const = 0 Subclass entry point — returns the formatted label for value . |
| virtual QString | doFormatLogTick (qreal value) const Subclass entry point for log-scale major ticks — returns the label for value . |
Detailed Description¶
The number of decimal places is derived from tickStep so that labels are neither truncated nor cluttered with unnecessary digits. Every label on a linear axis shares one tick step, so all of them show the same number of decimal places (for example 0.0, 0.5, 1.0, 1.5). Decade ticks on a logarithmic axis use superscript powers of ten (10⁻¹, 10⁰, 10¹, 10²).
See also: DateTimeTickLabelFormatter, TickLabelFormatter
Public Functions Documentation¶
function NumericTickLabelFormatter¶
Constructs a NumericTickLabelFormatter with the given__parent .
explicit QAccelPlot::NumericTickLabelFormatter::NumericTickLabelFormatter (
QObject * parent=nullptr
)
Protected Functions Documentation¶
function doFormat¶
Returns a numeric string for value , precision matched to__tickStep .
virtual QString QAccelPlot::NumericTickLabelFormatter::doFormat (
qreal value,
qreal tickStep
) override const
Implements QAccelPlot::TickLabelFormatter::doFormat
function doFormatLogTick¶
Returns a decade tick as a superscript power of ten, for example "10²" for 100.
virtual QString QAccelPlot::NumericTickLabelFormatter::doFormatLogTick (
qreal value
) override const
Implements QAccelPlot::TickLabelFormatter::doFormatLogTick
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/formatters/NumericTickLabelFormatter.hpp