2018-11-25 21:53:26 +08:00
/*
2022-07-19 19:40:43 +08:00
Copyright ( c ) 2008 - 2022 Jan W . Krieger ( < jan @ jkrieger . de > )
2018-11-25 21:53:26 +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
2019-02-08 00:24:46 +08:00
the Free Software Foundation , either version 2.1 of the License , or
2018-11-25 21:53:26 +08:00
( 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/>.
*/
2022-04-25 04:07:39 +08:00
# ifndef jkqtpgraphsbarchart_H
# define jkqtpgraphsbarchart_H
2018-11-25 21:53:26 +08:00
# include <QString>
# include <QPainter>
# include <QPair>
2019-05-30 04:40:02 +08:00
# include "jkqtplotter/jkqtptools.h"
2019-06-22 20:21:32 +08:00
# include "jkqtplotter/jkqtplotter_imexport.h"
2018-12-19 00:13:18 +08:00
# include "jkqtplotter/jkqtpgraphsbase.h"
2019-02-08 00:24:46 +08:00
# include "jkqtplotter/jkqtpgraphsbaseerrors.h"
2019-04-22 19:27:50 +08:00
# include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
2020-09-17 22:59:57 +08:00
# include "jkqtplotter/graphs/jkqtpbarchartbase.h"
2018-11-25 21:53:26 +08:00
2022-10-31 05:01:06 +08:00
/*! \brief This implements a vertical bar graph with bars between \f$ y=\mbox{baseline} \f$ and \f$ y=f(x) \f$
2022-10-23 03:07:14 +08:00
\ ingroup jkqtplotter_barcharts
2018-11-25 21:53:26 +08:00
This class plots a bargraph . This image explains the parameters :
\ image html bargraph_basics . png
2022-08-29 04:48:14 +08:00
By default the shift parameter is , so the bar is centered at the x - value . The width is 0.9 ,
2018-11-25 21:53:26 +08:00
so adjacent bars are plotted with a small distance between them . It is possible to use these two parameters
2019-04-22 19:27:50 +08:00
to plot multiple bars for every x - value , by having on JKQTPSpecialLineHorizontalGraph object per
2018-11-25 21:53:26 +08:00
set of bars that belong together . For example for three bars per x - value one would set :
\ verbatim
2022-08-29 04:48:14 +08:00
width = 0.3
2018-11-25 21:53:26 +08:00
shift = - 0.3 / 0 / + 0.3
\ endverbatim
This results in a bargraph , as shown here :
2022-08-29 04:48:14 +08:00
\ image html JKQTPBarVerticalGraph . png
2018-11-25 21:53:26 +08:00
2022-09-10 20:35:16 +08:00
You can also set JKQTPBarGraphBase : : FillMode : : TwoColorFilling , which uses different fill styles for bars above and below
the baseline of the graph :
\ image html JKQTPBarVerticalGraphTwoColorFilling . png
2022-10-23 03:07:14 +08:00
If you use JKQTPBarGraphBase : : FillMode : : FunctorFilling you can specify the fill style by a functor , e . g .
\ code
graph - > setFillMode ( JKQTPBarGraphBase : : FillMode : : FunctorFilling ) ;
graph - > setFillBrushFunctor (
[ ] ( double key , double value ) {
return QBrush ( QColor : : fromHsvF ( key / 12.0 , 1.0 , 1.0 ) ) ;
}
) ;
\ endcode
2018-11-25 21:53:26 +08:00
2022-10-23 03:07:14 +08:00
The result may look like this :
\ image html JKQTPBarVerticalGraphFunctorFilling . png
2022-10-29 03:48:42 +08:00
You can also completely customize the drawing by defining a custom draw functor :
\ code
graph - > setCustomDrawingFunctor (
[ ] ( JKQTPEnhancedPainter & painter , const QRectF & bar_px , const QPointF & datapoint , Qt : : Orientation orientation , JKQTPBarGraphBase * graph ) {
// draw the bar (if required), pen and brush are already set properly
painter . drawRect ( bar_px ) ;
// now we can add some decoration or replace the instruction above:
// ........
}
) ;
// enable usage of cutom draw functor
graph - > setUseCustomDrawFunctor ( true ) ;
\ endcode
See \ ref JKQTPlotterBarchartsCustomDrawFunctor for a detailed example .
The result may look like this :
\ image html JKQTPBarVerticalGraphCustomDrawFunctor . png
2022-10-23 03:07:14 +08:00
\ see JKQTPBarHorizontalGraph , \ ref JKQTPlotterBarcharts , jkqtpstatAddHHistogram1D ( ) , jkqtpstatAddHHistogram1DAutoranged ( )
2018-11-25 21:53:26 +08:00
*/
2020-09-17 22:59:57 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPBarVerticalGraph : public JKQTPBarGraphBase {
2018-11-25 21:53:26 +08:00
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPBarVerticalGraph ( JKQTBasePlotter * parent = nullptr ) ;
2018-11-25 21:53:26 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPBarVerticalGraph ( JKQTPlotter * parent ) ;
2018-11-25 21:53:26 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2018-11-25 21:53:26 +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 !
*/
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2018-11-25 21:53:26 +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-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2020-09-17 22:59:57 +08:00
public slots :
2018-11-25 21:53:26 +08:00
protected :
2020-09-17 22:59:57 +08:00
/** \brief this function is used by autoscaleBarWidthAndShift() to determine whether a given graph shall be taken into account when autoscaling.
* Typically this returns \ c true for all JKQTPBarGraphBase - derved objects with the same orientation ( horizontal or vertical ) */
virtual bool considerForAutoscaling ( JKQTPBarGraphBase * other ) const override ;
2018-11-25 21:53:26 +08:00
} ;
2022-10-31 05:01:06 +08:00
/*! \brief This implements a vertical bar graph with bars between \f$ y=\mbox{baseline} \f$ and \f$ y=f(x) \f$
2018-11-25 21:53:26 +08:00
* and error indicator
2022-10-23 03:07:14 +08:00
* \ ingroup jkqtplotter_barcharts
2018-11-25 21:53:26 +08:00
*
2019-01-20 17:49:29 +08:00
* This works much the same as JKQTPBarHorizontalGraph . Here is an example output :
2022-09-11 04:35:30 +08:00
* \ image html JKQTPBarVerticalErrorGraph . png
2018-11-25 21:53:26 +08:00
*
2019-06-13 16:27:06 +08:00
* \ see jkqtpstatAddYErrorBarGraph ( ) , JKQTPBarVerticalGraph , \ ref JKQTPlotterBarcharts
2018-11-25 21:53:26 +08:00
*/
2019-06-22 20:21:32 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPBarVerticalErrorGraph : public JKQTPBarVerticalGraph , public JKQTPYGraphErrors {
2018-11-25 21:53:26 +08:00
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPBarVerticalErrorGraph ( JKQTBasePlotter * parent = nullptr ) ;
2018-11-25 21:53:26 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPBarVerticalErrorGraph ( JKQTPlotter * parent ) ;
2018-11-25 21:53:26 +08:00
2019-01-20 17:49:29 +08:00
/** \copydoc JKQTPGraph::usesColumn() */
2018-12-28 05:52:00 +08:00
virtual bool usesColumn ( int c ) const override ;
2018-11-25 21:53:26 +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-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2018-11-25 21:53:26 +08:00
2020-09-17 22:59:57 +08:00
/** \brief returns the column that contains the bar height errors */
int getBarErrorColumn ( ) const ;
/** \brief returns the column that contains the lower bar height errors */
int getBarLowerErrorColumn ( ) const ;
2022-09-11 04:35:30 +08:00
/** \brief returns the error style of the bar */
JKQTPErrorPlotstyle getBarErrorStyle ( ) const ;
/** \brief returns whether the errors of the bars are symmetric */
bool getBarErrorSymmetric ( ) const ;
2020-09-17 22:59:57 +08:00
public slots :
2022-09-11 04:35:30 +08:00
/** \brief sets whether the errors of the bars are symmetric */
void setBarErrorSymmetric ( bool __value ) ;
/** \brief sets the error style of the bar */
void setBarErrorStyle ( JKQTPErrorPlotstyle __value ) ;
2020-09-17 22:59:57 +08:00
/** \brief sets the column that contains the bar height errors */
void setBarErrorColumn ( int column ) ;
/** \brief sets the column that contains the bar height errors */
void setBarErrorColumn ( size_t column ) ;
/** \brief sets the column that contains the bar height errors */
void setBarLowerErrorColumn ( int column ) ;
/** \brief sets the column that contains the bar height errors */
void setBarLowerErrorColumn ( size_t column ) ;
2018-11-25 21:53:26 +08:00
protected :
/** \brief this function is used to plot error inidcators before plotting the graphs. */
2018-12-28 05:52:00 +08:00
virtual void drawErrorsAfter ( JKQTPEnhancedPainter & painter ) override ;
2018-11-25 21:53:26 +08:00
} ;
2020-09-17 22:59:57 +08:00
2022-10-31 05:01:06 +08:00
/*! \brief This implements a horizontal bar graph with bars between \f$ x=\mbox{baseline} \f$ and \f$ x=f(y) \f$
2022-10-23 03:07:14 +08:00
\ ingroup jkqtplotter_barcharts
2018-11-25 21:53:26 +08:00
2019-01-20 17:49:29 +08:00
This works much the same as JKQTPBarHorizontalGraph . Here is an example output :
2019-06-13 16:27:06 +08:00
2022-08-29 04:48:14 +08:00
\ image html JKQTPBarHorizontalGraph . png
2018-11-25 21:53:26 +08:00
2022-09-10 20:35:16 +08:00
You can also set JKQTPBarGraphBase : : FillMode : : TwoColorFilling , which uses different fill styles for bars above and below
the baseline of the graph :
\ image html JKQTPBarHorizontalGraphTwoColorFilling . png
2019-06-13 16:27:06 +08:00
2022-10-23 03:07:14 +08:00
If you use JKQTPBarGraphBase : : FillMode : : FunctorFilling you can specify the fill style by a functor , e . g .
\ code
graph - > setFillMode ( JKQTPBarGraphBase : : FillMode : : FunctorFilling ) ;
graph - > setFillBrushFunctor (
[ ] ( double key , double value ) {
return QBrush ( QColor : : fromHsvF ( key / 12.0 , 1.0 , 1.0 ) ) ;
}
) ;
\ endcode
The result may look like this :
\ image html JKQTPBarHorizontalGraphFunctorFilling . png
2022-10-29 03:48:42 +08:00
You can also completely customize the drawing by defining a custom draw functor :
\ code
graph - > setCustomDrawingFunctor (
[ ] ( JKQTPEnhancedPainter & painter , const QRectF & bar_px , const QPointF & datapoint , Qt : : Orientation orientation , JKQTPBarGraphBase * graph ) {
// draw the bar (if required), pen and brush are already set properly
painter . drawRect ( bar_px ) ;
// now we can add some decoration or replace the instruction above:
// ........
}
) ;
// enable usage of cutom draw functor
graph - > setUseCustomDrawFunctor ( true ) ;
\ endcode
See \ ref JKQTPlotterBarchartsCustomDrawFunctor for a detailed example .
The result may look like this :
\ image html JKQTPBarHorizontalGraphCustomDrawFunctor . png
2022-10-23 03:07:14 +08:00
2019-06-13 16:27:06 +08:00
\ see \ ref JKQTPlotterBarcharts , jkqtpstatAddVHistogram1D ( ) , jkqtpstatAddVHistogram1DAutoranged ( )
2018-11-25 21:53:26 +08:00
*/
2020-09-17 22:59:57 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPBarHorizontalGraph : public JKQTPBarGraphBase {
2018-11-25 21:53:26 +08:00
Q_OBJECT
public :
/** \brief class constructor */
2019-01-20 17:49:29 +08:00
JKQTPBarHorizontalGraph ( JKQTBasePlotter * parent = nullptr ) ;
2018-11-25 21:53:26 +08:00
/** \brief class constructor */
2019-01-20 23:15:10 +08:00
JKQTPBarHorizontalGraph ( JKQTPlotter * parent ) ;
2018-11-25 21:53:26 +08:00
/** \brief plots the graph to the plotter object specified as parent */
2018-12-28 05:52:00 +08:00
virtual void draw ( JKQTPEnhancedPainter & painter ) override ;
2018-11-25 21:53:26 +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 !
*/
2018-12-28 05:52:00 +08:00
virtual bool getXMinMax ( double & minx , double & maxx , double & smallestGreaterZero ) override ;
2018-11-25 21:53:26 +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-12-28 05:52:00 +08:00
virtual bool getYMinMax ( double & miny , double & maxy , double & smallestGreaterZero ) override ;
2022-09-10 19:38:29 +08:00
/** \brief returns the column used as "key" for the current graph (typically this call getXColumn(), but for horizontal graphs like filled curves or barcharts it may call getYColumn() ) */
virtual int getKeyColumn ( ) const override ;
/** \brief returns the column used as "value" for the current graph (typically this call getXColumn(), but for horizontal graphs like filled curves or barcharts it may call getYColumn() ) */
virtual int getValueColumn ( ) const override ;
2020-09-17 22:59:57 +08:00
public slots :
2022-09-10 19:38:29 +08:00
/** \brief sets the column used as "key" for the current graph (typically this call setXColumn(), but for horizontal graphs like filled curves or barcharts it may call setYColumn() ) */
virtual void setKeyColumn ( int __value ) override ;
/** \brief sets the column used as "value" for the current graph (typically this call setXColumn(), but for horizontal graphs like filled curves or barcharts it may call setYColumn() ) */
virtual void setValueColumn ( int __value ) override ;
2020-09-17 22:59:57 +08:00
protected :
/** \brief this function is used by autoscaleBarWidthAndShift() to determine whether a given graph shall be taken into account when autoscaling.
* Typically this returns \ c true for all JKQTPBarGraphBase - derved objects with the same orientation ( horizontal or vertical ) */
virtual bool considerForAutoscaling ( JKQTPBarGraphBase * other ) const override ;
2018-11-25 21:53:26 +08:00
} ;
2022-10-31 05:01:06 +08:00
/*! \brief This implements a horizontal bar graph with bars between \f$ x=\mbox{baseline} \f$ and \f$ x=f(y) \f$
2020-09-17 22:59:57 +08:00
* and error indicator
2022-10-23 03:07:14 +08:00
* \ ingroup jkqtplotter_barcharts
2020-09-17 22:59:57 +08:00
*
* This works much the same as JKQTPBarHorizontalGraph . Here is an example output :
2022-09-11 04:35:30 +08:00
* \ image html JKQTPBarHorizontalErrorGraph . png
2020-09-17 22:59:57 +08:00
*
* \ see jkqtpstatAddXErrorBarGraph ( ) , JKQTPBarHorizontalGraph , \ ref JKQTPlotterBarcharts
*
*/
class JKQTPLOTTER_LIB_EXPORT JKQTPBarHorizontalErrorGraph : public JKQTPBarHorizontalGraph , public JKQTPXGraphErrors {
Q_OBJECT
public :
/** \brief class constructor */
JKQTPBarHorizontalErrorGraph ( JKQTBasePlotter * parent = nullptr ) ;
/** \brief class constructor */
JKQTPBarHorizontalErrorGraph ( JKQTPlotter * parent ) ;
/** \copydoc JKQTPGraph::usesColumn() */
virtual bool usesColumn ( int c ) const override ;
/** \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 ) override ;
/** \brief returns the column that contains the bar height errors */
int getBarErrorColumn ( ) const ;
/** \brief returns the column that contains the lower bar height errors */
int getBarLowerErrorColumn ( ) const ;
2022-09-11 04:35:30 +08:00
/** \brief returns the error style of the bar */
JKQTPErrorPlotstyle getBarErrorStyle ( ) const ;
/** \brief returns whether the errors of the bars are symmetric */
bool getBarErrorSymmetric ( ) const ;
2020-09-17 22:59:57 +08:00
public slots :
2022-09-11 04:35:30 +08:00
/** \brief sets whether the errors of the bars are symmetric */
void setBarErrorSymmetric ( bool __value ) ;
/** \brief sets the error style of the bar */
void setBarErrorStyle ( JKQTPErrorPlotstyle __value ) ;
2020-09-17 22:59:57 +08:00
/** \brief sets the column that contains the bar height errors */
void setBarErrorColumn ( int column ) ;
/** \brief sets the column that contains the bar height errors */
void setBarErrorColumn ( size_t column ) ;
/** \brief sets the column that contains the bar height errors */
void setBarLowerErrorColumn ( int column ) ;
/** \brief sets the column that contains the bar height errors */
void setBarLowerErrorColumn ( size_t column ) ;
protected :
/** \brief this function is used to plot error inidcators before plotting the graphs. */
virtual void drawErrorsAfter ( JKQTPEnhancedPainter & painter ) override ;
} ;
2022-10-31 05:01:06 +08:00
/*! \brief This implements a vertical bar graph with bars between \f$ y=\mbox{baseline} \f$ and \f$ y=f(x) \f$
2018-11-25 21:53:26 +08:00
* Optionally several graphs of this type may be stacked on top of each other
2022-10-23 03:07:14 +08:00
* \ ingroup jkqtplotter_barcharts
2018-11-25 21:53:26 +08:00
*
2019-01-26 20:00:40 +08:00
* Draw stacked barcharts by connecting several plots by calling \ c setStackedParent ( belowPlot ) for each plot
2022-10-23 03:07:14 +08:00
*
2020-09-17 22:59:57 +08:00
* \ image html JKQTPBarVerticalGraphStacked . png
2019-06-13 16:27:06 +08:00
*
2020-09-17 22:59:57 +08:00
* \ see JKQTPBarVerticalGraph , \ ref JKQTPlotterStackedBarChart
2018-11-25 21:53:26 +08:00
*/
2020-09-17 22:59:57 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPBarVerticalStackableGraph : public JKQTPBarVerticalGraph {
2018-11-25 21:53:26 +08:00
Q_OBJECT
public :
/** \brief class constructor */
2020-09-17 22:59:57 +08:00
JKQTPBarVerticalStackableGraph ( JKQTBasePlotter * parent = nullptr ) ;
2018-11-25 21:53:26 +08:00
/** \brief class constructor */
2020-09-17 22:59:57 +08:00
JKQTPBarVerticalStackableGraph ( JKQTPlotter * parent ) ;
2018-11-25 21:53:26 +08:00
/** \brief stacks this barchart upon the given \a parentGraph */
2020-09-17 22:59:57 +08:00
void stackUpon ( JKQTPBarVerticalStackableGraph * parentGraph ) ;
2018-11-25 21:53:26 +08:00
/** \brief unstacks this graph (i.e. deletes the parent graph in the stack) */
void dontStackUpon ( ) ;
/** \brief returns the stack parent graph, or \c nullptr */
2020-09-17 22:59:57 +08:00
const JKQTPBarVerticalStackableGraph * getStackParent ( ) const ;
/** \brief returns the stack parent graph, or \c nullptr */
JKQTPBarVerticalStackableGraph * getStackParent ( ) ;
2018-11-25 21:53:26 +08:00
protected :
/** \brief if set (!=nullptr), the current plot is drawn stacked onto this plot
*
2019-01-26 20:00:40 +08:00
* draw stacked barcharts by connecting several plots by calling \ c setStackedParent ( belowPlot ) for each plot
2018-11-25 21:53:26 +08:00
*/
2020-09-17 22:59:57 +08:00
JKQTPBarVerticalStackableGraph * stackParent ;
/** \brief used to generate stacked plots: returns the upper boundary of the parent plot in a stack, for the index-th datapoint */
double getParentStackedMax ( int index ) const ;
2018-11-25 21:53:26 +08:00
/** \brief returns \c true, if a stack parent is set (if available) */
2020-09-17 22:59:57 +08:00
bool hasStackParent ( ) const ;
/** \brief used to generate stacked plots: returns the upper boundary of this plot in a stack, for the index-th datapoint */
double getStackedMax ( int index ) const ;
2018-11-25 21:53:26 +08:00
} ;
2020-09-17 22:59:57 +08:00
2022-10-31 05:01:06 +08:00
/*! \brief This implements a horizontal bar graph with bars between \f$ x=\mbox{baseline} \f$ and \f$ x=f(y) \f$
2020-09-17 22:59:57 +08:00
* Optionally several graphs of this type may be stacked on top of each other
2022-10-23 03:07:14 +08:00
* \ ingroup jkqtplotter_barcharts
2018-11-25 21:53:26 +08:00
*
2020-09-17 22:59:57 +08:00
* Draw stacked barcharts by connecting several plots by calling \ c setStackedParent ( belowPlot ) for each plot
2022-10-23 03:07:14 +08:00
*
2020-09-17 22:59:57 +08:00
* \ image html JKQTPBarHorizontalGraphStacked . png
2018-11-25 21:53:26 +08:00
*
2019-06-13 16:27:06 +08:00
*
2020-09-17 22:59:57 +08:00
* \ see JKQTPBarHorizontalGraph , \ ref JKQTPlotterStackedBarChart
2018-11-25 21:53:26 +08:00
*/
2020-09-17 22:59:57 +08:00
class JKQTPLOTTER_LIB_EXPORT JKQTPBarHorizontalStackableGraph : public JKQTPBarHorizontalGraph {
2018-11-25 21:53:26 +08:00
Q_OBJECT
public :
/** \brief class constructor */
2020-09-17 22:59:57 +08:00
JKQTPBarHorizontalStackableGraph ( JKQTBasePlotter * parent = nullptr ) ;
2018-11-25 21:53:26 +08:00
/** \brief class constructor */
2020-09-17 22:59:57 +08:00
JKQTPBarHorizontalStackableGraph ( JKQTPlotter * parent ) ;
/** \brief stacks this barchart upon the given \a parentGraph */
void stackUpon ( JKQTPBarHorizontalStackableGraph * parentGraph ) ;
/** \brief unstacks this graph (i.e. deletes the parent graph in the stack) */
void dontStackUpon ( ) ;
/** \brief returns the stack parent graph, or \c nullptr */
const JKQTPBarHorizontalStackableGraph * getStackParent ( ) const ;
/** \brief returns the stack parent graph, or \c nullptr */
JKQTPBarHorizontalStackableGraph * getStackParent ( ) ;
2018-11-25 21:53:26 +08:00
2020-09-17 22:59:57 +08:00
protected :
/** \brief if set (!=nullptr), the current plot is drawn stacked onto this plot
2018-11-25 21:53:26 +08:00
*
2020-09-17 22:59:57 +08:00
* draw stacked barcharts by connecting several plots by calling \ c setStackedParent ( belowPlot ) for each plot
2018-11-25 21:53:26 +08:00
*/
2020-09-17 22:59:57 +08:00
JKQTPBarHorizontalStackableGraph * stackParent ;
2018-11-25 21:53:26 +08:00
2020-09-17 22:59:57 +08:00
/** \brief used to generate stacked plots: returns the upper boundary of the parent plot in a stack, for the index-th datapoint */
virtual double getParentStackedMax ( int index ) const override ;
/** \brief returns \c true, if a stack parent is set (if available) */
virtual bool hasStackParent ( ) const override ;
/** \brief used to generate stacked plots: returns the upper boundary of this plot in a stack, for the index-th datapoint */
double getStackedMax ( int index ) const ;
2018-11-25 21:53:26 +08:00
} ;
2020-09-17 22:59:57 +08:00
2018-12-19 00:13:18 +08:00
# endif // jkqtpgraphsbarchart_H