2015-07-11 18:56:02 +08:00
/*
2019-01-12 23:01:55 +08:00
Copyright ( c ) 2008 - 2019 Jan W . Krieger ( < jan @ jkrieger . de > )
2015-07-11 18:56:02 +08:00
2015-07-12 22:34:27 +08:00
2015-07-11 18:56:02 +08:00
This software is free software : you can redistribute it and / or modify
it under the terms of the GNU Lesser General Public License ( LGPL ) as published by
the Free Software Foundation , either version 2 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU Lesser General Public License ( LGPL ) for more details .
You should have received a copy of the GNU Lesser General Public License ( LGPL )
along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef JKQTPBASEELEMENTS_H
# define JKQTPBASEELEMENTS_H
# include <QString>
# include <QPainter>
# include <QPair>
# include <QSettings>
2018-11-26 03:25:44 +08:00
# include "jkqtplottertools/jkqtptools.h"
# include "jkqtmathtext/jkqtmathtext.h"
# include "jkqtplottertools/jkqtp_imexport.h"
2015-07-11 18:56:02 +08:00
// forward declarations
2019-01-20 17:49:29 +08:00
class JKQTBasePlotter ;
2015-07-11 18:56:02 +08:00
2019-01-26 03:16:04 +08:00
/*! \brief this virtual class is the base for any type of coordinate axis, to be drawn by JKQTBasePlotter.
2019-01-19 16:40:52 +08:00
\ ingroup jkqtpbaseplotter_elements
2015-07-11 18:56:02 +08:00
This class implements all the functionality needed for a coordinate axis :
- transform world to screen coordinates and vice versa
- draw the axis ( implemented by child classes ! ) with these elements : axis lines , ticks , tick labels , axis label , x / y = 0 axis
- measure the axes in screen coordinates
- load and save the settings to an ini file
.
Most of the actual draw and measure functions have to be implemented in descendents of this class ( namely
2019-01-20 17:49:29 +08:00
JKQTPHorizontalAxis and JKQTPVerticalAxis , as they are specific to whether the axis is drawn horizontally or
2015-07-11 18:56:02 +08:00
vertically .
Each axis is split up into several parts , as depicted in this image :
\ image html jkqtpcoordinateaxis1 . png
Which parts to actually draw is set by the diverse properties .
2019-01-12 23:01:55 +08:00
\ section jkqtplotter_base_systems_baseelements Coordinate Systems and Transformations
2015-07-11 18:56:02 +08:00
The plot itself is positioned inside the widget . You simply supply the widget dimensions and the border
widths between the plot and the widget . The Object then calculates the size of the plot :
\ image html plot_widget_orientation . png
The plot shows the parameter range xmin . . . xmax and ymin . . . ymax . Note that if you plot logarithmic plots
you may only plot positive ( > 0 ) values . Any other value may lead to an error or unpredictable behaviour .
From these parameters the object calculates the scaling laws for plotting pints to the screen . The next paragraphs
show all calculations for x - and y - coordinates , ahough this class only implements a generic form . The actual calculation
is also influenced by the parameters set in the child classes !
- # < tt > width = xmax - xmin < / tt >
- # < tt > height = ymax - ymin < / tt >
- # < tt > plotWidth = widgetWidth - plotBorderLeft - plotBorderRight < / tt >
- # < tt > plotHeight = widgetHeight - plotBorderTop - plotBorderBottom < / tt >
- # < tt > xPlotOffset = plotBorderLeft < / tt >
- # < tt > yPlotOffset = plotBorderTop < / tt >
.
These parameters are common to all scaling laws . The next image explains these formulas :
\ image html plot_coordinates . png
The actual scaling laws \ f $ ( x_p ( x ) , y_p ( y ) ) \ f $ may be derived from these equations :
\ f [ x_p ( \ mbox { xmin } ) = \ mbox { xPlotOffset } , \ \ \ \ \ x_p ( \ mbox { xmax } ) = \ mbox { xPlotOffset } + \ mbox { plotWidth } \ f ]
\ f [ y_p ( \ mbox { ymax } ) = \ mbox { yPlotOffset } , \ \ \ \ \ y_p ( \ mbox { ymin } ) = \ mbox { yPlotOffset } + \ mbox { plotHeight } \ f ]
Here \ f $ ( x_p , y_p ) \ f $ denotes a point in pixel coordinates ( green coordinate system ) and \ f $ ( x , y ) \ f $ denotes a point in the
plotting coordinate system .
If you assume a < b > linear scaling law < / b > . \ f [ x_p ( x ) = \ mbox { xoffset } + x \ cdot \ mbox { xscale } \ \ \ \ \ \ \ \ \ y_p ( y ) = \ mbox { yoffset } - y \ cdot \ mbox { yscale } \ f ]
you can derive :
\ f [ \ mbox { xscale } = \ frac { \ mbox { plotWidth } } { \ mbox { xwidth } } , \ \ \ \ \ \ \ mbox { xoffset } = \ mbox { xPlotOffset } - \ mbox { xmin } \ cdot \ mbox { xscale } \ f ]
\ f [ \ mbox { yscale } = \ frac { \ mbox { plotHeight } } { \ mbox { ywidth } } , \ \ \ \ \ \ \ mbox { yoffset } = \ mbox { yPlotOffset } + \ mbox { ymax } \ cdot \ mbox { yscale } \ f ]
If you have a < b > logarithmic axis < / b > ( i . e . we plot \ f $ \ log_b ( x ) \ f $ insetad of \ f $ x \ f $ for a given base \ f $ b \ f $ ) we get the same
formulas , but with \ f $ x \ f $ exchanged by \ f $ \ log_b ( x ) \ f $ . If we use the equation \ f $ \ log_b ( x ) = \ log ( x ) / \ log ( b ) \ f $ we finally get
the scaling laws :
\ f [ x_p ( x ) = \ mbox { xoffset } + \ frac { \ log ( x ) } { \ log ( \ mbox { logXAxisBase } ) } \ cdot \ mbox { xscale } \ \ \ \ \ \ \ \ \ y_p ( y ) = \ mbox { yoffset } - \ frac { \ log ( y ) } { \ log ( \ mbox { logYAxisBase } ) } \ cdot \ mbox { yscale } \ f ]
From these we can calculate their parameters with the same defining equations as above :
\ f [ \ mbox { xscale } = \ frac { \ mbox { plotWidth } \ cdot \ log ( \ mbox { logXAxisBase } ) } { \ log ( \ mbox { xmax } ) - \ log ( \ mbox { xmin } ) } , \ \ \ \ \ \ \ mbox { xoffset } = \ mbox { xPlotOffset } - \ frac { \ log ( \ mbox { xmin } ) } { \ log ( \ mbox { logXAxisBase } ) } \ cdot \ mbox { xscale } \ f ]
\ f [ \ mbox { yscale } = \ frac { \ mbox { plotHeight } \ cdot \ log ( \ mbox { logYAxisBase } ) } { \ log ( \ mbox { ymax } ) - \ log ( \ mbox { ymin } ) } , \ \ \ \ \ \ \ mbox { yoffset } = \ mbox { yPlotOffset } + \ frac { \ log ( \ mbox { ymax } ) } { \ log ( \ mbox { logYAxisBase } ) } \ cdot \ mbox { yscale } \ f ]
The object implements the above coordinate transformations in the ( inline ) method x2p ( ) . The inverse transformations
are implemented in p2x ( ) . They can be used to show the system coordinates of the current mouse position .
2019-01-13 01:53:16 +08:00
\ section jkqtplotter_base_grids_baseelemenets Axis Ticks and Grids
2015-07-11 18:56:02 +08:00
This section explains how this component draws the ticks on coordinate axes and the grids that may be drawn below
the plots . In principle both - grids and axes - are drawn the same way , i . e . with the same step widths . There are
two types of ticks and grids : The major and the minor ticks / grids . The major ticks also show a label that denotes the
value they represent . Between two major ticks the axis shows \ a minorTicks small ticks that are not
accompanied by a label . The next image shows an example of an axis :
\ image html plot_axis_ticksandlabels . png
For the labels this class also uses an algorithm that extimates the number of valid digits ( after the comma ) that are
needed so that two adjacent labels do not show the same text , so if you plot the range 1.10 . . 1.15 The algorithm will
show at least two valid digits , as with one digit the labels would be 1.1 , 1.1 , 1.1 , 1.1 , 1.1 , 1.1 . With two digits they
are 1.10 , 1.11 , 1.12 , 1.13 , 1.14 , 1.15 . The class may also use a method that can write \ c 1 m instead of \ c 0.001 and \ c 1 k
instead of \ c 1000 ( the algorithm supports the " exponent letters " f , p , n , u , m , k , M , G , T , P . The latter option may
( de ) activated by using showXExponentCharacter and showYExponentCharacter .
For grids applies the same . There are two grids that are drawn in different styles ( often the major grid is drawn
thicker and darker than the minor grid ) .
The minor ticks and grid lines are generated automatically , depending in the setting of \ a minorTicks .
These properties give the number of minor ticks between two major ticks , so if the major ticks are at 1 , 2 , 3 , . . . and you
want minor ticks at 1.1 , 1.2 , 1.3 , . . . then you will have to set \ c minorTicks = 9 as there are nine ticks between two major
ticks . So the minor tick spacing is calculated as : \ f [ \ Delta \ mbox { MinorTicks } = \ frac { \ Delta \ mbox { ticks } } { \ mbox { minorTicks } + 1 } \ f ]
The same applies for logarithmic axes . If the major ticks are at 1 , 10 , 100 , . . . and you set \ c minorTicks = 9 the program will
generate 9 equally spaced minor ticks in between , so you have minor ticks at 2 , 3 , 4 , . . . , 11 , 12 , 13 , . . . This results in a standard
logarithmic axis . If you set \ c minorTicks = 1 then you will get minor ticks at 5 , 15 , 150 , . . .
\ image html plot_logaxis_ticksandlabels . png
The major tick - tick distances of linear axes may be calculated automatically in a way that the axis shows at least a given
number of ticks \ c minTicks . The algorithm takes that tick spacing that will give a number of ticks per axis
nearest but \ c " >= " to the given \ c minTicks . The Algorithm is described in detail with the function
calcLinearTickSpacing ( ) . To activate this automatic tick spacing you have to set < code > autoAxisSpacing = true < / code > .
*/
2019-02-03 21:04:48 +08:00
class JKQTP_LIB_EXPORT JKQTPCoordinateAxis : public QObject {
2015-07-11 18:56:02 +08:00
Q_OBJECT
protected :
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
explicit JKQTPCoordinateAxis ( JKQTBasePlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief class destructor */
2019-01-20 17:49:29 +08:00
virtual ~ JKQTPCoordinateAxis ( ) ;
2019-01-26 20:00:40 +08:00
virtual void setParent ( JKQTBasePlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief loads the plot properties from a QSettings object */
2019-01-26 19:28:44 +08:00
virtual void loadSettings ( const QSettings & settings , const QString & group = QString ( " plots " ) ) ;
2015-07-11 18:56:02 +08:00
/** \brief saves the plot properties into a QSettings object.
*
* This method only saves those properties that differ from their default value .
*/
2019-01-26 19:28:44 +08:00
virtual void saveSettings ( QSettings & settings , const QString & group = QString ( " plots " ) ) const ;
2015-07-11 18:56:02 +08:00
/** \brief load settings from other axis */
2019-01-20 17:49:29 +08:00
virtual void loadSettings ( JKQTPCoordinateAxis * settings ) ;
2015-07-11 18:56:02 +08:00
/** \brief return x-pixel coordinate from time coordinate */
inline double x2p ( double x ) const {
double r = 0 ;
if ( logAxis ) {
if ( x < = 0 ) r = offset + scaleSign * log ( axismin ) / log ( logAxisBase ) * scale ;
else r = offset + scaleSign * log ( x ) / log ( logAxisBase ) * scale ;
} else {
r = offset + scaleSign * x * scale ;
}
if ( inverted ) {
2019-01-26 20:00:40 +08:00
return 2.0 * getParentPlotOffset ( ) + getParentPlotWidth ( ) - r ; //getParentPlotOffset()+getParentPlotWidth()-(r-getParentPlotOffset());
2015-07-11 18:56:02 +08:00
} else {
return r ;
}
2018-11-25 21:53:26 +08:00
}
2015-07-11 18:56:02 +08:00
/** \brief return time coordinate coordinate from x-pixel */
2018-12-28 05:52:00 +08:00
inline double p2x ( double x ) const {
2015-07-11 18:56:02 +08:00
double xx = x ;
if ( inverted ) {
2019-01-26 20:00:40 +08:00
xx = 2.0 * getParentPlotOffset ( ) + getParentPlotWidth ( ) - x ;
2015-07-11 18:56:02 +08:00
}
xx = xx - offset ;
if ( logAxis ) {
return exp ( log ( logAxisBase ) * ( xx ) / ( scaleSign * scale ) ) ;
} else {
return xx / ( scaleSign * scale ) ;
}
2015-08-02 21:04:37 +08:00
}
2015-07-11 18:56:02 +08:00
/** \brief clear axis tick labels. This switches back to automatic labels mode for the axis. */
2018-11-25 21:53:26 +08:00
void clearAxisTickLabels ( ) ;
2015-07-11 18:56:02 +08:00
/** \brief add a new tick label to the axis */
2019-01-26 19:28:44 +08:00
void addAxisTickLabel ( double x , const QString & label ) ;
2015-08-02 21:04:37 +08:00
/** \brief add a new tick label to the axis */
2018-11-25 21:53:26 +08:00
void addAxisTickLabels ( const QVector < double > & x , const QStringList & label ) ;
2015-08-02 21:04:37 +08:00
/** \brief add a new tick label to the axis */
2018-11-25 21:53:26 +08:00
void addAxisTickLabels ( const double * x , const QStringList & label ) ;
2015-08-02 21:04:37 +08:00
/** \brief add a new tick label to the axis */
2018-11-25 21:53:26 +08:00
void addAxisTickLabels ( const QVector < double > & x , const QString * label ) ;
2015-08-02 21:04:37 +08:00
/** \brief add a new tick label to the axis */
2018-11-25 21:53:26 +08:00
void addAxisTickLabels ( const double * x , const QString * label , int items ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 23:15:10 +08:00
/** \brief returns the size of the left/bottom axis in pt */
2015-07-11 18:56:02 +08:00
virtual QSize getSize1 ( JKQTPEnhancedPainter & painter ) = 0 ;
2019-01-20 23:15:10 +08:00
/** \brief returns the size of the right/top axis in pt */
2015-07-11 18:56:02 +08:00
virtual QSize getSize2 ( JKQTPEnhancedPainter & painter ) = 0 ;
/** \brief draw axes */
virtual void drawAxes ( JKQTPEnhancedPainter & painter ) = 0 ;
/** \brief draw grids */
virtual void drawGrids ( JKQTPEnhancedPainter & painter ) = 0 ;
2019-01-26 20:00:40 +08:00
/*! \brief returns the property tickSpacing ( \copybrief tickSpacing ). \details Description of the parameter tickSpacing is: <BLOCKQUOTE>\copydoc tickSpacing </BLOCKQUOTE>. \see tickSpacing for more information */
inline double getTickSpacing ( ) const { return this - > tickSpacing ; }
/*! \brief returns the property labelDigits ( \copybrief labelDigits ). \details Description of the parameter labelDigits is: <BLOCKQUOTE>\copydoc labelDigits </BLOCKQUOTE>. \see labelDigits for more information */
inline int getLabelDigits ( ) const { return this - > labelDigits ; }
/*! \brief returns the property autoAxisSpacing ( \copybrief autoAxisSpacing ). \details Description of the parameter autoAxisSpacing is: <BLOCKQUOTE>\copydoc autoAxisSpacing </BLOCKQUOTE>. \see autoAxisSpacing for more information */
inline bool getAutoAxisSpacing ( ) const { return this - > autoAxisSpacing ; }
/*! \brief returns the property minorTickLabelsEnabled ( \copybrief minorTickLabelsEnabled ). \details Description of the parameter minorTickLabelsEnabled is: <BLOCKQUOTE>\copydoc minorTickLabelsEnabled </BLOCKQUOTE>. \see minorTickLabelsEnabled for more information */
inline bool getMinorTickLabelsEnabled ( ) const { return this - > minorTickLabelsEnabled ; }
/*! \brief returns the property logAxis ( \copybrief logAxis ). \details Description of the parameter logAxis is: <BLOCKQUOTE>\copydoc logAxis </BLOCKQUOTE>. \see logAxis for more information */
inline bool getLogAxis ( ) const { return this - > logAxis ; }
/*! \brief returns the property inverted ( \copybrief inverted ). \details Description of the parameter inverted is: <BLOCKQUOTE>\copydoc inverted </BLOCKQUOTE>. \see inverted for more information */
inline bool getInverted ( ) const { return this - > inverted ; }
/*! \brief returns the property logAxisBase ( \copybrief logAxisBase ). \details Description of the parameter logAxisBase is: <BLOCKQUOTE>\copydoc logAxisBase </BLOCKQUOTE>. \see logAxisBase for more information */
inline double getLogAxisBase ( ) const { return this - > logAxisBase ; }
/*! \brief returns the property userTickSpacing ( \copybrief userTickSpacing ). \details Description of the parameter userTickSpacing is: <BLOCKQUOTE>\copydoc userTickSpacing </BLOCKQUOTE>. \see userTickSpacing for more information */
2019-01-26 03:16:04 +08:00
inline double getUserTickSpacing ( ) const { return this - > userTickSpacing ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property userLogTickSpacing ( \copybrief userLogTickSpacing ). \details Description of the parameter userLogTickSpacing is: <BLOCKQUOTE>\copydoc userLogTickSpacing </BLOCKQUOTE>. \see userLogTickSpacing for more information */
2019-01-26 03:16:04 +08:00
inline double getUserLogTickSpacing ( ) const { return this - > userLogTickSpacing ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property labelType ( \copybrief labelType ). \details Description of the parameter labelType is: <BLOCKQUOTE>\copydoc labelType </BLOCKQUOTE>. \see labelType for more information */
inline JKQTPCALabelType getLabelType ( ) const { return this - > labelType ; }
/*! \brief returns the property axisLabel ( \copybrief axisLabel ). \details Description of the parameter axisLabel is: <BLOCKQUOTE>\copydoc axisLabel </BLOCKQUOTE>. \see axisLabel for more information */
2019-01-26 03:16:04 +08:00
inline QString getAxisLabel ( ) const { return this - > axisLabel ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property labelPosition ( \copybrief labelPosition ). \details Description of the parameter labelPosition is: <BLOCKQUOTE>\copydoc labelPosition </BLOCKQUOTE>. \see labelPosition for more information */
inline JKQTPLabelPosition getLabelPosition ( ) const { return this - > labelPosition ; }
/*! \brief returns the property labelFont ( \copybrief labelFont ). \details Description of the parameter labelFont is: <BLOCKQUOTE>\copydoc labelFont </BLOCKQUOTE>. \see labelFont for more information */
inline QString getLabelFont ( ) const { return this - > labelFont ; }
/*! \brief returns the property labelFontSize ( \copybrief labelFontSize ). \details Description of the parameter labelFontSize is: <BLOCKQUOTE>\copydoc labelFontSize </BLOCKQUOTE>. \see labelFontSize for more information */
inline double getLabelFontSize ( ) const { return this - > labelFontSize ; }
/*! \brief returns the property tickLabelFont ( \copybrief tickLabelFont ). \details Description of the parameter tickLabelFont is: <BLOCKQUOTE>\copydoc tickLabelFont </BLOCKQUOTE>. \see tickLabelFont for more information */
inline QString getTickLabelFont ( ) const { return this - > tickLabelFont ; }
/*! \brief returns the property tickLabelFontSize ( \copybrief tickLabelFontSize ). \details Description of the parameter tickLabelFontSize is: <BLOCKQUOTE>\copydoc tickLabelFontSize </BLOCKQUOTE>. \see tickLabelFontSize for more information */
inline double getTickLabelFontSize ( ) const { return this - > tickLabelFontSize ; }
/*! \brief returns the property minorTickLabelFontSize ( \copybrief minorTickLabelFontSize ). \details Description of the parameter minorTickLabelFontSize is: <BLOCKQUOTE>\copydoc minorTickLabelFontSize </BLOCKQUOTE>. \see minorTickLabelFontSize for more information */
inline double getMinorTickLabelFontSize ( ) const { return this - > minorTickLabelFontSize ; }
/*! \brief returns the property minorTickLabelFullNumber ( \copybrief minorTickLabelFullNumber ). \details Description of the parameter minorTickLabelFullNumber is: <BLOCKQUOTE>\copydoc minorTickLabelFullNumber </BLOCKQUOTE>. \see minorTickLabelFullNumber for more information */
inline bool getMinorTickLabelFullNumber ( ) const { return this - > minorTickLabelFullNumber ; }
/*! \brief returns the property tickLabelAngle ( \copybrief tickLabelAngle ). \details Description of the parameter tickLabelAngle is: <BLOCKQUOTE>\copydoc tickLabelAngle </BLOCKQUOTE>. \see tickLabelAngle for more information */
inline double getTickLabelAngle ( ) const { return this - > tickLabelAngle ; }
/*! \brief returns the property minTicks ( \copybrief minTicks ). \details Description of the parameter minTicks is: <BLOCKQUOTE>\copydoc minTicks </BLOCKQUOTE>. \see minTicks for more information */
inline unsigned int getMinTicks ( ) const { return this - > minTicks ; }
/*! \brief returns the property minorTicks ( \copybrief minorTicks ). \details Description of the parameter minorTicks is: <BLOCKQUOTE>\copydoc minorTicks </BLOCKQUOTE>. \see minorTicks for more information */
inline unsigned int getMinorTicks ( ) const { return this - > minorTicks ; }
/*! \brief returns the property tickOutsideLength ( \copybrief tickOutsideLength ). \details Description of the parameter tickOutsideLength is: <BLOCKQUOTE>\copydoc tickOutsideLength </BLOCKQUOTE>. \see tickOutsideLength for more information */
inline double getTickOutsideLength ( ) const { return this - > tickOutsideLength ; }
/*! \brief returns the property minorTickOutsideLength ( \copybrief minorTickOutsideLength ). \details Description of the parameter minorTickOutsideLength is: <BLOCKQUOTE>\copydoc minorTickOutsideLength </BLOCKQUOTE>. \see minorTickOutsideLength for more information */
inline double getMinorTickOutsideLength ( ) const { return this - > minorTickOutsideLength ; }
/*! \brief returns the property axisColor ( \copybrief axisColor ). \details Description of the parameter axisColor is: <BLOCKQUOTE>\copydoc axisColor </BLOCKQUOTE>. \see axisColor for more information */
2019-01-26 03:16:04 +08:00
inline QColor getAxisColor ( ) const { return this - > axisColor ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property showZeroAxis ( \copybrief showZeroAxis ). \details Description of the parameter showZeroAxis is: <BLOCKQUOTE>\copydoc showZeroAxis </BLOCKQUOTE>. \see showZeroAxis for more information */
2019-01-26 03:16:04 +08:00
inline bool getShowZeroAxis ( ) const { return this - > showZeroAxis ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property gridColor ( \copybrief gridColor ). \details Description of the parameter gridColor is: <BLOCKQUOTE>\copydoc gridColor </BLOCKQUOTE>. \see gridColor for more information */
2019-01-26 03:16:04 +08:00
inline QColor getGridColor ( ) const { return this - > gridColor ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property minorGridColor ( \copybrief minorGridColor ). \details Description of the parameter minorGridColor is: <BLOCKQUOTE>\copydoc minorGridColor </BLOCKQUOTE>. \see minorGridColor for more information */
inline QColor getMinorGridColor ( ) const { return this - > minorGridColor ; }
/*! \brief returns the property gridWidth ( \copybrief gridWidth ). \details Description of the parameter gridWidth is: <BLOCKQUOTE>\copydoc gridWidth </BLOCKQUOTE>. \see gridWidth for more information */
2019-01-26 03:16:04 +08:00
inline double getGridWidth ( ) const { return this - > gridWidth ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property gridStyle ( \copybrief gridStyle ). \details Description of the parameter gridStyle is: <BLOCKQUOTE>\copydoc gridStyle </BLOCKQUOTE>. \see gridStyle for more information */
2019-01-26 03:16:04 +08:00
inline Qt : : PenStyle getGridStyle ( ) const { return this - > gridStyle ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property minorGridWidth ( \copybrief minorGridWidth ). \details Description of the parameter minorGridWidth is: <BLOCKQUOTE>\copydoc minorGridWidth </BLOCKQUOTE>. \see minorGridWidth for more information */
inline double getMinorGridWidth ( ) const { return this - > minorGridWidth ; }
/*! \brief returns the property minorGridStyle ( \copybrief minorGridStyle ). \details Description of the parameter minorGridStyle is: <BLOCKQUOTE>\copydoc minorGridStyle </BLOCKQUOTE>. \see minorGridStyle for more information */
inline Qt : : PenStyle getMinorGridStyle ( ) const { return this - > minorGridStyle ; }
/*! \brief returns the property tickTimeFormat ( \copybrief tickTimeFormat ). \details Description of the parameter tickTimeFormat is: <BLOCKQUOTE>\copydoc tickTimeFormat </BLOCKQUOTE>. \see tickTimeFormat for more information */
inline QString getTickTimeFormat ( ) const { return this - > tickTimeFormat ; }
/*! \brief returns the property tickDateFormat ( \copybrief tickDateFormat ). \details Description of the parameter tickDateFormat is: <BLOCKQUOTE>\copydoc tickDateFormat </BLOCKQUOTE>. \see tickDateFormat for more information */
inline QString getTickDateFormat ( ) const { return this - > tickDateFormat ; }
/*! \brief returns the property tickDateTimeFormat ( \copybrief tickDateTimeFormat ). \details Description of the parameter tickDateTimeFormat is: <BLOCKQUOTE>\copydoc tickDateTimeFormat </BLOCKQUOTE>. \see tickDateTimeFormat for more information */
inline QString getTickDateTimeFormat ( ) const { return this - > tickDateTimeFormat ; }
/*! \brief returns the property tickMode ( \copybrief tickMode ). \details Description of the parameter tickMode is: <BLOCKQUOTE>\copydoc tickMode </BLOCKQUOTE>. \see tickMode for more information */
inline JKQTPLabelTickMode getTickMode ( ) const { return this - > tickMode ; }
/*! \brief returns the property drawMode1 ( \copybrief drawMode1 ). \details Description of the parameter drawMode1 is: <BLOCKQUOTE>\copydoc drawMode1 </BLOCKQUOTE>. \see drawMode1 for more information */
inline JKQTPCADrawMode getDrawMode1 ( ) const { return this - > drawMode1 ; }
/*! \brief returns the property drawMode2 ( \copybrief drawMode2 ). \details Description of the parameter drawMode2 is: <BLOCKQUOTE>\copydoc drawMode2 </BLOCKQUOTE>. \see drawMode2 for more information */
inline JKQTPCADrawMode getDrawMode2 ( ) const { return this - > drawMode2 ; }
/*! \brief returns the property minorTickWidth ( \copybrief minorTickWidth ). \details Description of the parameter minorTickWidth is: <BLOCKQUOTE>\copydoc minorTickWidth </BLOCKQUOTE>. \see minorTickWidth for more information */
inline double getMinorTickWidth ( ) const { return this - > minorTickWidth ; }
/*! \brief returns the property tickWidth ( \copybrief tickWidth ). \details Description of the parameter tickWidth is: <BLOCKQUOTE>\copydoc tickWidth </BLOCKQUOTE>. \see tickWidth for more information */
inline double getTickWidth ( ) const { return this - > tickWidth ; }
/*! \brief returns the property lineWidth ( \copybrief lineWidth ). \details Description of the parameter lineWidth is: <BLOCKQUOTE>\copydoc lineWidth </BLOCKQUOTE>. \see lineWidth for more information */
2019-01-26 03:16:04 +08:00
inline double getLineWidth ( ) const { return this - > lineWidth ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property lineWidthZeroAxis ( \copybrief lineWidthZeroAxis ). \details Description of the parameter lineWidthZeroAxis is: <BLOCKQUOTE>\copydoc lineWidthZeroAxis </BLOCKQUOTE>. \see lineWidthZeroAxis for more information */
2019-01-26 03:16:04 +08:00
inline double getLineWidthZeroAxis ( ) const { return this - > lineWidthZeroAxis ; }
2019-01-26 20:00:40 +08:00
/*! \brief returns the property tickLabelDistance ( \copybrief tickLabelDistance ). \details Description of the parameter tickLabelDistance is: <BLOCKQUOTE>\copydoc tickLabelDistance </BLOCKQUOTE>. \see tickLabelDistance for more information */
inline double getTickLabelDistance ( ) const { return this - > tickLabelDistance ; }
/*! \brief returns the property labelDistance ( \copybrief labelDistance ). \details Description of the parameter labelDistance is: <BLOCKQUOTE>\copydoc labelDistance </BLOCKQUOTE>. \see labelDistance for more information */
inline double getLabelDistance ( ) const { return this - > labelDistance ; }
/*! \brief returns the property drawGrid ( \copybrief drawGrid ). \details Description of the parameter drawGrid is: <BLOCKQUOTE>\copydoc drawGrid </BLOCKQUOTE>. \see drawGrid for more information */
inline bool getDrawGrid ( ) const { return this - > drawGrid ; }
/*! \brief returns the property drawMinorGrid ( \copybrief drawMinorGrid ). \details Description of the parameter drawMinorGrid is: <BLOCKQUOTE>\copydoc drawMinorGrid </BLOCKQUOTE>. \see drawMinorGrid for more information */
inline bool getDrawMinorGrid ( ) const { return this - > drawMinorGrid ; }
/*! \brief sets the property autoLabelDigits ( \copybrief autoLabelDigits ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoLabelDigits is : < BLOCKQUOTE > \ copydoc autoLabelDigits < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoLabelDigits for more information */
2019-01-26 20:00:40 +08:00
inline virtual void setAutoLabelDigits ( bool __value )
2019-01-10 04:23:24 +08:00
{
this - > autoLabelDigits = __value ;
}
2019-01-26 20:00:40 +08:00
/*! \brief returns the property autoLabelDigits ( \copybrief autoLabelDigits ).
2019-01-25 05:49:10 +08:00
\ details Description of the parameter autoLabelDigits is : < BLOCKQUOTE > \ copydoc autoLabelDigits < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see autoLabelDigits for more information */
2019-01-26 20:00:40 +08:00
inline virtual bool getAutoLabelDigits ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > autoLabelDigits ;
}
2019-01-26 20:00:40 +08:00
/*! \brief returns the property parent ( \copybrief parent ). \details Description of the parameter parent is: <BLOCKQUOTE>\copydoc parent </BLOCKQUOTE>. \see parent for more information */
inline JKQTBasePlotter * getParent ( ) const { return this - > parent ; }
/*! \brief sets the property doUpdateScaling ( \copybrief doUpdateScaling ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
\ details Description of the parameter doUpdateScaling is : < BLOCKQUOTE > \ copydoc doUpdateScaling < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see doUpdateScaling for more information */
2019-01-26 20:00:40 +08:00
inline virtual void setDoUpdateScaling ( bool __value )
2019-01-10 04:23:24 +08:00
{
this - > doUpdateScaling = __value ;
}
2019-01-26 20:00:40 +08:00
/*! \brief returns the property doUpdateScaling ( \copybrief doUpdateScaling ).
2019-01-25 05:49:10 +08:00
\ details Description of the parameter doUpdateScaling is : < BLOCKQUOTE > \ copydoc doUpdateScaling < / BLOCKQUOTE >
2019-01-10 04:23:24 +08:00
\ see doUpdateScaling for more information */
2019-01-26 20:00:40 +08:00
inline virtual bool getDoUpdateScaling ( ) const
2019-01-10 04:23:24 +08:00
{
return this - > doUpdateScaling ;
}
2015-07-11 18:56:02 +08:00
/** \brief returns the current min */
2018-11-25 21:53:26 +08:00
inline double getMin ( ) const { return axismin ; }
2015-07-11 18:56:02 +08:00
/** \brief returns the current max */
2018-11-25 21:53:26 +08:00
inline double getMax ( ) const { return axismax ; }
2015-07-11 18:56:02 +08:00
/** \brief returns the current absolute min */
2018-11-25 21:53:26 +08:00
inline double getAbsoluteMin ( ) const { return axisabsoultemin ; }
2015-07-11 18:56:02 +08:00
/** \brief returns the current absolute max */
2018-11-25 21:53:26 +08:00
inline double getAbsoluteMax ( ) const { return axisabsoultemax ; }
2015-07-11 18:56:02 +08:00
/** \brief calculate the scaling and offset values from axis min/max values
*
* This is only executed when \ c paramChanged = = true , as otherwise the data has to be still
* correct . recalculating may be forced by caling calcPlotScaing ( true ) ;
*/
void calcPlotScaling ( bool force = false ) ;
2018-11-25 21:53:26 +08:00
bool isLogAxis ( ) const ;
2015-07-11 18:56:02 +08:00
public slots :
/** \brief set range of plot axis */
void setRange ( double amin , double amax ) ;
/** \brief set absolute range of plot axis */
void setAbsoluteRange ( double aamin , double aamax ) ;
/** \brief do not use an absolute range of plot axis */
void setNoAbsoluteRange ( ) ;
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickSpacing ( \copybrief tickSpacing ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickSpacing is : < BLOCKQUOTE > \ copydoc tickSpacing < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see tickSpacing for more information */
2019-01-26 20:00:40 +08:00
virtual void setTickSpacing ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property axisMinWidth ( \copybrief axisMinWidth ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickSpacing is : < BLOCKQUOTE > \ copydoc axisMinWidth < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see axisMinWidth for more information */
2019-01-26 03:16:04 +08:00
virtual void setAxisMinWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property autoAxisSpacing ( \copybrief autoAxisSpacing ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter autoAxisSpacing is : < BLOCKQUOTE > \ copydoc autoAxisSpacing < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see autoAxisSpacing for more information */
2019-01-26 20:00:40 +08:00
virtual void setAutoAxisSpacing ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTickLabelsEnabled ( \copybrief minorTickLabelsEnabled ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorTickLabelsEnabled is : < BLOCKQUOTE > \ copydoc minorTickLabelsEnabled < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see autoAxisSpacing for more information */
2019-01-26 20:00:40 +08:00
virtual void setMinorTickLabelsEnabled ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property logAxis ( \copybrief logAxis ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter logAxis is : < BLOCKQUOTE > \ copydoc logAxis < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see logAxis for more information */
2019-01-26 20:00:40 +08:00
virtual void setLogAxis ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property logAxisBase ( \copybrief logAxisBase ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter logAxisBase is : < BLOCKQUOTE > \ copydoc logAxisBase < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see logAxisBase for more information */
2019-01-26 20:00:40 +08:00
virtual void setLogAxisBase ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property userTickSpacing ( \copybrief userTickSpacing ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter userTickSpacing is : < BLOCKQUOTE > \ copydoc userTickSpacing < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see userTickSpacing for more information */
2019-01-26 03:16:04 +08:00
virtual void setUserTickSpacing ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property userLogTickSpacing ( \copybrief userLogTickSpacing ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter userLogTickSpacing is : < BLOCKQUOTE > \ copydoc userLogTickSpacing < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see userLogTickSpacing for more information */
2019-01-26 03:16:04 +08:00
virtual void setUserLogTickSpacing ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property labelType ( \copybrief labelType ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter labelType is : < BLOCKQUOTE > \ copydoc labelType < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see labelType for more information */
2019-01-26 20:00:40 +08:00
virtual void setLabelType ( JKQTPCALabelType __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickMode ( \copybrief tickMode ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickMode is : < BLOCKQUOTE > \ copydoc tickMode < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see tickMode for more information */
2019-01-26 20:00:40 +08:00
virtual void setTickMode ( JKQTPLabelTickMode __value ) ;
/** \brief sets the property tickMode ( \copybrief tickMode ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickMode is : < BLOCKQUOTE > \ copydoc tickMode < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see tickMode for more information */
2019-01-26 20:00:40 +08:00
virtual void setTickMode ( int __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property axisLabel ( \copybrief axisLabel ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter axisLabel is : < BLOCKQUOTE > \ copydoc axisLabel < / BLOCKQUOTE >
2015-07-11 18:56:02 +08:00
* \ see axisLabel for more information */
2019-01-26 19:28:44 +08:00
virtual void setAxisLabel ( const QString & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property labelPosition ( \copybrief labelPosition ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter labelPosition is : < BLOCKQUOTE > \ copydoc labelPosition < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setLabelPosition ( JKQTPLabelPosition __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property labelFont ( \copybrief labelFont ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter labelFont is : < BLOCKQUOTE > \ copydoc labelFont < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setLabelFont ( const QString & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property labelFontSize ( \copybrief labelFontSize ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter labelFontSize is : < BLOCKQUOTE > \ copydoc labelFontSize < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setLabelFontSize ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickLabelFont ( \copybrief tickLabelFont ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickLabelFont is : < BLOCKQUOTE > \ copydoc tickLabelFont < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickLabelFont ( const QString & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickTimeFormat ( \copybrief tickTimeFormat ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickTimeFormat is : < BLOCKQUOTE > \ copydoc tickTimeFormat < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickTimeFormat ( const QString & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickDateFormat ( \copybrief tickDateFormat ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickDateFormat is : < BLOCKQUOTE > \ copydoc tickDateFormat < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickDateFormat ( const QString & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickDateTimeFormat ( \copybrief tickDateTimeFormat ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickDateTimeFormat is : < BLOCKQUOTE > \ copydoc tickDateTimeFormat < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickDateTimeFormat ( const QString & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickLabelFontSize ( \copybrief tickLabelFontSize ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickLabelFontSize is : < BLOCKQUOTE > \ copydoc tickLabelFontSize < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickLabelFontSize ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTickLabelFontSize ( \copybrief minorTickLabelFontSize ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorTickLabelFontSize is : < BLOCKQUOTE > \ copydoc minorTickLabelFontSize < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorTickLabelFontSize ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTickLabelFullNumber ( \copybrief minorTickLabelFullNumber ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorTickLabelFullNumber is : < BLOCKQUOTE > \ copydoc minorTickLabelFullNumber < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorTickLabelFullNumber ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minTicks ( \copybrief minTicks ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minTicks is : < BLOCKQUOTE > \ copydoc minTicks < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinTicks ( unsigned int __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTicks ( \copybrief minorTicks ) to the specified \a __value.
* \ details Description of the parameter minorTicks is : < BLOCKQUOTE > \ copydoc minorTicks < / BLOCKQUOTE > \ image html docu_logaxis_set_minorticks . png */
virtual void setMinorTicks ( unsigned int __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTicks ( \copybrief minorTicks ) to the specified \a __value.
* \ details Description of the parameter minorTicks is : < BLOCKQUOTE > \ copydoc minorTicks < / BLOCKQUOTE > \ image html docu_logaxis_set_minorticks . png */
virtual void setMinorTicks ( int __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickOutsideLength ( \copybrief tickOutsideLength ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickOutsideLength is : < BLOCKQUOTE > \ copydoc tickOutsideLength < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickOutsideLength ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTickOutsideLength ( \copybrief minorTickOutsideLength ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorTickOutsideLength is : < BLOCKQUOTE > \ copydoc minorTickOutsideLength < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorTickOutsideLength ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickInsideLength ( \copybrief tickInsideLength ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickInsideLength is : < BLOCKQUOTE > \ copydoc tickInsideLength < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickInsideLength ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTickInsideLength ( \copybrief minorTickInsideLength ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorTickInsideLength is : < BLOCKQUOTE > \ copydoc minorTickInsideLength < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorTickInsideLength ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property axisColor ( \copybrief axisColor ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter axisColor is : < BLOCKQUOTE > \ copydoc axisColor < / BLOCKQUOTE > */
2019-01-26 19:28:44 +08:00
virtual void setAxisColor ( const QColor & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property showZeroAxis ( \copybrief showZeroAxis ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter showZeroAxis is : < BLOCKQUOTE > \ copydoc showZeroAxis < / BLOCKQUOTE > */
2019-01-26 03:16:04 +08:00
virtual void setShowZeroAxis ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property inverted ( \copybrief inverted ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter inverted is : < BLOCKQUOTE > \ copydoc inverted < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setInverted ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property gridColor ( \copybrief gridColor ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter gridColor is : < BLOCKQUOTE > \ copydoc gridColor < / BLOCKQUOTE > */
2019-01-26 19:28:44 +08:00
virtual void setGridColor ( const QColor & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorGridColor ( \copybrief minorGridColor ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorGridColor is : < BLOCKQUOTE > \ copydoc minorGridColor < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorGridColor ( const QColor & __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property gridWidth ( \copybrief gridWidth ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter gridWidth is : < BLOCKQUOTE > \ copydoc gridWidth < / BLOCKQUOTE > */
2019-01-26 03:16:04 +08:00
virtual void setGridWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property gridStyle ( \copybrief gridStyle ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter gridStyle is : < BLOCKQUOTE > \ copydoc gridStyle < / BLOCKQUOTE > */
2019-01-26 03:16:04 +08:00
virtual void setGridStyle ( Qt : : PenStyle __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorGridWidth ( \copybrief minorGridWidth ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorGridWidth is : < BLOCKQUOTE > \ copydoc minorGridWidth < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorGridWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorGridStyle ( \copybrief minorGridStyle ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorGridStyle is : < BLOCKQUOTE > \ copydoc minorGridStyle < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorGridStyle ( Qt : : PenStyle __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property drawMode1 ( \copybrief drawMode1 ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter drawMode1 is : < BLOCKQUOTE > \ copydoc drawMode1 < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setDrawMode1 ( JKQTPCADrawMode __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property drawMode2 ( \copybrief drawMode2 ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter drawMode2 is : < BLOCKQUOTE > \ copydoc drawMode2 < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setDrawMode2 ( JKQTPCADrawMode __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property minorTickWidth ( \copybrief minorTickWidth ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter minorTickWidth is : < BLOCKQUOTE > \ copydoc minorTickWidth < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setMinorTickWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickWidth ( \copybrief tickWidth ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickWidth is : < BLOCKQUOTE > \ copydoc tickWidth < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property lineWidth ( \copybrief lineWidth ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter lineWidth is : < BLOCKQUOTE > \ copydoc lineWidth < / BLOCKQUOTE > */
2019-01-26 03:16:04 +08:00
virtual void setLineWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property lineWidthZeroAxis ( \copybrief lineWidthZeroAxis ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter lineWidthZeroAxis is : < BLOCKQUOTE > \ copydoc lineWidthZeroAxis < / BLOCKQUOTE > */
2019-01-26 03:16:04 +08:00
virtual void setLineWidthZeroAxis ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickLabelDistance ( \copybrief tickLabelDistance ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickLabelDistance is : < BLOCKQUOTE > \ copydoc tickLabelDistance < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickLabelDistance ( double __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property labelDistance ( \copybrief labelDistance ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter labelDistance is : < BLOCKQUOTE > \ copydoc labelDistance < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setLabelDistance ( double __value ) ;
/** \brief sets the property labelDigits ( \copybrief labelDigits ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter labelDistance is : < BLOCKQUOTE > \ copydoc labelDigits < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setLabelDigits ( int __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property drawGrid ( \copybrief drawGrid ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter drawGrid is : < BLOCKQUOTE > \ copydoc drawGrid < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setDrawGrid ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property drawMinorGrid ( \copybrief drawMinorGrid ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter drawMinorGrid is : < BLOCKQUOTE > \ copydoc drawMinorGrid < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setDrawMinorGrid ( bool __value ) ;
2015-07-11 18:56:02 +08:00
2019-01-26 20:00:40 +08:00
/** \brief sets the property tickLabelAngle ( \copybrief tickLabelAngle ) to the specified \a __value.
2019-01-25 05:49:10 +08:00
* \ details Description of the parameter tickLabelAngle is : < BLOCKQUOTE > \ copydoc tickLabelAngle < / BLOCKQUOTE > */
2019-01-26 20:00:40 +08:00
virtual void setTickLabelAngle ( double __value ) ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief indicates whether one of the parameters has changed sinse the last recalculation of tickspacing ... */
bool paramsChanged ;
bool doUpdateScaling ;
2019-01-26 19:28:44 +08:00
/** \brief simply calls the redrawPlot method of the parent plotter class */
void redrawPlot ( ) ;
2015-07-11 18:56:02 +08:00
/** \brief a list of tick labels.
*
* If this list contains items , this class will NOT plot a standard x - axis ,
* but only mark the positions in this list . Every item is a x - position together with
* the label to be plotted there . The label may contain LaTeX markup .
*/
QVector < QPair < double , QString > > tickLabels ;
/** \brief width of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotWidth ( ) const = 0 ;
2015-07-11 18:56:02 +08:00
/** \brief offset of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotOffset ( ) const = 0 ;
2015-07-11 18:56:02 +08:00
/** \brief width of other (perpendicular) axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisWidth ( ) const = 0 ;
2015-07-11 18:56:02 +08:00
/** \brief is other (perpendicular) axis inverted (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual bool getParentOtheraxisInverted ( ) const = 0 ;
2015-07-11 18:56:02 +08:00
/** \brief pixel offset of (perpendicular) other axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisOffset ( ) const = 0 ;
2019-01-20 17:49:29 +08:00
/** \brief retun parents JKQTMathText* object */
2019-01-26 20:00:40 +08:00
virtual JKQTMathText * getParentMathText ( ) ;
2015-07-11 18:56:02 +08:00
/** \brief convert a float to a tick label string */
QString floattolabel ( double data ) ;
/** \brief convert a float to a tick label string with a given precision */
QString floattolabel ( double data , int past_comma ) ;
/** \brief parent plotter class */
2019-01-20 17:49:29 +08:00
JKQTBasePlotter * parent ;
2015-07-11 18:56:02 +08:00
/** \brief current view: minimum of time axis */
double axismin ;
/** \brief current view: maximum of time axis */
double axismax ;
/** \brief absoulte minimum of axis (axismin/axismax xan not be set below this) */
double axisabsoultemin ;
/** \brief absoulte maximum of axis (axismin/axismax xan not be set above this) */
double axisabsoultemax ;
/** \brief absolute minimum range width, feature switched off when <0 */
double axisMinWidth ;
/** \brief width of plot on time axis (calculated by calcPlotScaling() ) */
double width ;
/** \brief time axis scaling factor (calculated by calcPlotScaling() ) */
double scale ;
/** \brief time axis offset (calculated by calcPlotScaling() ) */
double offset ;
/** \brief indicates whether the axis is to be inverted or not */
bool inverted ;
/** \brief axis tick spacing (calculated by calcPlotScaling() and calcTickSpacing() ) for logarithmic/linear axes.
*/
double tickSpacing ;
/** \brief axis tick spacing for logarithmic ticks (calculated by calcPlotScaling() and calcTickSpacing() ) axes.
*/
double tickSpacingLog ;
/** \brief digits used for tick labels */
int labelDigits ;
/** \brief x position of the first tick (calculated by calcPlotScaling() ). Given in system coordinates, not pixel coordinates. */
double tickStart ;
/** \brief when \c true, the digits of the labels are calculated automatically */
bool autoLabelDigits ;
/** \brief indicates whether the object should use automatic tick spacing for the x axis (calculated by calcPlotScaling() ) */
2019-01-09 04:00:25 +08:00
bool autoAxisSpacing ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property autoAxisSpacing. \see autoAxisSpacing for more information */
bool default_autoAxisSpacing ;
2015-07-11 18:56:02 +08:00
/** \brief if \c true, the plotter displays minor axis labels as number between 1 and 10 in some cases */
2019-01-09 04:00:25 +08:00
bool minorTickLabelsEnabled ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorTickLabelsEnabled. \see minorTickLabelsEnabled for more information */
bool default_minorTickLabelsEnabled ;
2015-07-11 18:56:02 +08:00
/** \brief indicates whether the y axis has a logarithmic scale */
2019-01-09 04:00:25 +08:00
bool logAxis ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property logAxis. \see logAxis for more information */
bool default_logAxis ;
2015-07-11 18:56:02 +08:00
/** \brief the base for a logarithmic x axis */
2019-01-09 04:00:25 +08:00
double logAxisBase ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property logAxisBase. \see logAxisBase for more information */
double default_logAxisBase ;
2015-07-11 18:56:02 +08:00
/** \brief if autoXAxisSpacing is \c false then this value is used for xTickSpacing. So this is the property which
* is editable by use of public access methods .
*/
2019-01-09 04:00:25 +08:00
double userTickSpacing ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property userTickSpacing. \see userTickSpacing for more information */
double default_userTickSpacing ;
2015-07-11 18:56:02 +08:00
/** \brief if autoXAxisSpacing is \c false then this value is used for xTickSpacing. So this is the property which
* is editable by use of public access methods .
*/
2019-01-09 04:00:25 +08:00
double userLogTickSpacing ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property userLogTickSpacing. \see userLogTickSpacing for more information */
double default_userLogTickSpacing ;
2015-07-11 18:56:02 +08:00
/** \brief indicates how to draw the labels */
2019-01-20 17:49:29 +08:00
JKQTPCALabelType labelType ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property labelType. \see labelType for more information */
JKQTPCALabelType default_labelType ;
2015-07-11 18:56:02 +08:00
/** \brief mode of the major ticks */
2019-01-09 04:00:25 +08:00
JKQTPLabelTickMode tickMode ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickMode. \see tickMode for more information */
JKQTPLabelTickMode default_tickMode ;
2015-07-11 18:56:02 +08:00
/** \brief axis label of the axis */
QString axisLabel ;
/** \brief position of the axis label */
2019-01-20 17:49:29 +08:00
JKQTPLabelPosition labelPosition ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property labelPosition. \see labelPosition for more information */
JKQTPLabelPosition default_labelPosition ;
2015-07-11 18:56:02 +08:00
/** \brief font of the axis labels */
2019-01-09 04:00:25 +08:00
QString labelFont ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property labelFont. \see labelFont for more information */
QString default_labelFont ;
2015-07-11 18:56:02 +08:00
/** \brief fontsize of the axis labels */
2019-01-09 04:00:25 +08:00
double labelFontSize ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property labelFontSize. \see labelFontSize for more information */
double default_labelFontSize ;
2015-07-11 18:56:02 +08:00
/** \brief font of the axis tick labels */
2019-01-09 04:00:25 +08:00
QString tickLabelFont ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickLabelFont. \see tickLabelFont for more information */
QString default_tickLabelFont ;
2015-07-11 18:56:02 +08:00
/** \brief fontsize of the axis tick labels */
2019-01-09 04:00:25 +08:00
double tickLabelFontSize ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickLabelFontSize. \see tickLabelFontSize for more information */
double default_tickLabelFontSize ;
2015-07-11 18:56:02 +08:00
/** \brief fontsize of the minor axis tick labels */
2019-01-09 04:00:25 +08:00
double minorTickLabelFontSize ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorTickLabelFontSize. \see minorTickLabelFontSize for more information */
double default_minorTickLabelFontSize ;
2015-07-11 18:56:02 +08:00
/** \brief indicates whether to draw a thick axis line at x=0 (zero axis) */
2019-01-09 04:00:25 +08:00
bool showZeroAxis ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property showZeroAxis. \see showZeroAxis for more information */
bool default_showZeroAxis ;
2015-07-11 18:56:02 +08:00
/** \brief indicates whether the minor tick labels should be full numbers, or just a number between 0..10 */
2019-01-09 04:00:25 +08:00
bool minorTickLabelFullNumber ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorTickLabelFullNumber. \see minorTickLabelFullNumber for more information */
bool default_minorTickLabelFullNumber ;
2015-07-11 18:56:02 +08:00
/** \brief draw mode of the main (left/bottom) axis */
2019-01-20 17:49:29 +08:00
JKQTPCADrawMode drawMode1 ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property drawMode1. \see drawMode1 for more information */
JKQTPCADrawMode default_drawMode1 ;
2015-07-11 18:56:02 +08:00
/** \brief draw mode of the secondary (right/top) axis */
2019-01-20 17:49:29 +08:00
JKQTPCADrawMode drawMode2 ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property drawMode2. \see drawMode2 for more information */
JKQTPCADrawMode default_drawMode2 ;
2019-01-20 23:15:10 +08:00
/** \brief line width of minor ticks in pt */
2019-01-09 04:00:25 +08:00
double minorTickWidth ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorTickWidth. \see minorTickWidth for more information */
double default_minorTickWidth ;
2019-01-20 23:15:10 +08:00
/** \brief line width of ticks in pt */
2019-01-09 04:00:25 +08:00
double tickWidth ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickWidth. \see tickWidth for more information */
double default_tickWidth ;
2019-01-20 23:15:10 +08:00
/** \brief line width of axis in pt */
2019-01-09 04:00:25 +08:00
double lineWidth ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property lineWidth. \see lineWidth for more information */
double default_lineWidth ;
2019-01-20 23:15:10 +08:00
/** \brief line width of 0-line in pt */
2019-01-09 04:00:25 +08:00
double lineWidthZeroAxis ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property lineWidthZeroAxis. \see lineWidthZeroAxis for more information */
double default_lineWidthZeroAxis ;
2015-07-11 18:56:02 +08:00
2018-12-01 23:02:04 +08:00
/** \brief format string for time tick labels, see see QDateTime::toString() documentation for details on format strings */
2019-01-09 04:00:25 +08:00
QString tickTimeFormat ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickTimeFormat. \see tickTimeFormat for more information */
QString default_tickTimeFormat ;
2018-12-01 23:02:04 +08:00
/** \brief format string for date tick labels, see see QDateTime::toString() documentation for details on format strings */
2019-01-09 04:00:25 +08:00
QString tickDateFormat ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickDateFormat. \see tickDateFormat for more information */
QString default_tickDateFormat ;
2018-12-01 23:02:04 +08:00
/** \brief format string for datetime tick labels, see see QDateTime::toString() documentation for details on format strings */
2019-01-09 04:00:25 +08:00
QString tickDateTimeFormat ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickDateTimeFormat. \see tickDateTimeFormat for more information */
QString default_tickDateTimeFormat ;
2015-07-11 18:56:02 +08:00
/** \brief calculates the tick spacing for a linear axis that spans \a awidth and that should
* show at least \ a minTicks ticks .
*
* The < b > algorithm < / b > used in here works as follows :
*
* There is only a limited subset of allowed tick distances . These distances are 1 ( resulting in 10 ticks per decade , i . e . 0 , 1 , 2 , 3 , 4 , . . . ) ,
* 2 ( 5 ticks / decade , i . e . 0 , 2 , 4 , . . . ) , 2.5 ( 4 ticks / decade , i . e . 0 , 2.5 , 5 , . . . ) and 5 ( 2 ticks / decade , i . e . 0 , 5 , 10 , 15 , . . . ) . So the
* axis is divided into decades that each is divided into ticks , as defined above . With these preconditions the algorithm tries
* to find a tick increment \ f $ \ Delta \ mbox { tick } \ f $ which is one of the above distances multiplied by a power \ f $ \ rho \ f $ of 10.
* This increment is determined in a way , that the axis contains at least \ a minTicks ticks :
2019-01-12 23:01:55 +08:00
* \ f [ \ Delta \ mbox { tick } = f \ cdot 10 ^ \ rho , \ \ \ \ \ f \ in \ { 1 , 2 , 2.5 , 5 \ } \ f ]
2015-07-11 18:56:02 +08:00
*
* - # The algorithm starts by finding a start exponent \ f $ \ rho_s = \ left \ lfloor \ log_ { 10 } ( \ mbox { awidth } ) \ right \ rfloor + 3 \ f $ . This
* is a good ( over ) estimate for the biggest possible power \ f $ \ rho \ f $ .
* - # now we set \ f $ \ rho = \ rho_0 \ f $ and \ f $ f = 10 \ f $ .
* - # now the algorithm cycles through all possible factors \ f $ f \ in \ { 1 , 2 , 2.5 , 5 , 10 \ } \ f $ ( starting from 10 ) and calculates
2019-01-12 23:01:55 +08:00
* \ f $ \ Delta \ mbox { tick } = f \ cdot 10 ^ \ rho \ f $ . Then it checks whether \ f $ \ mbox { tickcount } = \ mbox { round } \ left ( \ frac { \ mbox { awidth } } { \ Delta \ mbox { tick } } \ right ) \ f $
2015-07-11 18:56:02 +08:00
* is smaller than \ a minTicks ( if yes the algorithm reached its end and \ f $ \ Delta \ mbox { tick } \ f $ can be used .
* - # if \ f $ f = 1 \ f $ is reached and checked \ c false , then the algorithm decreases the exponent \ f $ \ rho \ leftarrow \ rho - 1 \ f $ and returns to step 3.
*
*/
double calcLinearTickSpacing ( ) ;
double calcLogTickSpacing ( ) ;
/** \brief Calculate the number of digits needed for the labels of an axis that starts at
* \ a minval and where the tick spacing is \ a tickSpacing .
*
* This method determines how many digits to output for the labels on a coordinate axis .
* This is done by testing different digit numbers and comparing subsequent labels . If two labels
* are equal , then we need more valid digits to distinguish them .
*/
int calcLinearUnitDigits ( ) ;
/** \brief minimum number of axis ticks */
2019-01-09 04:00:25 +08:00
unsigned int minTicks ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minTicks. \see minTicks for more information */
unsigned int default_minTicks ;
/** \brief number of minor grid lines per axis tick interval
*
* \ image html docu_logaxis_set_minorticks . png
* */
2019-01-09 04:00:25 +08:00
unsigned int minorTicks ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorTicks. \see minorTicks for more information
*
* \ image html docu_logaxis_set_minorticks . png
*/
unsigned int default_minorTicks ;
2015-07-11 18:56:02 +08:00
/** \brief length of an axis tick outside the plot border in pt */
2019-01-09 04:00:25 +08:00
double tickOutsideLength ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickOutsideLength. \see tickOutsideLength for more information */
double default_tickOutsideLength ;
2015-07-11 18:56:02 +08:00
/** \brief length of a minor axis tick outside the plot border in pt */
2019-01-09 04:00:25 +08:00
double minorTickOutsideLength ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorTickOutsideLength. \see minorTickOutsideLength for more information */
double default_minorTickOutsideLength ;
2015-07-11 18:56:02 +08:00
/** \brief length of an axis tick inside the plot border in pt */
2019-01-09 04:00:25 +08:00
double tickInsideLength ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickInsideLength. \see tickInsideLength for more information */
double default_tickInsideLength ;
2015-07-11 18:56:02 +08:00
/** \brief length of a minor axis tick inside the plot border in pt */
2019-01-09 04:00:25 +08:00
double minorTickInsideLength ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorTickInsideLength. \see minorTickInsideLength for more information */
double default_minorTickInsideLength ;
2015-07-11 18:56:02 +08:00
/** \brief color of the axis (labels, ticks, axis itself ...) */
2019-01-09 04:00:25 +08:00
QColor axisColor ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property axisColor. \see axisColor for more information */
QColor default_axisColor ;
2015-07-11 18:56:02 +08:00
/** \brief distance between tick end and label start in pt */
2019-01-09 04:00:25 +08:00
double tickLabelDistance ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickLabelDistance. \see tickLabelDistance for more information */
double default_tickLabelDistance ;
2015-07-11 18:56:02 +08:00
/** \brief distance between tick label and axis label in pt */
2019-01-09 04:00:25 +08:00
double labelDistance ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property labelDistance. \see labelDistance for more information */
double default_labelDistance ;
2015-07-11 18:56:02 +08:00
/** \brief rotation angle of tick labels [-180..180], i.e. given in degrees, default is 0 (horizontal) */
2019-01-09 04:00:25 +08:00
double tickLabelAngle ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property tickLabelAngle. \see tickLabelAngle for more information */
double default_tickLabelAngle ;
2015-07-11 18:56:02 +08:00
/** \brief indicates whether to draw the major grid lines */
2019-01-09 04:00:25 +08:00
bool drawGrid ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property drawGrid. \see drawGrid for more information */
bool default_drawGrid ;
2015-07-11 18:56:02 +08:00
/** \brief indicates whether to draw the minor grid lines */
2019-01-09 04:00:25 +08:00
bool drawMinorGrid ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property drawMinorGrid. \see drawMinorGrid for more information */
bool default_drawMinorGrid ;
2015-07-11 18:56:02 +08:00
/** \brief color of the grid*/
2019-01-09 04:00:25 +08:00
QColor gridColor ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property gridColor. \see gridColor for more information */
QColor default_gridColor ;
2015-07-11 18:56:02 +08:00
/** \brief color of the minor grid lines */
2019-01-09 04:00:25 +08:00
QColor minorGridColor ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorGridColor. \see minorGridColor for more information */
QColor default_minorGridColor ;
2015-07-11 18:56:02 +08:00
/** \brief width of the grid lines (in pixel) */
2019-01-09 04:00:25 +08:00
double gridWidth ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property gridWidth. \see gridWidth for more information */
double default_gridWidth ;
2015-07-11 18:56:02 +08:00
/** \brief line stye of the grid lines */
2019-01-09 04:00:25 +08:00
Qt : : PenStyle gridStyle ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property gridStyle. \see gridStyle for more information */
Qt : : PenStyle default_gridStyle ;
2015-07-11 18:56:02 +08:00
/** \brief width of the minor grid lines (in pixel) */
2019-01-09 04:00:25 +08:00
double minorGridWidth ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorGridWidth. \see minorGridWidth for more information */
double default_minorGridWidth ;
2015-07-11 18:56:02 +08:00
/** \brief line stye of the minor grid lines */
2019-01-09 04:00:25 +08:00
Qt : : PenStyle minorGridStyle ;
2019-01-26 20:00:40 +08:00
/*! \brief default value for property property minorGridStyle. \see minorGridStyle for more information */
Qt : : PenStyle default_minorGridStyle ;
2015-07-11 18:56:02 +08:00
/** \brief axis prefix for storage of parameters */
QString axisPrefix ;
/** \brief this is used by x2p() and p2x() to determine the sign */
double scaleSign ;
/** \brief calculates the next label from the given parameters.
*
* \ return \ c true on success and \ c false if there is no more label
* \ param x \ b before \ b call : the position of the label for which the text should be returned ( or tickStart for first call ) ,
* \ b after \ b call : position of the next label ( given in world coordinates ! )
* \ param label \ b after \ b call : text of the ( input ) tick label This is an empty string , if the label is not visible !
* \ param init call this function with \ c init = true to obtain the first label ( at tickStart )
*/
bool getNextLabel ( double & x , QString & label , bool init = false ) ;
/** \brief returns the distance from the current tick position (x before call) to the next tick position */
double getNextLabelDistance ( double x ) ;
/** \brief calculates the maximum width and height (returned as QSize) of all tick labels.
* Ascent and descent may also be returned in the two additional pointer arguments - */
2018-11-18 18:59:30 +08:00
QSizeF getMaxTickLabelSize ( JKQTPEnhancedPainter & painter , double * ascent = nullptr , double * descent = nullptr ) ;
2015-07-11 18:56:02 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief implements a vertical axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
2019-01-19 16:40:52 +08:00
\ ingroup jkqtpbaseplotter_elements
2015-07-11 18:56:02 +08:00
*/
2019-02-03 21:04:48 +08:00
class JKQTP_LIB_EXPORT JKQTPVerticalAxis : public JKQTPCoordinateAxis {
2015-07-11 18:56:02 +08:00
Q_OBJECT
protected :
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPVerticalAxis ( JKQTBasePlotter * parent ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 23:15:10 +08:00
/** \brief returns the size of the left/bottom axis in pt */
2018-12-28 05:52:00 +08:00
virtual QSize getSize1 ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
2019-01-20 23:15:10 +08:00
/** \brief returns the size of the right/top axis in pt */
2018-12-28 05:52:00 +08:00
virtual QSize getSize2 ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/** \brief draw axes */
2018-12-28 05:52:00 +08:00
virtual void drawAxes ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/** \brief draw grids */
2018-12-28 05:52:00 +08:00
virtual void drawGrids ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief width of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotWidth ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief offset of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel of other (perpendicular) axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisWidth ( ) const override ;
virtual bool getParentOtheraxisInverted ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel offset of (perpendicular) other axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
2018-12-28 05:52:00 +08:00
virtual void drawTickLabel1 ( JKQTPEnhancedPainter & painter , double xx , double yy , const QString & label , double fontSize ) ;
virtual void drawTickLabel2 ( JKQTPEnhancedPainter & painter , double xx , double yy , const QString & label , double fontSize ) ;
2015-07-11 18:56:02 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief implements a position-indipendent vertical axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
2019-01-19 16:40:52 +08:00
\ ingroup jkqtpbaseplotter_elements
2015-07-11 18:56:02 +08:00
This axis may be draw at a user - supplied position ( used e . g . for color bar axes )
*/
2019-02-03 21:04:48 +08:00
class JKQTP_LIB_EXPORT JKQTPVerticalIndependentAxis : public JKQTPVerticalAxis {
2015-07-11 18:56:02 +08:00
Q_OBJECT
protected :
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPVerticalIndependentAxis ( double axisOffset , double axisWidth , double otherAxisOffset , double otherAxisWidth , JKQTBasePlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief set the axis offset */
2019-01-26 03:16:04 +08:00
virtual void setAxisOffset ( double __value ) ;
2015-07-11 18:56:02 +08:00
/** \brief set the axis width */
2019-01-26 03:16:04 +08:00
virtual void setAxisWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
/** \brief set the other axis offset */
2019-01-26 20:00:40 +08:00
virtual void setOtherAxisOffset ( double __value ) ;
2015-07-11 18:56:02 +08:00
/** \brief set the other axis width */
2019-01-26 20:00:40 +08:00
virtual void setOtherAxisWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
/** \brief set the other axis width */
2019-01-26 20:00:40 +08:00
virtual void setOtherAxisInverted ( bool __value ) ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief width of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotWidth ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief offset of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel of other (perpendicular) axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisWidth ( ) const override ;
virtual bool getParentOtheraxisInverted ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel offset of (perpendicular) other axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
double axisOffset ;
double axisWidth ;
double otherAxisWidth ;
double otherAxisOffset ;
bool otherAxisInverted ;
} ;
2019-01-20 17:49:29 +08:00
/*! \brief implements a horizontal axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
2019-01-19 16:40:52 +08:00
\ ingroup jkqtpbaseplotter_elements
2015-07-11 18:56:02 +08:00
*/
2019-02-03 21:04:48 +08:00
class JKQTP_LIB_EXPORT JKQTPHorizontalAxis : public JKQTPCoordinateAxis {
2015-07-11 18:56:02 +08:00
Q_OBJECT
protected :
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPHorizontalAxis ( JKQTBasePlotter * parent ) ;
2015-07-11 18:56:02 +08:00
2019-01-20 23:15:10 +08:00
/** \brief returns the size of the left/bottom axis in pt */
2018-12-28 05:52:00 +08:00
virtual QSize getSize1 ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
2019-01-20 23:15:10 +08:00
/** \brief returns the size of the right/top axis in pt */
2018-12-28 05:52:00 +08:00
virtual QSize getSize2 ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/** \brief draw axes */
2018-12-28 05:52:00 +08:00
virtual void drawAxes ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
/** \brief draw grids */
2018-12-28 05:52:00 +08:00
virtual void drawGrids ( JKQTPEnhancedPainter & painter ) override ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief width of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotWidth ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief offset of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel of other (perpendicular) axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisWidth ( ) const override ;
virtual bool getParentOtheraxisInverted ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel offset of (perpendicular) other axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
2018-12-28 05:52:00 +08:00
virtual void drawTickLabel1 ( JKQTPEnhancedPainter & painter , double xx , double yy , const QString & label , double fontSize , double ascentMax , double descentMax ) ;
virtual void drawTickLabel2 ( JKQTPEnhancedPainter & painter , double xx , double yy , const QString & label , double fontSize , double ascentMax , double descentMax ) ;
2015-07-11 18:56:02 +08:00
} ;
2019-01-20 17:49:29 +08:00
/*! \brief implements a position-indipendent horizontal axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoordinateAxis).
2019-01-19 16:40:52 +08:00
\ ingroup jkqtpbaseplotter_elements
2015-07-11 18:56:02 +08:00
This axis may be draw at a user - supplied position ( used e . g . for color bar axes )
*/
2019-02-03 21:04:48 +08:00
class JKQTP_LIB_EXPORT JKQTPHorizontalIndependentAxis : public JKQTPHorizontalAxis {
2015-07-11 18:56:02 +08:00
Q_OBJECT
protected :
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPHorizontalIndependentAxis ( double axisOffset , double axisWidth , double otherAxisOffset , double otherAxisWidth , JKQTBasePlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief se the axis offset */
2019-01-26 03:16:04 +08:00
virtual void setAxisOffset ( double __value ) ;
2015-07-11 18:56:02 +08:00
/** \brief se the axis width */
2019-01-26 03:16:04 +08:00
virtual void setAxisWidth ( double __value ) ;
2015-07-11 18:56:02 +08:00
/** \brief set the other axis offset */
2019-01-26 20:00:40 +08:00
virtual void setOtherAxisOffset ( double __value ) ;
2015-07-11 18:56:02 +08:00
/** \brief set the other axis width */
2019-01-26 20:00:40 +08:00
virtual void setOtherAxisWidth ( double __value ) ;
virtual void setOtherAxisInverted ( bool __value ) ;
2015-07-11 18:56:02 +08:00
protected :
/** \brief width of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotWidth ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief offset of the plot in the direction of the axis */
2019-01-26 20:00:40 +08:00
virtual double getParentPlotOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel of other (perpendicular) axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisWidth ( ) const override ;
virtual bool getParentOtheraxisInverted ( ) const override ;
2015-07-11 18:56:02 +08:00
/** \brief pixel offset of (perpendicular) other axis (needed for grids) */
2019-01-26 20:00:40 +08:00
virtual double getParentOtheraxisOffset ( ) const override ;
2015-07-11 18:56:02 +08:00
double axisOffset ;
double axisWidth ;
double otherAxisWidth ;
double otherAxisOffset ;
bool otherAxisInverted ;
} ;
# endif // JKQTPBASEELEMENTS_H