23#ifndef JKQTPCOORDINATEAXES_H
24#define JKQTPCOORDINATEAXES_H
31#include "jkqtplotter/jkqtptools.h"
32#include "jkqtmathtext/jkqtmathtext.h"
33#include "jkqtplotter/jkqtplotter_imexport.h"
34#include "jkqtplotter/jkqtpcoordinateaxesstyle.h"
192 virtual void loadSettings(
const QSettings &settings,
const QString& group=QString(
"plots/axes/"));
198 virtual void saveSettings(QSettings& settings,
const QString& group=QString(
"plots/axes/"))
const;
202 inline double x2p(
double x)
const {
205 if (x<=0) r= offset+scaleSign*log(axismin)/log(logAxisBase)*scale;
206 else r= offset+scaleSign*log(x)/log(logAxisBase)*scale;
208 r= offset+scaleSign*x*scale;
211 return 2.0*getParentPlotOffset()+getParentPlotWidth()-r;
218 inline double p2x(
double x)
const {
221 xx=2.0*getParentPlotOffset()+getParentPlotWidth()-x;
225 return exp(log(logAxisBase)*(xx)/(scaleSign*scale));
227 return xx/(scaleSign*scale);
251 inline AxisElementsSizeDescription(
double _requiredSize=0.0,
double _elongateMin=0.0,
double _elongateMax=0.0): requiredSize(_requiredSize), elongateMin(_elongateMin), elongateMax(_elongateMax) {}
328 inline unsigned int getMinTicks()
const {
return this->axisStyle.minTicks; }
330 inline unsigned int getMinorTicks()
const {
return this->axisStyle.minorTicks; }
338 inline QColor
getAxisColor()
const {
return this->axisStyle.axisColor; }
346 inline QColor
getTickColor()
const {
return this->axisStyle.tickColor; }
352 inline QColor
getGridColor()
const {
return this->axisStyle.majorGridStyle.lineColor; }
356 inline double getGridWidth()
const {
return this->axisStyle.majorGridStyle.lineWidth; }
358 inline Qt::PenStyle
getGridStyle()
const {
return this->axisStyle.majorGridStyle.lineStyle; }
362 inline Qt::PenStyle
getMinorGridStyle()
const {
return this->axisStyle.minorGridStyle.lineStyle; }
373#if __cplusplus >= 202002L || DOXYGEN
374# if defined(__cpp_lib_format) || DOXYGEN
389 inline double getTickWidth()
const {
return this->axisStyle.tickWidth; }
391 inline double getLineWidth()
const {
return this->axisStyle.lineWidth; }
399 inline bool getDrawGrid()
const {
return this->axisStyle.majorGridStyle.enabled; }
405 this->axisStyle.autoLabelDigits = __value;
410 return this->axisStyle.autoLabelDigits;
419 this->doUpdateScaling = __value;
424 return this->doUpdateScaling;
429 inline double getMin()
const {
return axismin; }
432 inline double getMax()
const {
return axismax; }
621#if __cplusplus >= 202002L || DOXYGEN
622# if defined(__cpp_lib_format) || DOXYGEN
747 return qMax(requiredSize,requiredSizeOpposite);
1191 void drawTickLabel1(
JKQTPEnhancedPainter& painter,
double xx,
double yy,
double labelOffset,
const QString &label,
double fontSize,
double ascentMax,
double descentMax,
bool isMinor=
false) ;
1204 void drawTickLabel2(
JKQTPEnhancedPainter& painter,
double xx,
double yy,
double labelOffset,
const QString &label,
double fontSize,
double ascentMax,
double descentMax,
bool isMinor=
false) ;
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
this virtual class is the base for any type of coordinate axis, to be drawn by JKQTBasePlotter.
Definition jkqtpcoordinateaxes.h:181
bool axisRangeFixed
indicates whether this axis is fixed, i.e. axismin and axismax are frozen to their current values
Definition jkqtpcoordinateaxes.h:785
virtual void saveSettings(QSettings &settings, const QString &group=QString("plots/axes/")) const
saves the plot properties into a QSettings object.
double getTickWidth() const
line width of ticks in pt
Definition jkqtpcoordinateaxes.h:389
JKQTPCoordinateAxis(JKQTBasePlotter *parent)
class constructor
int calcLinearUnitDigits()
Calculate the number of digits needed for the labels of an axis that starts at minval and where the t...
void setAbsoluteRange(double aamin, double aamax)
sets absolutely limiting range of the plot
void redrawPlot()
simply calls the redrawPlot method of the parent plotter class
void setTickLabelColor(QColor c)
color of axis tick labels
double getTickUnitFactor() const
tick values are the actual x/y-coordiniate, divided by this value (e.g. pu to have an axis with valu...
Definition jkqtpcoordinateaxes.h:312
double userLogTickSpacing
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:847
bool getInverted() const
indicates whether the axis is to be inverted or not
Definition jkqtpcoordinateaxes.h:300
virtual double getParentPlotWidth() const =0
width of the plot in the direction of the axis
void setLabelColor(QColor c)
color of the axis label
void setTickLabelAngle(double __value)
rotation angle of tick labels [-180..180], i.e. given in degrees, default is 0 (horizontal)
double tickSpacingLog
calculated property: axis tick spacing for logarithmic JKQTPCoordinateAxisStyle::ticks (calculated by...
Definition jkqtpcoordinateaxes.h:858
void setMinTicks(unsigned int __value)
minimum number of axis ticks
void setLabelDigits(int __value)
digits used for tick labels
bool isLinearAxis() const
returns whether this axis uses linear scaling (is false e.g. for isLogAxis()==true)
double getMinorTickLabelFontSize() const
fontsize of the minor axis tick labels
Definition jkqtpcoordinateaxes.h:322
bool logAxis
indicates whether the y axis has a logarithmic scale
Definition jkqtpcoordinateaxes.h:837
const JKQTPCoordinateAxisStyle & getCurrentAxisStyle() const
current style properties for this JKQTBasePlotter
double getTickLabelFontSize() const
fontsize of the axis tick labels
Definition jkqtpcoordinateaxes.h:320
bool isLogAxis() const
returns whether this axis uses logarithmic scaling
void setMinorTicks(int __value)
number of minor grid lines per (major) axis tick interval
void addAxisTickLabels(const QVector< double > &x, const QStringList &label)
add a new tick label to the axis
void setTickUnit(double factor, const QString &name)
sets tickUnitFactor and tickUnitName in one call
JKQTPLabelPosition getLabelPosition() const
position of the axis label
Definition jkqtpcoordinateaxes.h:316
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0)=0
draw the axes
void setLineWidthZeroAxis(double __value)
line width of 0-line in pt
JKQTMathText * getParentMathText()
retun parents JKQTMathText* object
virtual void setParent(JKQTBasePlotter *parent)
void drawAxisLine(JKQTPEnhancedPainter &painter, const QLineF &l, JKQTPCADrawMode drawMode) const
draw the axis line l (pointing from axismin to axismax) optionally decorated as specified by drawMode...
double getLineWidthZeroAxis() const
line width of 0-line in pt
Definition jkqtpcoordinateaxes.h:393
JKQTBasePlotter * getParent()
parent plotter class
Definition jkqtpcoordinateaxes.h:415
void setAutoAxisSpacing(bool __value)
calculated property: indicates whether the object should use automatic tick spacing for the x axis (c...
bool getDrawGrid() const
indicates whether to draw the major grid lines
Definition jkqtpcoordinateaxes.h:399
double getMinorGridWidth() const
width of the grid lines (in pixel)
Definition jkqtpcoordinateaxes.h:360
double getMax() const
returns the current max
Definition jkqtpcoordinateaxes.h:432
virtual void drawGrids(JKQTPEnhancedPainter &painter)=0
draw grids
bool getDoUpdateScaling() const
can be used to switch off calcPlotScaling() temporarily, while modifying some properties
Definition jkqtpcoordinateaxes.h:422
double tickStart
calculated property: x position of the first tick (calculated by calcPlotScaling() )....
Definition jkqtpcoordinateaxes.h:828
QColor getMinorTickColor() const
color of minor ticks
Definition jkqtpcoordinateaxes.h:342
double getGridWidth() const
width of the grid lines (in pixel)
Definition jkqtpcoordinateaxes.h:356
double calcLogTickSpacing()
same as calcLinearTickSpacing(), but for logarithmic scaling
double getTickSpacing() const
calculated property: axis tick spacing (calculated by calcPlotScaling() and calcTickSpacing() ) for l...
Definition jkqtpcoordinateaxes.h:290
void setLogAxisBase(double __value)
the base for a logarithmic x axis
QString getTickDateFormat() const
format string for date tick labels, see QDateTime::toString() documentation for details on format str...
Definition jkqtpcoordinateaxes.h:366
void setMinorGridColor(const QColor &__value)
color of the grid
double getLineWidth() const
line width of axis in pt
Definition jkqtpcoordinateaxes.h:391
void setCurrentAxisStyle(const JKQTPCoordinateAxisStyle &style)
replace the current style properties for this JKQTBasePlotter
const JKQTBasePlotter * getParent() const
parent plotter class
Definition jkqtpcoordinateaxes.h:413
void setLineWidth(double __value)
line width of axis in pt
void setTickInsideLength(double __value)
length of an axis tick inside the plot border in pt
QString getTickDateTimeFormat() const
format string for datetime tick labels, see QDateTime::toString() documentation for details on format...
Definition jkqtpcoordinateaxes.h:368
void setAxisColor(const QColor &__value)
color of the axis (labels, ticks, axis itself ...)
double getUserTickSpacing() const
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:304
QString floattolabel(double data) const
convert a float to a tick label string
void setMinorGridColor(const QColor &__value, double alpha)
color of the grid
void setLabelFontSize(double __value)
fontsize of the axis labels
double getTickOutsideLength() const
length of an axis tick outside the plot border in pt
Definition jkqtpcoordinateaxes.h:332
QColor getMinorGridColor() const
color of the grid
Definition jkqtpcoordinateaxes.h:354
unsigned int getMinTicks() const
minimum number of axis ticks
Definition jkqtpcoordinateaxes.h:328
virtual double getParentOtheraxisOffset() const =0
pixel offset of (perpendicular) other axis (needed for grids)
void setDrawMode2(JKQTPCADrawMode __value)
draw mode of the secondary (right/top) axis
double userTickSpacing
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:843
JKQTPCoordinateAxisStyle axisStyle
current style properties for this coordinate axis instance
Definition jkqtpcoordinateaxes.h:797
void setMinorTickWidth(double __value)
line width of minor ticks in pt
double scaleSign
this is used by x2p() and p2x() to determine the sign
Definition jkqtpcoordinateaxes.h:913
void setAutoLabelDigits(bool __value)
when true, the digits of the labels are calculated automatically
Definition jkqtpcoordinateaxes.h:403
void setMinorTickInsideLength(double __value)
length of a minor axis tick inside the plot border in pt
void setMinorTickLabelsEnabled(bool __value)
if true, the plotter displays minor axis labels as number between 1 and 10 in some cases
JKQTPLabelTickMode getTickMode() const
mode of the major ticks
Definition jkqtpcoordinateaxes.h:372
double getMin() const
returns the current min
Definition jkqtpcoordinateaxes.h:429
QColor getGridColor() const
color of the grid
Definition jkqtpcoordinateaxes.h:352
virtual ~JKQTPCoordinateAxis()
class destructor
QColor getMinorTickLabelColor() const
color of minor tick labels
Definition jkqtpcoordinateaxes.h:344
void setGridColor(const QColor &__value, double alpha)
color of the grid
unsigned int getMinorTicks() const
number of minor grid lines per (major) axis tick interval
Definition jkqtpcoordinateaxes.h:330
QString getTickUnitName() const
name of the factor tickUnitFactor. This string is used in tick-labels to write e.g....
Definition jkqtpcoordinateaxes.h:314
virtual double parentOtherAxisX2P(double x) const =0
calls x2p() of the other axis (or returns NAN if the other axis does not exist
void setRangeFixed(bool fixed)
fixes/ufixes the axis
QString getAxisLabel() const
axis label of the axis
Definition jkqtpcoordinateaxes.h:310
void setTickOutsideLength(double __value)
length of an axis tick outside the plot border in pt
double getAbsoluteMax() const
returns the current absolute max
Definition jkqtpcoordinateaxes.h:441
void setShowZeroAxis(bool __value)
indicates whether to draw a thick axis line at x=0 (zero axis)
virtual AxisElementsSizeDescription getSize2(JKQTPEnhancedPainter &painter)=0
returns the size of the right/top axis in pixels
bool paramsChanged
indicates whether one of the parameters has changed sinse the last recalculation of tickSpacing ....
Definition jkqtpcoordinateaxes.h:754
double getAbsoluteMin() const
returns the current absolute min
Definition jkqtpcoordinateaxes.h:438
double offset
calculated property: axis offset (calculated by calcPlotScaling() )
Definition jkqtpcoordinateaxes.h:817
virtual void loadSettings(const QSettings &settings, const QString &group=QString("plots/axes/"))
loads the plot properties from a QSettings object
void setTickUnitFactor(double __value)
tick values are the actual x/y-coordiniate, divided by this value (e.g. pu to have an axis with valu...
void setTickWidth(double __value)
line width of ticks in pt
void setMinorGridWidth(double __value)
width of the grid lines (in pixel)
void setTickColor(QColor c)
color of axis ticks
bool getAutoAxisSpacing() const
calculated property: indicates whether the object should use automatic tick spacing for the x axis (c...
Definition jkqtpcoordinateaxes.h:294
double scale
calculated property: axis scaling factor (calculated by calcPlotScaling() )
Definition jkqtpcoordinateaxes.h:812
QVector< QPair< double, QString > > tickLabels
a list of tick labels.
Definition jkqtpcoordinateaxes.h:771
void setTickDateTimeFormat(const QString &__value)
format string for datetime tick labels, see QDateTime::toString() documentation for details on format...
QColor getTickLabelColor() const
color of axis tick labels
Definition jkqtpcoordinateaxes.h:348
virtual Axis0ElementsSizeDescription getSize0(JKQTPEnhancedPainter &painter)
returns the size of the zero axis in pixels, the first part of the return-value is the lhs size and t...
void setGridStyle(Qt::PenStyle __value)
line stye of the grid lines
void addAxisTickLabels(const double *x, const QString *label, int items)
add a new tick label to the axis
virtual double getParentPlotOffset() const =0
offset of the plot in the direction of the axis
double axisabsoultemax
absoulte maximum of axis (axismin/axismax xan not be set above this)
Definition jkqtpcoordinateaxes.h:790
double axisabsoultemin
absoulte minimum of axis (axismin/axismax xan not be set below this)
Definition jkqtpcoordinateaxes.h:788
QString axisPrefix
axis prefix for storage of parameters
Definition jkqtpcoordinateaxes.h:911
void setTickLabelFontSize(double __value)
fontsize of the axis tick labels
bool getAutoLabelDigits() const
when true, the digits of the labels are calculated automatically
Definition jkqtpcoordinateaxes.h:408
QString tickUnitName
name of the factor tickUnitFactor. This string is used in tick-labels to write e.g....
Definition jkqtpcoordinateaxes.h:868
void loadCurrentAxisStyle(const QSettings &settings, const QString &group="plot/axes/")
replace the current style properties for this JKQTBasePlotter with properties loaded from settings
void setDrawMode0(JKQTPCADrawMode __value)
draw mode of the zero axis
void addAxisTickLabel(double x, const QString &label)
add a new tick label to the axis
void addAxisTickLabels(const QVector< double > &x, const QString *label)
add a new tick label to the axis
void setDoUpdateScaling(bool __value)
can be used to switch off calcPlotScaling() temporarily, while modifying some properties
Definition jkqtpcoordinateaxes.h:417
void setGridColor(const QColor &__value)
color of the grid
void setUserTickSpacing(double __value)
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
JKQTPCADrawMode getDrawMode2() const
draw mode of the secondary (right/top) axis
Definition jkqtpcoordinateaxes.h:385
void setAxisLabel(const QString &__value)
axis label of the axis
QString getTickFormatfFormat() const
format string for std::format tick labels, (see e.g. https://en.cppreference.com/w/cpp/utility/format...
Definition jkqtpcoordinateaxes.h:376
bool getMinorTickLabelFullNumber() const
indicates whether the minor tick labels should be full numbers, or just a number between 0....
Definition jkqtpcoordinateaxes.h:324
void setArrowSizeFactor(double f)
factor used to calculate the size of line arrows
void setDrawMinorGrid(bool __value)
indicates whether to draw the major grid lines
void setTickLabelType(JKQTPCALabelType __value)
indicates how to draw the labels
QSizeF getMaxTickLabelSize(JKQTPEnhancedPainter &painter, double *ascent=nullptr, double *descent=nullptr)
calculates the maximum width and height (returned as QSize) of all tick labels. Ascent and descent ma...
void setMinorGridStyle(Qt::PenStyle __value)
line stye of the grid lines
void clearAxisTickLabels()
clear axis tick labels. This switches back to automatic labels mode for the axis.
void setTickMode(JKQTPLabelTickMode __value)
mode of the major ticks
double getTickLabelDistance() const
distance between tick end and label start in pt
Definition jkqtpcoordinateaxes.h:395
void setMinorTickOutsideLength(double __value)
length of a minor axis tick outside the plot border in pt
double getZeroAxisPos(bool *drawZeroAxis=nullptr)
calculate the position of the zero-axis (and whether to draw it or not)
void calcPlotScaling(bool force=false)
calculate the scaling and offset values from axis min/max values
void setMinorTickColor(QColor c)
color of minor ticks
virtual double getParentOtheraxisWidth() const =0
width of other (perpendicular) axis (needed for grids)
bool getShowZeroAxis() const
indicates whether to draw a thick axis line at x=0 (zero axis)
Definition jkqtpcoordinateaxes.h:350
double calcLinearTickSpacing()
calculates the tick spacing for a linear axis that spans awidth and that should show at least JKQTPCo...
bool autoAxisSpacing
calculated property: indicates whether the object should use automatic tick spacing for the x axis (c...
Definition jkqtpcoordinateaxes.h:834
bool getLogAxis() const
indicates whether the y axis has a logarithmic scale
Definition jkqtpcoordinateaxes.h:298
void setTickLabelDistance(double __value)
distance between tick end and label start in pt
void setMax(double amax)
set axis minimum range of plot axis
Qt::PenStyle getGridStyle() const
line stye of the grid lines
Definition jkqtpcoordinateaxes.h:358
double getLabelDistance() const
distance between tick label and axis label in pt
Definition jkqtpcoordinateaxes.h:397
QString axisLabel
axis label of the axis
Definition jkqtpcoordinateaxes.h:862
void setTickPrintfFormat(const QString &__value)
format string for printf tick labels, see https://en.wikipedia.org/wiki/Printf_format_string document...
virtual bool getParentOtheraxisInverted() const =0
is other (perpendicular) axis inverted (needed for grids)
void setTickMode(int __value)
mode of the major ticks
void setMinorTickLabelColor(QColor c)
color of minor tick labels
QColor getTickColor() const
color of axis ticks
Definition jkqtpcoordinateaxes.h:346
void setDrawMode1(JKQTPCADrawMode __value)
draw mode of the main (left/bottom) axis
bool doUpdateScaling
can be used to switch off calcPlotScaling() temporarily, while modifying some properties
Definition jkqtpcoordinateaxes.h:761
void setTickFormatFormat(const QString &__value)
format string for std::format tick labels, (see e.g. https://en.cppreference.com/w/cpp/utility/format...
void setTickDateFormat(const QString &__value)
format string for date tick labels, see QDateTime::toString() documentation for details on format str...
void setMinorTickLabelFullNumber(bool __value)
indicates whether the minor tick labels should be full numbers, or just a number between 0....
QColor getAxisColor() const
color of the axis (labels, ticks, axis itself ...)
Definition jkqtpcoordinateaxes.h:338
void setMinorTicks(unsigned int __value)
number of minor grid lines per (major) axis tick interval
bool inverted
indicates whether the axis is to be inverted or not
Definition jkqtpcoordinateaxes.h:822
double getUserLogTickSpacing() const
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
Definition jkqtpcoordinateaxes.h:306
void setLogAxis(bool __value)
indicates whether the y axis has a logarithmic scale
double width
calculated property: width of plot on axis (calculated by calcPlotScaling() )
Definition jkqtpcoordinateaxes.h:806
void setNoAbsoluteRange()
do not use an absolute range of plot axis
void setRange(double amin, double amax)
set range of plot axis
void saveCurrentAxisStyle(QSettings &settings, const QString &group="plot/axes/") const
store the current style properties for this JKQTBasePlotter with properties loaded from settings
double getLabelFontSize() const
fontsize of the axis labels
Definition jkqtpcoordinateaxes.h:318
JKQTPCADrawMode getDrawMode0() const
draw mode of the zero axis
Definition jkqtpcoordinateaxes.h:381
void setUserLogTickSpacing(double __value)
if autoXAxisSpacing is false then this value is used for xTickSpacing. So this is the property which ...
bool getNextLabel(double &x, QString &label, bool init=false)
calculates the next label from the given parameters.
double x2p(double x) const
return x-pixel coordinate from x coordinate
Definition jkqtpcoordinateaxes.h:202
void resetTickUnit()
resets tickUnitFactor and tickUnitName in one call
double p2x(double x) const
return x coordinate from x-pixel
Definition jkqtpcoordinateaxes.h:218
void setColor(QColor c)
sets all colors (line, ticks, label, ...) of the axis
double getNextLabelDistance(double x)
returns the distance from the current tick position (x before call) to the next tick position
double tickUnitFactor
tick values are the actual x/y-coordiniate, divided by this value (e.g. pu to have an axis with valu...
Definition jkqtpcoordinateaxes.h:865
double axismax
current view: maximum of axis
Definition jkqtpcoordinateaxes.h:783
virtual AxisElementsSizeDescription getSize1(JKQTPEnhancedPainter &painter)=0
returns the sizerequirement of the left/bottom axis in pixels
int getLabelDigits() const
digits used for tick labels
Definition jkqtpcoordinateaxes.h:292
void addAxisTickLabels(const double *x, const QStringList &label)
add a new tick label to the axis
double getMinorTickWidth() const
line width of minor ticks in pt
Definition jkqtpcoordinateaxes.h:387
double getArrowSizeFactor() const
factor used to calculate the size of line arrows
Definition jkqtpcoordinateaxes.h:334
void setMinorTickLabelFontSize(double __value)
fontsize of the minor axis tick labels
void setMin(double amin)
set axis minimum range of plot axis
double tickSpacing
calculated property: axis tick spacing (calculated by calcPlotScaling() and calcTickSpacing() ) for l...
Definition jkqtpcoordinateaxes.h:853
double axismin
current view: minimum of axis
Definition jkqtpcoordinateaxes.h:781
void setTickUnitPi()
sets pi-scaling for tickUnitFactor and tickUnitName in one call
void setLabelPosition(JKQTPLabelPosition __value)
position of the axis label
double axisMinWidth
absolute minimum range width, feature switched off when <0
Definition jkqtpcoordinateaxes.h:800
double getLogAxisBase() const
the base for a logarithmic x axis
Definition jkqtpcoordinateaxes.h:302
bool isAxisRangeFixed() const
returns whether the axis range is fixed, i.e. may not change!
Definition jkqtpcoordinateaxes.h:435
void setDrawGrid(bool __value)
indicates whether to draw the major grid lines
double getTickLabelAngle() const
rotation angle of tick labels [-180..180], i.e. given in degrees, default is 0 (horizontal)
Definition jkqtpcoordinateaxes.h:326
virtual bool isSecondaryAxis() const
figures out (possibly by probing the parent JKQTBasePlotter), whether this axis is a secondary axis
JKQTPCALabelType getTickLabelType() const
indicates how to draw the labels
Definition jkqtpcoordinateaxes.h:308
void setTickTimeFormat(const QString &__value)
format string for time tick labels, see QDateTime::toString() documentation for details on format str...
double getMinorTickOutsideLength() const
length of a minor axis tick outside the plot border in pt
Definition jkqtpcoordinateaxes.h:336
bool getDrawMinorGrid() const
indicates whether to draw the major grid lines
Definition jkqtpcoordinateaxes.h:401
QColor getLabelColor() const
color of the axis label
Definition jkqtpcoordinateaxes.h:340
void setGridWidth(double __value)
width of the grid lines (in pixel)
QString getTickTimeFormat() const
format string for time tick labels, see QDateTime::toString() documentation for details on format str...
Definition jkqtpcoordinateaxes.h:364
double logAxisBase
the base for a logarithmic x axis
Definition jkqtpcoordinateaxes.h:839
void setTickUnitName(const QString &__value)
name of the factor tickUnitFactor. This string is used in tick-labels to write e.g....
QString floattolabel(double data, int past_comma) const
convert a float to a tick label string with a given precision
void setInverted(bool __value)
indicates whether the axis is to be inverted or not
void setAxisMinWidth(double __value)
absolute minimum range width, feature switched off when <0
JKQTBasePlotter * parent
parent plotter class
Definition jkqtpcoordinateaxes.h:779
JKQTPCADrawMode getDrawMode1() const
draw mode of the main (left/bottom) axis
Definition jkqtpcoordinateaxes.h:383
Qt::PenStyle getMinorGridStyle() const
line stye of the grid lines
Definition jkqtpcoordinateaxes.h:362
const JKQTMathText * getParentMathText() const
retun parents JKQTMathText* object
QString getTickPrintfFormat() const
format string for printf tick labels, see https://en.wikipedia.org/wiki/Printf_format_string document...
Definition jkqtpcoordinateaxes.h:370
bool getMinorTickLabelsEnabled() const
if true, the plotter displays minor axis labels as number between 1 and 10 in some cases
Definition jkqtpcoordinateaxes.h:296
void setLabelDistance(double __value)
distance between tick label and axis label in pt
Support Class for JKQTPCoordinateAxis, which summarizes all properties that define the visual styling...
Definition jkqtpcoordinateaxesstyle.h:87
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
base class for horizontal axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoo...
Definition jkqtpcoordinateaxes.h:1154
virtual void drawGrids(JKQTPEnhancedPainter &painter) override
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
QSizeF getQSize1(JKQTPEnhancedPainter &painter)
virtual AxisElementsSizeDescription getSize1(JKQTPEnhancedPainter &painter) override
returns the size of the bottom axis in pixels
void drawTickLabel2(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false)
draw a tick label on the upper axis 2 with text label (with optional rotation) at ( xx ,...
QSizeF getQSize2(JKQTPEnhancedPainter &painter)
virtual Axis0ElementsSizeDescription getSize0(JKQTPEnhancedPainter &painter) override
void drawAxisLabel2(JKQTPEnhancedPainter &painter, double left, double top, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 2 at x= left and y= top. labelMax is the maximum Size of a...
void drawTickLabel1(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, double ascentMax, double descentMax, bool isMinor=false)
draw a tick label on the lower axis 1 with text label (with optional rotation) at ( xx ,...
void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 1 at x= left and y= bottom. labelMax is the maximum Size o...
virtual AxisElementsSizeDescription getSize2(JKQTPEnhancedPainter &painter) override
returns the size of the top axis in pixels
JKQTPHorizontalAxisBase(JKQTBasePlotter *parent)
class constructor
implements a horizontal axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoord...
Definition jkqtpcoordinateaxes.h:1221
JKQTPCoordinateAxisRef otherAxisRef
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
Definition jkqtpcoordinateaxes.h:1248
virtual double getParentOtheraxisWidth() const override
JKQTPCoordinateAxisRef getOtherAxisRef() const
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
virtual bool getParentOtheraxisInverted() const override
virtual double getParentPlotOffset() const override
JKQTPHorizontalAxis(JKQTBasePlotter *parent, JKQTPCoordinateAxisRef otherAxisRef_=JKQTPPrimaryAxis)
class constructor
virtual double getParentOtheraxisOffset() const override
const JKQTPCoordinateAxis * getOtherAxis() const
returns the "other" axis, refernced by otherAxisRef
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentPlotWidth() const override
implements a position-indipendent horizontal axis, based on JKQTPCoordinateAxis (for most of document...
Definition jkqtpcoordinateaxes.h:1270
virtual double getParentPlotWidth() const override
bool otherAxisInverted
indicates whether the other axis is inverted
Definition jkqtpcoordinateaxes.h:1315
double otherAxisWidth
the width of the other axis
Definition jkqtpcoordinateaxes.h:1311
virtual double getParentOtheraxisOffset() const override
virtual void setAxisWidth(double __value)
set the axis width
virtual void setOtherAxisWidth(double __value)
set the other axis width
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
virtual void setOtherAxisInverted(bool __value)
set whether the other axis is inverted
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentOtheraxisWidth() const override
double axisOffset
the offset of the axis
Definition jkqtpcoordinateaxes.h:1307
double otherAxisOffset
the offset of the other axis
Definition jkqtpcoordinateaxes.h:1313
virtual void setAxisOffset(double __value)
set the axis offset
virtual void setOtherAxisOffset(double __value)
set the other axis offset
virtual double getParentPlotOffset() const override
virtual bool getParentOtheraxisInverted() const override
double axisWidth
the width of the axis
Definition jkqtpcoordinateaxes.h:1309
JKQTPHorizontalIndependentAxis(double axisOffset, double axisWidth, double otherAxisOffset, double otherAxisWidth, JKQTBasePlotter *parent)
class constructor
base class for vertical axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoord...
Definition jkqtpcoordinateaxes.h:967
QSizeF getQSize1(JKQTPEnhancedPainter &painter)
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
virtual AxisElementsSizeDescription getSize1(JKQTPEnhancedPainter &painter) override
returns the size of the left axis in pixels
virtual AxisElementsSizeDescription getSize2(JKQTPEnhancedPainter &painter) override
returns the size of the right axis in pixels
void drawAxisLabel2(JKQTPEnhancedPainter &painter, double right, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 2 at x= right and y= bottom. labelMax is the maximum Size ...
void drawTickLabel1(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false)
draw a tick label on the left axis 1 with text label (with optional rotation) at ( xx ,...
QSizeF getQSize2(JKQTPEnhancedPainter &painter)
void drawAxisLabel1(JKQTPEnhancedPainter &painter, double left, double bottom, QSizeF labelMax, JKQTPCADrawMode drawMode)
draw the axis label using painter for axis 1 at x= left and y= bottom. labelMax is the maximum Size o...
virtual void drawGrids(JKQTPEnhancedPainter &painter) override
void drawTickLabel2(JKQTPEnhancedPainter &painter, double xx, double yy, double labelOffset, const QString &label, double fontSize, bool isMinor=false)
draw a tick label on the right axis 2 with text label (with optional rotation) at ( xx ,...
virtual Axis0ElementsSizeDescription getSize0(JKQTPEnhancedPainter &painter) override
JKQTPVerticalAxisBase(JKQTBasePlotter *parent)
class constructor
implements a vertical axis for use as primary, secondary, ... axis of a JKQTPBasePlotter,...
Definition jkqtpcoordinateaxes.h:1032
JKQTPVerticalAxis(JKQTBasePlotter *parent, JKQTPCoordinateAxisRef otherAxisRef=JKQTPPrimaryAxis)
class constructor
JKQTPCoordinateAxisRef getOtherAxisRef() const
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
virtual double getParentPlotWidth() const override
const JKQTPCoordinateAxis * getOtherAxis() const
returns the "other" axis, refernced by otherAxisRef
virtual double getParentPlotOffset() const override
virtual double getParentOtheraxisOffset() const override
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentOtheraxisWidth() const override
JKQTPCoordinateAxisRef otherAxisRef
references the other axis fromm the JKQTPBasePLotter to use as "other" axis
Definition jkqtpcoordinateaxes.h:1060
virtual bool getParentOtheraxisInverted() const override
implements a position-indipendent vertical axis, based on JKQTPCoordinateAxis (for most of documentat...
Definition jkqtpcoordinateaxes.h:1083
virtual double parentOtherAxisX2P(double x) const override
virtual double getParentPlotOffset() const override
virtual void drawAxes(JKQTPEnhancedPainter &painter, int move1=0, int move2=0) override
virtual void setOtherAxisInverted(bool __value)
set whether the other axis is inverted
double axisWidth
the width of the axis
Definition jkqtpcoordinateaxes.h:1122
virtual void setAxisOffset(double __value)
set the axis offset
virtual double getParentOtheraxisOffset() const override
virtual void setOtherAxisWidth(double __value)
set the other axis width
JKQTPVerticalIndependentAxis(double axisOffset, double axisWidth, double otherAxisOffset, double otherAxisWidth, JKQTBasePlotter *parent)
class constructor
double axisOffset
the offset of the axis
Definition jkqtpcoordinateaxes.h:1120
virtual void setAxisWidth(double __value)
set the axis width
virtual double getParentOtheraxisWidth() const override
virtual double getParentPlotWidth() const override
double otherAxisOffset
the offset of the other axis
Definition jkqtpcoordinateaxes.h:1126
bool otherAxisInverted
indicates whether the other axis is inverted
Definition jkqtpcoordinateaxes.h:1128
double otherAxisWidth
the width of the other axis
Definition jkqtpcoordinateaxes.h:1124
virtual void setOtherAxisOffset(double __value)
set the other axis offset
virtual bool getParentOtheraxisInverted() const override
QFlags< JKQTPCADrawModeElements > JKQTPCADrawMode
drawing mode for a coordinate axis
Definition jkqtptools.h:430
JKQTPCoordinateAxes
named references for different oordinate axes in the plot
Definition jkqtpcoordinateaxes.h:42
JKQTPLabelPosition
position of the axis labels
Definition jkqtptools.h:508
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
JKQTPCoordinateAxes JKQTPCoordinateAxisRef
type for indexing coordinate axes in a plot
Definition jkqtpcoordinateaxes.h:50
JKQTPCALabelType
display mode for the (axis) labels
Definition jkqtptools.h:449
JKQTPLabelTickMode
mode of the axis ticks
Definition jkqtptools.h:476
@ JKQTPPrimaryAxis
Definition jkqtpcoordinateaxes.h:43
@ JKQTPSecondaryAxis
Definition jkqtpcoordinateaxes.h:44
Definition jkqtpcoordinateaxes.h:742
Axis0ElementsSizeDescription(double _requiredSize=0.0, double _requiredSizeOpposite=0.0, double _elongateMin=0.0, double _elongateMax=0.0)
Definition jkqtpcoordinateaxes.h:743
double maxRequiredSize() const
Definition jkqtpcoordinateaxes.h:746
double requiredSizeOpposite
additional size, required for the axis, in the opposite direction as AxisElementsSizeDescription::req...
Definition jkqtpcoordinateaxes.h:745
return value type for getSize1() and getSize2()
Definition jkqtpcoordinateaxes.h:250
AxisElementsSizeDescription(double _requiredSize=0.0, double _elongateMin=0.0, double _elongateMax=0.0)
Definition jkqtpcoordinateaxes.h:251
double requiredSize
required space, starting at the axis line, in outward direction [pixels]
Definition jkqtpcoordinateaxes.h:254
double elongateMin
extra space on the min (horizontal: left, vertical: bottom) side BESIDE the axis, e....
Definition jkqtpcoordinateaxes.h:256
double elongateMax
extra space on the max (horizontal: right, vertical: top) side BESIDE the axis, e....
Definition jkqtpcoordinateaxes.h:258