20#ifndef jkqtpgraphsbarchartbase_H
21#define jkqtpgraphsbarchartbase_H
27#include "jkqtplotter/jkqtptools.h"
28#include "jkqtplotter/jkqtplotter_imexport.h"
29#include "jkqtplotter/jkqtpgraphsbase.h"
30#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
bool getDrawBaseline() const
indicates whether to draw a line with style m_baselineStyle at the baseline-value
double getWidth() const
the width of the bargraphs, relative to the distance between the current and the next x-value
virtual double getParentStackedMax(int index) const
used to generate stacked plots: returns the upper boundary of the parent plot in a stack,...
void setShift(double __value)
the shift of the bargraphs, relative to the distance between the current and the next x-value
bool m_drawBaseline
indicates whether to draw a line with style m_baselineStyle at the baseline-value
Definition jkqtpbarchartbase.h:362
double rectRadiusAtBaseline
corner radius (in pt) for bars at the "baseline" end
Definition jkqtpbarchartbase.h:348
bool m_useCustomDrawFunctor
enabled custom drawing by m_customDrawFunctor
Definition jkqtpbarchartbase.h:441
CustomDrawingFunctor m_customDrawFunctor
this allows to provide custom drawing code for the bars. It is called for every visible bar if activa...
Definition jkqtpbarchartbase.h:436
void setFillBrushFunctor(const JKQTPBarGraphBase::FillBrushFunctor &f)
functor, used to determine the color in m_fillMode==FunctorFilling
virtual void autoscaleBarWidthAndShift(double maxWidth=0.75, double shrinkFactor=0.9)
finds all bar charts of the same orientation and determines width and shift, so they stand side by si...
void setRectRadius(double all)
sets the corner radius of the bars for both ends
JKQTPGraphFillStyleMixin & fillStyleBelow()
if m_fillMode ==FillAboveAndBelowDifferently then this fill style is used below the baseline and the ...
JKQTPGraphLineStyleMixin & baselineStyle()
if m_drawBaseline ==true then this style is used to draw the baseline
std::function< void(JKQTPEnhancedPainter &painter, const QRectF &bar_px, const QPointF &datapoint, Qt::Orientation orientation, JKQTPBarGraphBase *graph)> CustomDrawingFunctor
functor for custom drawing of bars
Definition jkqtpbarchartbase.h:167
FillMode m_fillMode
specifies how the area of the graph is filles
Definition jkqtpbarchartbase.h:372
FillBrushFunctor & getFillBrushFunctor()
functor, used to determine the color in m_fillMode==FunctorFilling
void setCustomDrawingFunctor(JKQTPBarGraphBase::CustomDrawingFunctor &&f)
this allows to provide custom drawing code for the bars. It is called for every visible bar if activa...
FillBrushFunctor m_fillBrushFunctor
functor, used to determine the color in m_fillMode==FunctorFilling
Definition jkqtpbarchartbase.h:411
void setRectRadiusAtBaseline(double __value)
corner radius (in pt) for bars at the "baseline" end
void setFillMode(JKQTPBarGraphBase::FillMode mode)
specifies how the area of the graph is filles
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
void setFillColor_and_darkenedColor(QColor fill, int colorDarker=200)
sets the fill color and the color together, where fillColor is set to fill and the line-color is set ...
int getBarPositionColumn() const
returns xColumn or yColumn, whichever is used for the position of the bars (depending on whether the ...
double getRectRadiusAtBaseline() const
corner radius (in pt) for bars at the "baseline" end
void setBarHeightColumn(int column)
returns xColumn or yColumn, whichever is used for the height of the bars (depending on whether the ba...
void setStackSeparation(double __value)
separation (in pt) between two bars in a stack of bars
double width
the width of the bargraphs, relative to the distance between the current and the next x-value
Definition jkqtpbarchartbase.h:336
std::function< QBrush(double key, double value, JKQTPEnhancedPainter &painter, JKQTPBarGraphBase *graph)> FillBrushFunctor
a type of functor for FillMode::FunctorFilling
Definition jkqtpbarchartbase.h:159
JKQTPGraphFillStyleMixin m_fillStyleBelow
if m_fillMode ==FillAboveAndBelowDifferently then this fill style is used below the baseline and the ...
Definition jkqtpbarchartbase.h:378
virtual void setColor(QColor c)
set outline and fill color at the same time
bool getPositionsMinMax(double &mmin, double &mmax, double &smallestGreaterZero)
get the maximum and minimum value of the box positions of the graph
JKQTPGraphLineStyleMixin m_baselineStyle
if m_drawBaseline ==true then this style is used to draw the baseline
Definition jkqtpbarchartbase.h:353
double rectRadiusAtValue
corner radius (in pt) for bars at the "value" end
Definition jkqtpbarchartbase.h:346
JKQTPColorDerivationMode m_lineColorDerivationModeForSpecialFill
defines how to derive the line color in m_fillMode!=SingleFilling
Definition jkqtpbarchartbase.h:383
bool getValuesMinMax(double &mmin, double &mmax, double &smallestGreaterZero)
get the maximum and minimum value in the box-elongation (i.e. value) direction of the graph
void setBarPositionColumn(int column)
returns xColumn or yColumn, whichever is used for the position of the bars (depending on whether the ...
void setLineColorDerivationModeForSpecialFill(const JKQTPColorDerivationMode &m)
defines how to derive the line color in m_fillMode!=SingleFilling
virtual bool considerForAutoscaling(JKQTPBarGraphBase *other) const =0
this function is used by autoscaleBarWidthAndShift() to determine whether a given graph shall be take...
void setUseCustomDrawFunctor(bool enabled)
enabled custom drawing by m_customDrawFunctor
virtual FillBrushFunctor constructFillBrushFunctor() const
returns a FillBrushFunctor that is appropriate for the currently selected m_fillMode
double m_stackSeparation
separation (in pt) between two bars in a stack of bars
Definition jkqtpbarchartbase.h:364
double getShift() const
the shift of the bargraphs, relative to the distance between the current and the next x-value
int getBarHeightColumn() const
returns xColumn or yColumn, whichever is used for the height of the bars (depending on whether the ba...
JKQTPBarGraphBase(JKQTBasePlotter *parent=nullptr)
class constructor
std::function< QBrush(double key, double value)> SimpleFillBrushFunctor
a simplified type of functor for FillMode::FunctorFilling
Definition jkqtpbarchartbase.h:164
bool usesCustomDrawFunctor() const
enabled custom drawing by m_customDrawFunctor
FillMode getFillMode() const
specifies how the area of the graph is filles
JKQTPColorDerivationMode getLineColorDerivationModeForSpecialFill() const
defines how to derive the line color in m_fillMode!=SingleFilling
void setRectRadiusAtValue(double __value)
corner radius (in pt) for bars at the "value" end
void autoscaleBarWidthAndShiftSeparatedGroups(double groupWidth=0.75)
equivalent to autoscaleBarWidthAndShift(groupWidth,0.9);
void setDrawBaseline(bool __value)
indicates whether to draw a line with style m_baselineStyle at the baseline-value
virtual bool hasStackParent() const
returns true, if a stack parent is set (if available)
double shift
the shift of the bargraphs, relative to the distance between the current and the next x-value
Definition jkqtpbarchartbase.h:344
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
double getRectRadiusAtValue() const
corner radius (in pt) for bars at the "value" end
void setWidth(double __value)
the width of the bargraphs, relative to the distance between the current and the next x-value
FillMode
specifies how the area below the graph is filled
Definition jkqtpbarchartbase.h:172
@ SingleFilling
the whole area is filled with the same color/pattern
Definition jkqtpbarchartbase.h:173
@ FunctorFilling
a functor (use setFillBrushFunctor() to define one) is used to determine the fill color
Definition jkqtpbarchartbase.h:175
@ TwoColorFilling
the area above and below baseline with the two different colors/pattern
Definition jkqtpbarchartbase.h:174
double getStackSeparation() const
separation (in pt) between two bars in a stack of bars
This is an interface-class for all stackable bargraphs ... it is used internally for autoscaling only...
Definition jkqtpbarchartbase.h:479
friend class JKQTPBarGraphBase
Definition jkqtpbarchartbase.h:487
virtual ~JKQTPBarGraphStackInternalInterface()
Definition jkqtpbarchartbase.h:481
virtual JKQTPBarGraphBase * getBottomOfStack()=0
returns the barchart at the bottom of this stack (i.e. traverses the stack until there are no more pa...
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
JKQTPGraphFillStyleMixin()
class constructor
JKQTPGraphLineStyleMixin()
class constructor
JKQTBasePlotter * parent
the plotter object this object belongs to
Definition jkqtpgraphsbase.h:386
JKQTPXYBaselineGraph(JKQTBasePlotter *parent=nullptr)
class constructor
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:374
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
QBrush operator()(double key, double value, JKQTPEnhancedPainter &, JKQTPBarGraphBase *)
Definition jkqtpbarchartbase.h:390
SimpleFillBrushFunctorAdaptor(const SimpleFillBrushFunctor &f)
Definition jkqtpbarchartbase.h:387
SimpleFillBrushFunctorAdaptor(SimpleFillBrushFunctor &&f)
Definition jkqtpbarchartbase.h:388
SimpleFillBrushFunctor m_f
Definition jkqtpbarchartbase.h:389
Specifies how a fill-color is derived from a given color.
Definition jkqtptools.h:262