2015-07-11 18:56:02 +08:00
/*
2018-11-25 21:53:26 +08:00
Copyright ( c ) 2008 - 2018 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/>.
*/
/**
* \ defgroup jkqtplotter_elements Plot Elements
* \ ingroup jkqtplotter
* \ defgroup jkqtplotter_plots Graphs
* \ ingroup jkqtplotter_elements
*/
2018-12-19 00:13:18 +08:00
/** \file jkqtpgraphs.h
2015-07-11 18:56:02 +08:00
* \ ingroup jkqtplotter
*/
# include <QString>
# include <QPainter>
# include <QPair>
2018-11-26 03:25:44 +08:00
# include "jkqtplottertools/jkqtptools.h"
# include "jkqtplottertools/jkqtp_imexport.h"
2018-12-19 00:13:18 +08:00
# include "jkqtplottertools/jkqtpdrawingtools.h"
# include "jkqtplotter/jkqtpgraphsbase.h"
# include "jkqtplottertools/jkqtpenhancedpainter.h"
2015-07-11 18:56:02 +08:00
2018-12-19 00:13:18 +08:00
# ifndef jkqtpgraphs_H
# define jkqtpgraphs_H
2015-07-11 18:56:02 +08:00
// forward declarations
class JKQtBasePlotter ;
2015-08-02 19:36:54 +08:00
class JKQtPlotter ;
2015-07-11 18:56:02 +08:00
class JKQTPcoordinateAxis ;
class JKQTPdatastore ;
//class JKQTPColorPaletteTools;
/*! \brief This implements xy line plots. This also alows to draw symbols at the data points.
\ ingroup jkqtplotter_plots
\ image html plot_lineplots . png
*/
class LIB_EXPORT JKQTPxyLineGraph : public JKQTPxyGraph {
Q_OBJECT
public :
/** \brief class constructor */
2018-11-18 18:59:30 +08:00
JKQTPxyLineGraph ( JKQtBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2015-08-04 01:04:19 +08:00
JKQTPxyLineGraph ( JKQtPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
virtual void draw ( JKQTPEnhancedPainter & painter ) ;
/** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) ;
/** \brief returns the color to be used for the key label */
virtual QColor getKeyLabelColor ( ) ;
JKQTPGET_SET_MACRO ( QColor , color )
JKQTPGET_SET_MACRO ( QColor , fillColor )
JKQTPGET_SET_MACRO ( Qt : : PenStyle , style )
JKQTPGET_SET_MACRO ( double , lineWidth )
JKQTPGET_SET_MACRO ( JKQTPgraphSymbols , symbol )
JKQTPGET_SET_MACRO ( double , symbolWidth )
JKQTPGET_SET_MACRO ( double , symbolSize )
JKQTPGET_SET_MACRO ( bool , drawLine )
JKQTPGET_SET_MACRO ( bool , drawSelectionLine )
JKQTPGET_SET_MACRO ( QColor , selectionLineColor )
protected :
/** \brief if \c true, draws a thick shadow around the line*/
bool drawSelectionLine ;
/** \brief color for the shadow, or a lighter version of the line color, if transparent (default) */
QColor selectionLineColor ;
/** \brief which plot style to use from the parent plotter (via JKQtPlotterBase::getPlotStyle() and JKQtPlotterBase::getNextStyle() ) */
int parentPlotStyle ;
/** \brief color of the graph */
QColor color ;
/** \brief color of the graph fill */
QColor fillColor ;
/** \brief linestyle of the graph lines */
Qt : : PenStyle style ;
/** \brief width (pixels) of the graph */
double lineWidth ;
/** \brief which symbol to use for the datapoints */
JKQTPgraphSymbols symbol ;
/** \brief size (diameter in pixels) of the symbol for the data points */
double symbolSize ;
/** \brief width (in pixels) of the lines used to plot the symbol for the data points */
double symbolWidth ;
/** \brief indicates whether to draw a line or not */
bool drawLine ;
QPen getLinePen ( JKQTPEnhancedPainter & painter ) const ;
QPen getSymbolPen ( JKQTPEnhancedPainter & painter ) const ;
QBrush getBrush ( JKQTPEnhancedPainter & painter ) const ;
} ;
/*! \brief This implements xy scatter plots (like JKQTPxyLineGraph), but the color and size of the symbols may be taken from a column.
\ ingroup jkqtplotter_plots
set the properties sizeColumn and / or colorColumn to change the size and / or color of the symbols according to the values in the column .
*/
class LIB_EXPORT JKQTPxyParametrizedScatterGraph : public JKQTPxyLineGraph , public JKQTPColorPaletteTools {
Q_OBJECT
public :
/** \brief class constructor */
2018-11-18 18:59:30 +08:00
JKQTPxyParametrizedScatterGraph ( JKQtBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2015-08-04 01:04:19 +08:00
JKQTPxyParametrizedScatterGraph ( JKQtPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
virtual void draw ( JKQTPEnhancedPainter & painter ) ;
2018-12-16 21:59:39 +08:00
/** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) ;
2015-07-11 18:56:02 +08:00
/** \brief returns the color to be used for the key label */
virtual QColor getKeyLabelColor ( ) ;
JKQTPGET_SET_MACRO ( int , sizeColumn )
2018-11-25 21:53:26 +08:00
JKQTPSET_CAST_MACRO ( size_t , int , sizeColumn )
2015-07-11 18:56:02 +08:00
JKQTPGET_SET_MACRO ( int , colorColumn )
2018-11-25 21:53:26 +08:00
JKQTPSET_CAST_MACRO ( size_t , int , colorColumn )
2015-07-11 18:56:02 +08:00
JKQTPGET_SET_MACRO ( int , symbolColumn )
2018-11-25 21:53:26 +08:00
JKQTPSET_CAST_MACRO ( size_t , int , symbolColumn )
2018-12-16 21:59:39 +08:00
JKQTPGET_SET_MACRO ( int , linewidthColumn )
JKQTPSET_CAST_MACRO ( size_t , int , linewidthColumn )
2015-07-11 18:56:02 +08:00
JKQTPGET_SET_MACRO ( bool , colorColumnContainsRGB )
2015-08-02 19:36:54 +08:00
JKQTPGET_SET_MACRO ( bool , gridModeForSymbolSize )
JKQTPGET_SET_MACRO ( double , gridDeltaX )
JKQTPGET_SET_MACRO ( double , gridDeltaY )
JKQTPGET_SET_MACRO ( double , gridSymbolFractionSize )
2015-07-11 18:56:02 +08:00
virtual void setParent ( JKQtBasePlotter * parent ) ;
/*! \brief if the graph plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
\ note If you want to draw outside , then you ' ll also have to implement drawOutside ( )
*/
virtual void getOutsideSize ( JKQTPEnhancedPainter & painter , int & leftSpace , int & rightSpace , int & topSpace , int & bottomSpace ) ;
/*! \brief plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
\ note If you want to draw outside , then you ' ll also have to implement getOutsideSize ( ) , so enough space is reserved
The four value supplied tell the method where to draw ( inside one of the rectangles ) .
*/
virtual void drawOutside ( JKQTPEnhancedPainter & painter , QRect leftSpace , QRect rightSpace , QRect topSpace , QRect bottomSpace ) ;
/** \brief determine min/max data value of the image */
virtual void cbGetDataMinMax ( double & imin , double & imax ) ;
/** \copydoc JKQTPgraph::usesColumn() */
virtual bool usesColumn ( int c ) ;
virtual double getInternalDataMin ( ) const ;
virtual double getInternalDataMax ( ) const ;
protected :
/** \brief this column contains the symbol size in pt */
int sizeColumn ;
/** \brief this column contains the symbol color */
int colorColumn ;
/** \brief this column contains the symbol type */
int symbolColumn ;
2018-12-16 21:59:39 +08:00
/** \brief this column contains the line width */
int linewidthColumn ;
2015-07-11 18:56:02 +08:00
2018-12-25 04:39:37 +08:00
/** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
2015-07-11 18:56:02 +08:00
bool gridModeForSymbolSize ;
2018-12-25 04:39:37 +08:00
/** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
2015-07-11 18:56:02 +08:00
double gridDeltaX ;
2018-12-25 04:39:37 +08:00
/** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
2015-07-11 18:56:02 +08:00
double gridDeltaY ;
2018-12-25 04:39:37 +08:00
/** \brief if the gridModeForSymbolSize mode is actiavted (true), the plot assumes that the scatter symbols are ordered in a grid. It the uses the given griDeltaX and gridDeltaY to calculate the symbol size, so they fill the available space to a fraction gridSymbolFractionSize. */
2015-07-11 18:56:02 +08:00
double gridSymbolFractionSize ;
/** \brief if this is true, the value in the colorColumn is converted to an integer, representing a color in ARGB format (as in QRgb) */
bool colorColumnContainsRGB ;
2018-12-16 21:59:39 +08:00
double getLocalLineWidth ( int i ) ;
2015-07-11 18:56:02 +08:00
double getLocalSymbolSize ( int i ) ;
QColor getLocalColor ( int i ) ;
JKQTPgraphSymbols getLocalSymbolType ( int i ) ;
/** \brief internally used to store the range of the color column */
double intColMin ;
/** \brief internally used to store the range of the color column */
double intColMax ;
} ;
/*! \brief This implements xy line plots with x and y error indicators.
\ ingroup jkqtplotter_plots
\ image html plot_errorbarlineplots . png
\ image html plot_errorlinelineplots . png
\ image html plot_errorpolygonlineplots . png
*/
class LIB_EXPORT JKQTPxyLineErrorGraph : public JKQTPxyLineGraph , public JKQTPxyGraphErrors {
Q_OBJECT
public :
/** \brief class constructor */
2018-11-18 18:59:30 +08:00
inline JKQTPxyLineErrorGraph ( JKQtBasePlotter * parent = nullptr ) :
2015-07-11 18:56:02 +08:00
JKQTPxyLineGraph ( parent ) , JKQTPxyGraphErrors ( )
2015-08-02 20:10:55 +08:00
{ setErrorColorFromGraphColor ( color ) ; }
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2015-08-04 00:45:40 +08:00
inline JKQTPxyLineErrorGraph ( JKQtPlotter * parent ) :
2015-08-02 19:36:54 +08:00
JKQTPxyLineGraph ( parent ) , JKQTPxyGraphErrors ( )
2015-08-02 20:10:55 +08:00
{ setErrorColorFromGraphColor ( color ) ; }
2015-07-11 18:56:02 +08:00
/** \brief get the maximum and minimum x-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) ;
/** \brief get the maximum and minimum y-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) ;
/** \copydoc JKQTPgraph::usesColumn() */
virtual bool usesColumn ( int c ) ;
protected :
/** \brief this function is used to plot error inidcators before plotting the graphs. */
2018-11-25 21:53:26 +08:00
virtual void drawErrorsBefore ( JKQTPEnhancedPainter & painter ) ;
2015-07-11 18:56:02 +08:00
} ;
/*! \brief This implements xy scatter plots (like JKQTPxyLineGraph), but the color and size of the symbols may be taken from a column. with errorbars
\ ingroup jkqtplotter_plots
set the properties sizeColumn and / or colorColumn to change the size and / or color of the symbols according to the values in the column .
*/
class LIB_EXPORT JKQTPxyParametrizedErrorScatterGraph : public JKQTPxyParametrizedScatterGraph , public JKQTPxyGraphErrors {
Q_OBJECT
public :
2018-11-18 18:59:30 +08:00
inline JKQTPxyParametrizedErrorScatterGraph ( JKQtBasePlotter * parent = nullptr ) :
2015-08-02 19:36:54 +08:00
JKQTPxyParametrizedScatterGraph ( parent ) , JKQTPxyGraphErrors ( )
2015-08-02 20:10:55 +08:00
{ setErrorColorFromGraphColor ( color ) ; }
2015-08-04 01:04:19 +08:00
inline JKQTPxyParametrizedErrorScatterGraph ( JKQtPlotter * parent ) :
2015-07-11 18:56:02 +08:00
JKQTPxyParametrizedScatterGraph ( parent ) , JKQTPxyGraphErrors ( )
2015-08-02 20:10:55 +08:00
{ setErrorColorFromGraphColor ( color ) ; }
2015-07-11 18:56:02 +08:00
/** \brief get the maximum and minimum x-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) ;
/** \brief get the maximum and minimum y-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) ;
/** \copydoc JKQTPgraph::usesColumn() */
virtual bool usesColumn ( int c ) ;
protected :
/** \brief this function is used to plot error inidcators before plotting the graphs. */
2018-11-25 21:53:26 +08:00
virtual void drawErrorsBefore ( JKQTPEnhancedPainter & painter ) ;
2015-07-11 18:56:02 +08:00
/** \brief this function can be used to set the color of the error indicators automatically
*
* return \ c true and the colors to use , if applicable , the default implementation returns false */
2018-12-16 21:59:39 +08:00
virtual bool intPlotXYErrorIndicatorsGetColor ( JKQTPEnhancedPainter & painter , JKQtBasePlotter * parent , JKQTPcoordinateAxis * xAxis , JKQTPcoordinateAxis * yAxis , int xColumn , int yColumn , int xErrorColumn , int yErrorColumn , JKQTPerrorPlotstyle xErrorStyle , JKQTPerrorPlotstyle yErrorStyle , int index , QColor & errorColor , QColor & errorFillColor ) ;
2015-07-11 18:56:02 +08:00
} ;
2018-12-01 23:02:04 +08:00
2018-11-25 21:53:26 +08:00
/*! \brief This implements a step plot with values \f$ \left(x, f(x) \right) \f$
\ ingroup jkqtplotter_plots
2015-07-11 18:56:02 +08:00
2018-11-25 21:53:26 +08:00
A step plot starts at \ f $ \ left ( x_ { i - 1 } , f ( x_ { i - 1 } ) \ right ) \ f $ and then goes on to
\ f $ \ left ( x_ { i } , f ( x_ { i - 1 } ) \ right ) \ f $ . There it raises immediately to
\ f $ \ left ( x_i , f ( x_i ) \ right ) \ f $ .
2015-07-11 18:56:02 +08:00
2018-11-25 21:53:26 +08:00
If you want the \ f $ x_i \ f $ values in the center of the steps , use
\ code JKQTPstepHorizontalGraph : : set_xCentered ( true ) \ endcode . In that case the steps
go from \ f $ \ left ( x_ { i - 1 } , f ( x_ { i - 1 } ) \ right ) \ f $ to \ f $ \ left ( x_ { i } - \ delta / 2 , f ( x_ { i - 1 } ) \ right ) \ f $ ,
then to \ f $ \ left ( x_ { i } - \ delta / 2 , f ( x_ { i } ) \ right ) \ f $ and finally
to \ f $ \ left ( x_ { i } , f ( x_ { i } ) \ right ) \ f $ where \ f $ \ delta = ( x_ { i } - x_ { i - 1 } ) \ f $ .
2015-07-11 18:56:02 +08:00
2018-11-25 21:53:26 +08:00
This diagram shows a plot with \ code JKQTPstepHorizontalGraph : : set_valuesCentered ( false ) \ endcode :
\ image html plot_stephorplot1 . png
2015-07-11 18:56:02 +08:00
2018-11-25 21:53:26 +08:00
This diagram shows a plot with \ code JKQTPstepHorizontalGraph : : set_valuesCentered ( true ) \ endcode :
\ image html plot_stephorplot2 . png
*/
class LIB_EXPORT JKQTPstepHorizontalGraph : public JKQTPxyGraph {
Q_OBJECT
public :
2015-07-11 18:56:02 +08:00
/** \brief class constructor */
2018-11-25 21:53:26 +08:00
JKQTPstepHorizontalGraph ( JKQtBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2018-11-25 21:53:26 +08:00
JKQTPstepHorizontalGraph ( JKQtPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
virtual void draw ( JKQTPEnhancedPainter & painter ) ;
/** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) ;
/** \brief returns the color to be used for the key label */
virtual QColor getKeyLabelColor ( ) ;
JKQTPGET_SET_MACRO ( QColor , color )
JKQTPGET_SET_MACRO ( QColor , fillColor )
JKQTPGET_SET_MACRO ( Qt : : BrushStyle , fillStyle )
JKQTPGET_SET_MACRO ( Qt : : PenStyle , style )
JKQTPGET_SET_MACRO ( double , lineWidth )
JKQTPGET_SET_MACRO ( bool , drawLine )
JKQTPGET_SET_MACRO ( bool , fillCurve )
2018-12-07 04:41:35 +08:00
JKQTPGET_SET_MACRO ( JKQTPstepType , stepType )
2015-07-11 18:56:02 +08:00
protected :
/** \brief color of the graph */
QColor color ;
/** \brief color of the graph fill */
QColor fillColor ;
/** \brief linestyle of the graph lines */
Qt : : PenStyle style ;
/** \brief width (pixels) of the graph */
double lineWidth ;
/** \brief fill style, if the curve should be filled */
Qt : : BrushStyle fillStyle ;
/** \brief indicates whether to draw a line or not */
bool drawLine ;
/** \brief indicates whether to fill the space between the curve and the x-axis */
bool fillCurve ;
2018-12-07 04:41:35 +08:00
/** \brief specifies whether the steps elongate to the left, the right, or are centered around the \f$ x_i \f$ values. */
JKQTPstepType stepType ;
2015-07-11 18:56:02 +08:00
/** \brief which plot style to use from the parent plotter (via JKQtPlotterBase::getPlotStyle() and JKQtPlotterBase::getNextStyle() ) */
int parentPlotStyle ;
QBrush getBrush ( JKQTPEnhancedPainter & painter ) const ;
QPen getLinePen ( JKQTPEnhancedPainter & painter ) const ;
} ;
/*! \brief This implements a step plot with values \f$ \left(f(y), y \right) \f$
\ ingroup jkqtplotter_plots
A step plot starts at \ f $ \ left ( f ( y_ { i - 1 } ) , x_ { i - 1 } \ right ) \ f $ and then goes on to
\ f $ \ left ( f ( y_ { i - 1 } ) , y_ { i } \ right ) \ f $ . There it raises immediately to
\ f $ \ left ( f ( y_i ) , y_i \ right ) \ f $ .
If you want the \ f $ y_i \ f $ values in the center of the steps , use
\ code JKQTPstepHorizontalGraph : : set_valuesCentered ( true ) \ endcode . In that case the steps
go from \ f $ \ left ( f ( y_ { i - 1 } ) , y_ { i - 1 } ) \ right ) \ f $ to \ f $ \ left ( f ( y_ { i - 1 } ) , y_ { i } - \ delta / 2 \ right ) \ f $ ,
then to \ f $ \ left ( f ( y_ { i } , y_ { i } - \ delta / 2 \ right ) \ f $ and finally
to \ f $ \ left ( f ( y_ { i } ) , y_ { i } \ right ) \ f $ where \ f $ \ delta = ( y_ { i } - y_ { i - 1 } ) \ f $ .
This diagram shows a plot with \ code JKQTPstepHorizontalGraph : : set_xCentered ( false ) \ endcode :
\ image html plot_stepverplot1 . png
This diagram shows a plot with \ code JKQTPstepHorizontalGraph : : set_xCentered ( true ) \ endcode :
\ image html plot_stepverplot2 . png
*/
class LIB_EXPORT JKQTPstepVerticalGraph : public JKQTPstepHorizontalGraph {
Q_OBJECT
public :
/** \brief class constructor */
2018-11-25 21:53:26 +08:00
JKQTPstepVerticalGraph ( JKQtBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2018-11-25 21:53:26 +08:00
JKQTPstepVerticalGraph ( JKQtPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
virtual void draw ( JKQTPEnhancedPainter & painter ) ;
} ;
/*! \brief simply marks a range (and possibly a centerline) in a plot. This may be used to display e.g. mean +/- stddev
or a range of interest , or the range of good values , . . .
\ ingroup jkqtplotter_plots
*/
class LIB_EXPORT JKQTPhorizontalRange : public JKQTPgraph {
Q_OBJECT
public :
/** \brief class constructor */
2018-11-18 18:59:30 +08:00
JKQTPhorizontalRange ( JKQtBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2015-08-04 01:04:19 +08:00
JKQTPhorizontalRange ( JKQtPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
virtual void draw ( JKQTPEnhancedPainter & painter ) ;
/** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) ;
/** \brief get the maximum and minimum x-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
2018-11-25 21:53:26 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) ;
2015-07-11 18:56:02 +08:00
/** \brief get the maximum and minimum y-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
2018-11-25 21:53:26 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) ;
2015-07-11 18:56:02 +08:00
/** \brief returns the color to be used for the key label */
2018-11-25 21:53:26 +08:00
virtual QColor getKeyLabelColor ( ) ;
2015-07-11 18:56:02 +08:00
void setDrawCenterLineOnly ( ) ;
JKQTPGET_SET_MACRO ( QColor , color )
JKQTPGET_SET_MACRO ( QColor , fillColor )
JKQTPGET_SET_MACRO ( Qt : : BrushStyle , fillStyle )
JKQTPGET_SET_MACRO ( Qt : : PenStyle , style )
JKQTPGET_SET_MACRO ( double , lineWidth )
JKQTPGET_SET_MACRO ( QColor , centerColor )
JKQTPGET_SET_MACRO ( Qt : : PenStyle , centerStyle )
JKQTPGET_SET_MACRO ( double , centerLineWidth )
JKQTPGET_SET_MACRO ( double , rangeMin )
JKQTPGET_SET_MACRO ( double , rangeMax )
JKQTPGET_SET_MACRO ( double , sizeMin )
JKQTPGET_SET_MACRO ( double , sizeMax )
JKQTPGET_SET_MACRO ( bool , unlimitedSizeMin )
JKQTPGET_SET_MACRO ( bool , unlimitedSizeMax )
JKQTPGET_SET_MACRO ( double , rangeCenter )
JKQTPGET_SET_MACRO ( bool , plotCenterLine )
JKQTPGET_SET_MACRO ( bool , invertedRange )
JKQTPGET_SET_MACRO ( bool , plotRange )
JKQTPGET_SET_MACRO ( bool , fillRange )
JKQTPGET_SET_MACRO ( bool , plotRangeLines )
protected :
/** \brief min-value of range */
double rangeMin ;
/** \brief max-value of range */
double rangeMax ;
/** \brief where to plot the center line */
double rangeCenter ;
double sizeMin ;
double sizeMax ;
bool unlimitedSizeMin ;
bool unlimitedSizeMax ;
/** \brief indicates whether to plot a center line */
bool plotCenterLine ;
/** \brief if \c true, fills the parts outside the given range */
bool invertedRange ;
/** \brief if \c true, the range is plotted, if \c false, only the center line is plotted (if \a plotCenterLine is \c true ) */
bool plotRange ;
/** \brief if \c true, draws lines at the range borders \a color */
bool plotRangeLines ;
/** \brief if \c true, this fills the range with \a fillCOlor */
bool fillRange ;
/** \brief color of the graph */
QColor color ;
/** \brief color of the center line graph */
QColor centerColor ;
/** \brief color of the graph fill */
QColor fillColor ;
/** \brief linestyle of the graph lines */
Qt : : PenStyle style ;
/** \brief linestyle of the center line graph lines */
Qt : : PenStyle centerStyle ;
/** \brief width (pixels) of the graph */
double lineWidth ;
/** \brief width (pixels) of the center line graph */
double centerLineWidth ;
/** \brief fill style, if the curve should be filled */
Qt : : BrushStyle fillStyle ;
/** \brief which plot style to use from the parent plotter (via JKQtPlotterBase::getPlotStyle() and JKQtPlotterBase::getNextStyle() ) */
int parentPlotStyle ;
QBrush getBrush ( JKQTPEnhancedPainter & painter ) const ;
QPen getLinePen ( JKQTPEnhancedPainter & painter ) const ;
} ;
/*! \brief simply marks a range (and possibly a centerline) in a plot. This may be used to display e.g. mean +/- stddev
or a range of interest , or the range of good values , . . .
\ ingroup jkqtplotter_plots
*/
class LIB_EXPORT JKQTPverticalRange : public JKQTPhorizontalRange {
Q_OBJECT
public :
/** \brief class constructor */
2018-11-18 18:59:30 +08:00
JKQTPverticalRange ( JKQtBasePlotter * parent = nullptr ) ;
2015-08-02 19:36:54 +08:00
/** \brief class constructor */
2015-08-04 01:04:19 +08:00
JKQTPverticalRange ( JKQtPlotter * parent ) ;
2015-07-11 18:56:02 +08:00
/** \brief plots the graph to the plotter object specified as parent */
virtual void draw ( JKQTPEnhancedPainter & painter ) ;
/** \brief plots a key marker inside the specified rectangle \a rect */
virtual void drawKeyMarker ( JKQTPEnhancedPainter & painter , QRectF & rect ) ;
/** \brief get the maximum and minimum x-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
2018-11-25 21:53:26 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) ;
2015-07-11 18:56:02 +08:00
/** \brief get the maximum and minimum y-value of the graph
*
* The result is given in the two parameters which are call - by - reference parameters !
*/
2018-11-25 21:53:26 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) ;
2015-07-11 18:56:02 +08:00
} ;
2018-12-19 00:13:18 +08:00
# endif // jkqtpgraphs_H