![]() |
Gra zręcznościowa „Straszna Epidemia"
V1.2
Projekt Wizualizacja Danych Sensorycznych Kewin Gałuszka rok akademicki 2019/2020
|
Specialized axis ticker with a fixed tick step. Więcej...
#include <qcustomplot.h>
Typy publiczne | |
enum | ScaleStrategy { ssNone, ssMultiples, ssPowers } |
![]() | |
enum | TickStepStrategy { tssReadability, tssMeetTickCount } |
Metody publiczne | |
QCPAxisTickerFixed () | |
double | tickStep () const |
ScaleStrategy | scaleStrategy () const |
void | setTickStep (double step) |
void | setScaleStrategy (ScaleStrategy strategy) |
![]() | |
QCPAxisTicker () | |
virtual | ~QCPAxisTicker () |
TickStepStrategy | tickStepStrategy () const |
int | tickCount () const |
double | tickOrigin () const |
void | setTickStepStrategy (TickStepStrategy strategy) |
void | setTickCount (int count) |
void | setTickOrigin (double origin) |
virtual void | generate (const QCPRange &range, const QLocale &locale, QChar formatChar, int precision, QVector< double > &ticks, QVector< double > *subTicks, QVector< QString > *tickLabels) |
Metody chronione | |
virtual double | getTickStep (const QCPRange &range) Q_DECL_OVERRIDE |
![]() | |
virtual int | getSubTickCount (double tickStep) |
virtual QString | getTickLabel (double tick, const QLocale &locale, QChar formatChar, int precision) |
virtual QVector< double > | createTickVector (double tickStep, const QCPRange &range) |
virtual QVector< double > | createSubTickVector (int subTickCount, const QVector< double > &ticks) |
virtual QVector< QString > | createLabelVector (const QVector< double > &ticks, const QLocale &locale, QChar formatChar, int precision) |
void | trimTicks (const QCPRange &range, QVector< double > &ticks, bool keepOneOutlier) const |
double | pickClosest (double target, const QVector< double > &candidates) const |
double | getMantissa (double input, double *magnitude=0) const |
double | cleanMantissa (double input) const |
Atrybuty chronione | |
double | mTickStep |
ScaleStrategy | mScaleStrategy |
![]() | |
TickStepStrategy | mTickStepStrategy |
int | mTickCount |
double | mTickOrigin |
Specialized axis ticker with a fixed tick step.
This QCPAxisTicker subclass generates ticks with a fixed tick step set with setTickStep. It is also possible to allow integer multiples and integer powers of the specified tick step with setScaleStrategy.
A typical application of this ticker is to make an axis only display integers, by setting the tick step of the ticker to 1.0 and the scale strategy to ssMultiples.
Another case is when a certain number has a special meaning and axis ticks should only appear at multiples of that value. In this case you might also want to consider QCPAxisTickerPi because despite the name it is not limited to only pi symbols/values.
The ticker can be created and assigned to an axis like this:
Definicja w linii 1696 pliku qcustomplot.h.
Defines how the axis ticker may modify the specified tick step (setTickStep) in order to control the number of ticks in the axis range.
Wartości wyliczeń | |
---|---|
ssNone | Modifications are not allowed, the specified tick step is absolutely fixed. This might cause a high tick density and overlapping labels if the axis range is zoomed out. |
ssMultiples | An integer multiple of the specified tick step is allowed. The used factor follows the base class properties of setTickStepStrategy and setTickCount. |
ssPowers | An integer power of the specified tick step is allowed. |
Definicja w linii 1706 pliku qcustomplot.h.
QCPAxisTickerFixed::QCPAxisTickerFixed | ( | ) |
Constructs the ticker and sets reasonable default values. Axis tickers are commonly created managed by a QSharedPointer, which then can be passed to QCPAxis::setTicker.
Definicja w linii 6429 pliku qcustomplot.cpp.
|
protectedvirtual |
Reimplementowana z QCPAxisTicker.
Definicja w linii 6474 pliku qcustomplot.cpp.
|
inline |
Definicja w linii 1716 pliku qcustomplot.h.
void QCPAxisTickerFixed::setScaleStrategy | ( | QCPAxisTickerFixed::ScaleStrategy | strategy | ) |
Sets whether the specified tick step (setTickStep) is absolutely fixed or whether modifications may be applied to it before calculating the finally used tick step, such as permitting multiples or powers. See ScaleStrategy for details.
The default strategy is ssNone, which means the tick step is absolutely fixed.
Definicja w linii 6459 pliku qcustomplot.cpp.
void QCPAxisTickerFixed::setTickStep | ( | double | step | ) |
Sets the fixed tick interval to step.
The axis ticker will only use this tick step when generating axis ticks. This might cause a very high tick density and overlapping labels if the axis range is zoomed out. Using setScaleStrategy it is possible to relax the fixed step and also allow multiples or powers of step. This will enable the ticker to reduce the number of ticks to a reasonable amount (see setTickCount).
Definicja w linii 6444 pliku qcustomplot.cpp.
|
inline |
Definicja w linii 1715 pliku qcustomplot.h.
|
protected |
Definicja w linii 1725 pliku qcustomplot.h.
|
protected |
Definicja w linii 1724 pliku qcustomplot.h.