JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches
jkqtpboxplotstylingmixins.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
3
4
5
6 This software is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License (LGPL) as published by
8 the Free Software Foundation, either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License (LGPL) for more details.
15
16 You should have received a copy of the GNU Lesser General Public License (LGPL)
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef jkqtpgraphsboxplotstylingmixins_H
22#define jkqtpgraphsboxplotstylingmixins_H
23
24#include <QString>
25#include <QPainter>
26#include "jkqtplotter/jkqtptools.h"
27#include "jkqtplotter/jkqtplotter_imexport.h"
28#include "jkqtplotter/jkqtplotter_configmacros.h"
29#include "jkqtplotter/jkqtpgraphsbase.h"
30#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
31
32
33
34
35
36/*! \brief Styling Mix-In for Boxplots
37 \ingroup jkqtplotter_specialgraphs_stylemixins
38
39
40 \image html plot_boxplothorizontalelement.png
41
42 The example \ref JKQTPlotterBoxplotStyling discusses different options to style boxplots:
43
44 \image html test_styledboxplot.png
45 */
47#ifndef JKQTPLOTTER_WORKAROUND_QGADGET_BUG
48 Q_GADGET
49#endif
50 public:
51 /** \brief class constructor */
53
54 void initBoxplotStyle(JKQTBasePlotter* parent, int &parentPlotStyle);
55 /** \copydoc boxWidthAbsolute */
56 void setBoxWidthAbsolute(double __value);
57 /** \copydoc boxWidthAbsolute */
58 double getBoxWidthAbsolute() const;
59
60 /** \copydoc drawBox */
61 void setDrawBox(bool __value);
62 /** \copydoc drawBox */
63 bool getDrawBox() const;
64
65 /** \copydoc relativeWhiskerWidth */
66 void setRelativeWhiskerWidth(double __value);
67 /** \copydoc relativeWhiskerWidth */
69
70 /** \copydoc relativeNotchIndent */
71 void setRelativeNotchIndent(double __value);
72 /** \copydoc relativeNotchIndent */
73 double getRelativeNotchIndent() const;
74
75
76 /** \brief set the line style of whisker lines */
77 void setWhiskerLineStyle(Qt::PenStyle __value);
78 /** \brief get the line style of whisker lines */
79 Qt::PenStyle getWhiskerLineStyle() const;
80
81 /** \brief set the width [pt] of whisker lines */
82 void setWhiskerLineWidth(double __value);
83 /** \brief get the width [pt] of whisker lines */
84 double getWhiskerLineWidth() const;
85
86 /** \brief set the color of whisker lines */
87 void setWhiskerLineColor(QColor __value);
88 /** \brief get the color of whisker lines */
89 QColor getWhiskerLineColor() const;
90
91
92 /** \brief sets the dash offset for a custom dash style of whisker lines
93 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
94 */
95 void setWhiskerLineDashOffset(qreal offset);
96 /** \brief returns the dash offset for a custom dash style of whisker lines
97 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
98 */
100 /** \brief sets the dash pattern for a custom dash style of whisker lines
101 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
102 */
103 void setWhiskerLineDashPattern(const QVector<qreal> &pattern);
104 /** \brief gets the dash pattern for a custom dash style of whisker lines
105 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
106 */
107 QVector<qreal> getWhiskerLineDashPattern() const;
108 /** \brief sets the join style of whisker lines
109 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
110 */
111 void setWhiskerLineJoinStyle(Qt::PenJoinStyle style);
112 /** \brief returns the join style of whisker lines
113 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
114 */
115 Qt::PenJoinStyle getWhiskerLineJoinStyle() const;
116 /** \brief sets the cap style of whisker lines
117 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
118 */
119 void setWhiskerLineCapStyle(Qt::PenCapStyle style);
120 /** \brief gets the cap style of whisker lines
121 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
122 */
123 Qt::PenCapStyle getWhiskerLineCapStyle() const;
124 /** \brief sets the brush used to fill the line area of whisker lines
125 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
126 */
127 void setWhiskerLineBrush(const QBrush& style);
128 /** \brief gets the brush used to fill the line area of whisker lines
129 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
130 */
131 QBrush getWhiskerLineBrush() const;
132
133 /** \brief build a pen to be used for drawing whiskers */
135
136
137
138 /** \brief set the line style of whisker cap lines */
139 void setWhiskerCapLineStyle(Qt::PenStyle __value);
140 /** \brief get the line style of whisker cap lines */
141 Qt::PenStyle getWhiskerCapLineStyle() const;
142
143 /** \brief set the width [pt] of whisker cap lines */
144 void setWhiskerCapLineWidth(double __value);
145 /** \brief get the width [pt] of whisker cap lines */
147
148 /** \brief set the color of whisker cap lines */
149 void setWhiskerCapLineColor(QColor __value);
150 /** \brief get the color of whisker cap lines */
152
153
154 /** \brief sets the dash offset for a custom dash style of whisker cap lines
155 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
156 */
157 void setWhiskerCapLineDashOffset(qreal offset);
158 /** \brief returns the dash offset for a custom dash style of whisker cap lines
159 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
160 */
162 /** \brief sets the dash pattern for a custom dash style of whisker cap lines
163 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
164 */
165 void setWhiskerCapLineDashPattern(const QVector<qreal> &pattern);
166 /** \brief gets the dash pattern for a custom dash style of whisker cap lines
167 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
168 */
169 QVector<qreal> getWhiskerCapLineDashPattern() const;
170 /** \brief sets the join style of whisker cap lines
171 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
172 */
173 void setWhiskerCapLineJoinStyle(Qt::PenJoinStyle style);
174 /** \brief returns the join style of whisker cap lines
175 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
176 */
177 Qt::PenJoinStyle getWhiskerCapLineJoinStyle() const;
178 /** \brief sets the cap style of whisker cap lines
179 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
180 */
181 void setWhiskerCapLineCapStyle(Qt::PenCapStyle style);
182 /** \brief gets the cap style of whisker cap lines
183 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
184 */
185 Qt::PenCapStyle getWhiskerCapLineCapStyle() const;
186 /** \brief sets the brush used to fill the line area of whisker cap lines
187 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
188 */
189 void setWhiskerCapLineBrush(const QBrush& style);
190 /** \brief gets the brush used to fill the line area of whisker cap lines
191 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
192 */
194
195 /** \brief build a pen to be used for drawing whisker caps */
197
198
199
200
201 /** \brief modes of how to draw the mean in a boxplot */
202 enum MeanMode {
203 MeanAsSymbol, /*!< \brief draw mean as a symbol (specified by the settings in JKQTPGraphSymbolStyleMixin) */
204 MeanAsLine /*!< \brief draw mean as a lie (specified by the pen settings in JKQTPGraphSymbolStyleMixin) */
205 };
206
207 /** \copydoc meanMode */
208 void setMeanMode(MeanMode __value);
209 /** \copydoc meanMode */
211
212
213 /** \brief set the line style of median lines */
214 void setMedianLineStyle(Qt::PenStyle __value);
215 /** \brief get the line style of median lines */
216 Qt::PenStyle getMedianLineStyle() const;
217
218 /** \brief set the width [pt] of median lines */
219 void setMedianLineWidth(double __value);
220 /** \brief get the width [pt] of median lines */
221 double getMedianLineWidth() const;
222
223 /** \brief set the color of median lines */
224 void setMedianLineColor(QColor __value);
225 /** \brief get the color of median lines */
226 QColor getMedianLineColor() const;
227
228
229 /** \brief sets the dash offset for a custom dash style of median lines
230 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
231 */
232 void setMedianLineDashOffset(qreal offset);
233 /** \brief returns the dash offset for a custom dash style of median lines
234 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
235 */
237 /** \brief sets the dash pattern for a custom dash style of median lines
238 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
239 */
240 void setMedianLineDashPattern(const QVector<qreal> &pattern);
241 /** \brief gets the dash pattern for a custom dash style of median lines
242 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
243 */
244 QVector<qreal> getMedianLineDashPattern() const;
245 /** \brief sets the join style of median lines
246 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
247 */
248 void setMedianLineJoinStyle(Qt::PenJoinStyle style);
249 /** \brief returns the join style of median lines
250 * \see https://doc.qt.io/qt-5/qpen.html#setJoinStyle
251 */
252 Qt::PenJoinStyle getMedianLineJoinStyle() const;
253 /** \brief sets the cap style of median lines
254 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
255 */
256 void setMedianLineCapStyle(Qt::PenCapStyle style);
257 /** \brief gets the cap style of median lines
258 * \see https://doc.qt.io/qt-5/qpen.html#setCapStyle
259 */
260 Qt::PenCapStyle getMedianLineCapStyle() const;
261 /** \brief sets the brush used to fill the line area of median lines
262 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
263 */
264 void setMedianLineBrush(const QBrush& style);
265 /** \brief gets the brush used to fill the line area of median lines
266 * \see https://doc.qt.io/qt-5/qpen.html#setBrush
267 */
268 QBrush getMedianLineBrush() const;
269
270 /** \brief build a pen to be used for drawing medians */
271 QPen getMedianPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const;
272
273
274
275
276
277 /** \brief set the line style of Mean lines */
278 void setMeanLineStyle(Qt::PenStyle __value);
279 /** \brief get the line style of Mean lines */
280 Qt::PenStyle getMeanLineStyle() const;
281 /** \brief sets the dash offset for a custom dash style of Mean lines
282 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
283 */
284 void setMeanLineDashOffset(qreal offset);
285 /** \brief returns the dash offset for a custom dash style of Mean lines
286 * \see https://doc.qt.io/qt-5/qpen.html#setDashOffset
287 */
289 /** \brief sets the dash pattern for a custom dash style of Mean lines
290 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
291 */
292 void setMeanLineDashPattern(const QVector<qreal> &pattern);
293 /** \brief gets the dash pattern for a custom dash style of Mean lines
294 * \see https://doc.qt.io/qt-5/qpen.html#setDashPattern
295 */
296 QVector<qreal> getMeanLineDashPattern() const;
297 /** \brief set the type of the symbol for the mean */
299 /** \brief get the type of the symbol for the mean */
301
302 /** \brief set the size (=diameter in pt) of the symbol for the mean (in pt) */
303 void setMeanSize(double __value);
304 /** \brief get the size (=diameter in pt) of the symbol for the mean (in pt) */
305 double getMeanSize() const;
306
307 /** \brief set the color of the symbol for the mean, or mean line */
308 void setMeanColor(const QColor & __value);
309 /** \brief set the color of the symbol for the mean, or mean line */
310 QColor getMeanColor() const;
311
312 /** \brief set the color of filling of the symbol for the mean */
313 void setMeanFillColor(const QColor & __value);
314 /** \brief set the color of filling of the symbol for the mean */
315 QColor getMeanFillColor() const;
316
317 /** \brief set the line width of the symbol for the mean outline, or mean line (in pt) */
318 void setMeanLineWidth(double __value);
319 /** \brief get the line width of the symbol for the mean outline, or mean line (in pt) */
320 double getMeanLineWidth() const;
321 /** \brief set the font to be used for mean character symbols \c JKQTPCharacterSymbol+QChar('').unicode() */
322 void setMeanSymbolFontName(const QString& __value);
323 /** \brief get the font to be used for mean character symbols \c JKQTPCharacterSymbol+QChar('').unicode() */
324 QString getMeanSymbolFontName() const;
325
326 /** \brief generate a QFont for darwing symbols */
327 QFont getMeanSymbolFont() const;
328
329 /** \brief constructs a QPen from the line styling properties to draw the mean line */
331 /** \brief constructs a QPen from the line styling properties to draw the mean symbol */
333 /** \brief constructs a QPen from the line styling properties */
335
336 /** \brief set the color of the graph (colors all elements, based on the given color \a c ) */
337 void setBoxplotColor(QColor c, JKQTBasePlotter *parent);
338
339 /** \brief set the color of the graph (colors all elements, based on the given color \a c , sets background colors from \a bc ) */
340 void setBoxplotColor(QColor c, QColor bc, JKQTBasePlotter *parent);
341
342
343 protected:
344 /*! \brief plot a symbol at location x,y (in painter coordinates), using the current style
345
346 \param parent parent JKQTBasePlotter of the graph that uses this mix-in (used e.g. for line-width transformation)
347 \param painter the <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> to draw to
348 \param x x-coordinate of the symbol center
349 \param y y-coordinate of the symbol center
350 */
351 void plotStyledMeanSymbol(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, double x, double y) const;
352 /** \brief draws a vertical boxplot, with all coordinates/sizes given in coordinates of the given painter,
353 * using the style properties declared in this class. Provide a parameter with \c JKQTP_NAN of you
354 * don't want it to be drawn, or don't know its value
355 *
356 * \param parent parent JKQTBasePlotter of the graph that uses this mix-in (used e.g. for line-width transformation)
357 * \param painter the <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> to draw to
358 * \param xp x-coordinate of the boxplot center
359 * \param xpleft x-coordinate of the boxplot box left edge
360 * \param xpright x-coordinate of the boxplot box right edge
361 * \param minp y-coordinate of the minimum (lower whisker)
362 * \param q25p y-coordinate of the 25% quartile (lower box border)
363 * \param medianp y-coordinate the median
364 * \param q75p y-coordinate of the 75% quartile (upper box border)
365 * \param maxp y-coordinate of the maximum (upper whisker)
366 * \param meanp y-coordinate of the mean (symbol or line)
367 * \param notchLowerp y-coordinate of the lower (near \a qe5p ) end of the notch interval
368 * \param notchUpperp y-coordinate of the upper (near \a q75p ) end of the notch interval
369 */
370 void plotVerticalBoxplot(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, double xp, double xpleft, double xpright, double minp, double q25p, double medianp, double q75p, double maxp, double meanp=JKQTP_NAN, double notchLowerp=JKQTP_NAN, double notchUpperp=JKQTP_NAN) const;
371
372 /** \brief draws a horizontal boxplot, with all coordinates/sizes given in coordinates of the given painter,
373 * using the style properties declared in this class. Provide a parameter with \c JKQTP_NAN of you
374 * don't want it to be drawn, or don't know its value
375 *
376 * \param parent parent JKQTBasePlotter of the graph that uses this mix-in (used e.g. for line-width transformation)
377 * \param painter the <a href="http://doc.qt.io/qt-5/qpainter.html">QPainter</a> to draw to
378 * \param yp y-coordinate of the boxplot center
379 * \param ypbottom y-coordinate of the boxplot box bottom edge
380 * \param yptop y-coordinate of the boxplot box top edge
381 * \param minp x-coordinate of the minimum (lower whisker)
382 * \param q25p x-coordinate of the 25% quartile (lower box border)
383 * \param medianp x-coordinate the median
384 * \param q75p x-coordinate of the 75% quartile (upper box border)
385 * \param maxp x-coordinate of the maximum (upper whisker)
386 * \param meanp x-coordinate of the mean (symbol or line)
387 * \param notchLowerp x-coordinate of the lower (near \a qe5p ) end of the notch interval
388 * \param notchUpperp x-coordinate of the upper (near \a q75p ) end of the notch interval
389 */
390 void plotHorizontalBoxplot(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, double yp, double ypbottom, double yptop, double minp, double q25p, double medianp, double q75p, double maxp, double meanp=JKQTP_NAN, double notchLowerp=JKQTP_NAN, double notchUpperp=JKQTP_NAN) const;
391
392 /** \brief draw a small, stylized, vertical symbol into \a rect that symbolizes a boxplot, e.g. in a plot legend */
393 void plotVerticalKeyMarker(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, const QRectF& rect);
394
395 /** \brief draw a small, stylized, horizontal symbol into \a rect that symbolizes a boxplot, e.g. in a plot legend */
396 void plotHorizontalKeyMarker(JKQTBasePlotter* parent, JKQTPEnhancedPainter &painter, const QRectF& rect);
397 private:
398 /** \brief which symbol to use for the datapoints */
400 /** \brief size (diameter in pt) of the symbol for the data points, given in pt */
402 /** \brief outline color of the symbol or line pen of the mean-line */
404 /** \brief color of the symbol filling */
406 /** \brief width (in pt) of the lines used to plot the symbol for the data points, given in pt */
408 /** \brief font to be used for character mean symbols \c JKQTPCharacterSymbol+QChar('').unicode() */
410 /** \brief line style of the whisker lines */
412 /** \brief line width (in pt) of the whisker lines */
414 /** \brief line style of the whisker cap lines */
416 /** \brief line width (in pt) of the whisker cap lines */
418 /** \brief line style of the median lines */
420 /** \brief line width (in pt) of the median lines */
422 /** \brief width of box in pt.
423 *
424 * \note If several boxplots are drawn, the width is typically calculated,
425 * based on a relative width and the position distances, see JKQTPBoxplotVerticalGraph::boxWidthRelative */
427 /** \brief width of the whiskers, relative to the box width (default: 0.5) */
429 /** \brief single-sided indention of the notch (if any), relative to the box width (default: 0.25) */
431
432 /** \brief specifies how to draw the mean (as a line of as a symbol, specified by the function in JKQTPGraphSymbolStyleMixin) */
434 /** \brief enables/disables drawing of the actual box of the boxplot (\c false leads to Tufte Style boxplots ) */
436};
437
438
439
440
441
442#endif // jkqtpgraphsboxplotstylingmixins_H
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
Styling Mix-In for Boxplots.
Definition jkqtpboxplotstylingmixins.h:46
double whiskerCapLineWidth
line width (in pt) of the whisker cap lines
Definition jkqtpboxplotstylingmixins.h:417
QVector< qreal > getMedianLineDashPattern() const
gets the dash pattern for a custom dash style of median lines
QFont getMeanSymbolFont() const
generate a QFont for darwing symbols
void setMeanLineWidth(double __value)
set the line width of the symbol for the mean outline, or mean line (in pt)
QBrush getWhiskerCapLineBrush() const
gets the brush used to fill the line area of whisker cap lines
QPen getMedianPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
build a pen to be used for drawing medians
qreal getMeanLineDashOffset() const
returns the dash offset for a custom dash style of Mean lines
void setMedianLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of median lines
void setRelativeNotchIndent(double __value)
single-sided indention of the notch (if any), relative to the box width (default: 0....
void setDrawBox(bool __value)
enables/disables drawing of the actual box of the boxplot (false leads to Tufte Style boxplots )
void setWhiskerLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of whisker lines
void setMedianLineBrush(const QBrush &style)
sets the brush used to fill the line area of median lines
QBrush getWhiskerLineBrush() const
gets the brush used to fill the line area of whisker lines
QPen getWhiskerPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
build a pen to be used for drawing whiskers
double medianLineWidth
line width (in pt) of the median lines
Definition jkqtpboxplotstylingmixins.h:421
void setWhiskerCapLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of whisker cap lines
QColor getWhiskerLineColor() const
get the color of whisker lines
void setMeanLineDashOffset(qreal offset)
sets the dash offset for a custom dash style of Mean lines
JKQTPGraphBoxplotStyleMixin()
class constructor
void setBoxplotColor(QColor c, JKQTBasePlotter *parent)
set the color of the graph (colors all elements, based on the given color c )
void setBoxplotColor(QColor c, QColor bc, JKQTBasePlotter *parent)
set the color of the graph (colors all elements, based on the given color c , sets background colors ...
QBrush getMeanSymbolBrush(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
constructs a QPen from the line styling properties
void setWhiskerLineColor(QColor __value)
set the color of whisker lines
Qt::PenStyle getWhiskerLineStyle() const
get the line style of whisker lines
QPen getMeanSymbolPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
constructs a QPen from the line styling properties to draw the mean symbol
QString getMeanSymbolFontName() const
get the font to be used for mean character symbols JKQTPCharacterSymbol+QChar('')....
Qt::PenStyle getWhiskerCapLineStyle() const
get the line style of whisker cap lines
void setWhiskerCapLineCapStyle(Qt::PenCapStyle style)
sets the cap style of whisker cap lines
void setWhiskerCapLineColor(QColor __value)
set the color of whisker cap lines
qreal getMedianLineDashOffset() const
returns the dash offset for a custom dash style of median lines
void setWhiskerLineCapStyle(Qt::PenCapStyle style)
sets the cap style of whisker lines
void setMeanMode(MeanMode __value)
specifies how to draw the mean (as a line of as a symbol, specified by the function in JKQTPGraphSymb...
double getMeanLineWidth() const
get the line width of the symbol for the mean outline, or mean line (in pt)
bool drawBox
enables/disables drawing of the actual box of the boxplot (false leads to Tufte Style boxplots )
Definition jkqtpboxplotstylingmixins.h:435
QBrush getMedianLineBrush() const
gets the brush used to fill the line area of median lines
QVector< qreal > getMeanLineDashPattern() const
gets the dash pattern for a custom dash style of Mean lines
double getWhiskerLineWidth() const
get the width [pt] of whisker lines
QPen getMeanLinePen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
constructs a QPen from the line styling properties to draw the mean line
MeanMode getMeanMode() const
specifies how to draw the mean (as a line of as a symbol, specified by the function in JKQTPGraphSymb...
void setBoxWidthAbsolute(double __value)
width of box in pt.
Qt::PenStyle getMedianLineStyle() const
get the line style of median lines
void setMedianLineJoinStyle(Qt::PenJoinStyle style)
sets the join style of median lines
void plotStyledMeanSymbol(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, double x, double y) const
plot a symbol at location x,y (in painter coordinates), using the current style
double boxWidthAbsolute
width of box in pt.
Definition jkqtpboxplotstylingmixins.h:426
QPen getWhiskerCapPen(JKQTPEnhancedPainter &painter, JKQTBasePlotter *parent) const
build a pen to be used for drawing whisker caps
Qt::PenCapStyle getWhiskerCapLineCapStyle() const
gets the cap style of whisker cap lines
double m_meanSymbolLineWidth
width (in pt) of the lines used to plot the symbol for the data points, given in pt
Definition jkqtpboxplotstylingmixins.h:407
QColor getWhiskerCapLineColor() const
get the color of whisker cap lines
double getMeanSize() const
get the size (=diameter in pt) of the symbol for the mean (in pt)
qreal getWhiskerLineDashOffset() const
returns the dash offset for a custom dash style of whisker lines
QPen m_whiskerCapLinePen
line style of the whisker cap lines
Definition jkqtpboxplotstylingmixins.h:415
double m_meanSymbolSize
size (diameter in pt) of the symbol for the data points, given in pt
Definition jkqtpboxplotstylingmixins.h:401
void setMeanLineStyle(Qt::PenStyle __value)
set the line style of Mean lines
Qt::PenStyle getMeanLineStyle() const
get the line style of Mean lines
MeanMode meanMode
specifies how to draw the mean (as a line of as a symbol, specified by the function in JKQTPGraphSymb...
Definition jkqtpboxplotstylingmixins.h:433
void plotHorizontalBoxplot(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, double yp, double ypbottom, double yptop, double minp, double q25p, double medianp, double q75p, double maxp, double meanp=JKQTP_NAN, double notchLowerp=JKQTP_NAN, double notchUpperp=JKQTP_NAN) const
draws a horizontal boxplot, with all coordinates/sizes given in coordinates of the given painter,...
MeanMode
modes of how to draw the mean in a boxplot
Definition jkqtpboxplotstylingmixins.h:202
@ MeanAsSymbol
draw mean as a symbol (specified by the settings in JKQTPGraphSymbolStyleMixin)
Definition jkqtpboxplotstylingmixins.h:203
QVector< qreal > getWhiskerCapLineDashPattern() const
gets the dash pattern for a custom dash style of whisker cap lines
void setRelativeWhiskerWidth(double __value)
width of the whiskers, relative to the box width (default: 0.5)
void setMeanSize(double __value)
set the size (=diameter in pt) of the symbol for the mean (in pt)
QColor getMedianLineColor() const
get the color of median lines
void setWhiskerLineJoinStyle(Qt::PenJoinStyle style)
sets the join style of whisker lines
QPen m_whiskerLinePen
line style of the whisker lines
Definition jkqtpboxplotstylingmixins.h:411
void setMeanLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of Mean lines
void setWhiskerLineStyle(Qt::PenStyle __value)
set the line style of whisker lines
void setWhiskerCapLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of whisker cap lines
void setMedianLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of median lines
QPen m_medianLinePen
line style of the median lines
Definition jkqtpboxplotstylingmixins.h:419
QVector< qreal > getWhiskerLineDashPattern() const
gets the dash pattern for a custom dash style of whisker lines
void setMeanFillColor(const QColor &__value)
set the color of filling of the symbol for the mean
QColor getMeanColor() const
set the color of the symbol for the mean, or mean line
double getBoxWidthAbsolute() const
width of box in pt.
void plotVerticalBoxplot(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, double xp, double xpleft, double xpright, double minp, double q25p, double medianp, double q75p, double maxp, double meanp=JKQTP_NAN, double notchLowerp=JKQTP_NAN, double notchUpperp=JKQTP_NAN) const
draws a vertical boxplot, with all coordinates/sizes given in coordinates of the given painter,...
double whiskerLineWidth
line width (in pt) of the whisker lines
Definition jkqtpboxplotstylingmixins.h:413
Qt::PenJoinStyle getWhiskerCapLineJoinStyle() const
returns the join style of whisker cap lines
void setWhiskerLineBrush(const QBrush &style)
sets the brush used to fill the line area of whisker lines
Qt::PenJoinStyle getWhiskerLineJoinStyle() const
returns the join style of whisker lines
double getMedianLineWidth() const
get the width [pt] of median lines
void plotVerticalKeyMarker(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, const QRectF &rect)
draw a small, stylized, vertical symbol into rect that symbolizes a boxplot, e.g. in a plot legend
void setWhiskerCapLineBrush(const QBrush &style)
sets the brush used to fill the line area of whisker cap lines
qreal getWhiskerCapLineDashOffset() const
returns the dash offset for a custom dash style of whisker cap lines
QString m_meanSymbolFontName
font to be used for character mean symbols JKQTPCharacterSymbol+QChar('').unicode()
Definition jkqtpboxplotstylingmixins.h:409
void setMedianLineColor(QColor __value)
set the color of median lines
double getRelativeWhiskerWidth() const
width of the whiskers, relative to the box width (default: 0.5)
double getWhiskerCapLineWidth() const
get the width [pt] of whisker cap lines
void setMeanSymbolType(JKQTPGraphSymbols __value)
set the type of the symbol for the mean
void setWhiskerCapLineStyle(Qt::PenStyle __value)
set the line style of whisker cap lines
void setMeanSymbolFontName(const QString &__value)
set the font to be used for mean character symbols JKQTPCharacterSymbol+QChar('')....
void setWhiskerCapLineJoinStyle(Qt::PenJoinStyle style)
sets the join style of whisker cap lines
void setMedianLineWidth(double __value)
set the width [pt] of median lines
QPen m_meanSymbolLinePen
outline color of the symbol or line pen of the mean-line
Definition jkqtpboxplotstylingmixins.h:403
double relativeNotchIndent
single-sided indention of the notch (if any), relative to the box width (default: 0....
Definition jkqtpboxplotstylingmixins.h:430
Qt::PenCapStyle getMedianLineCapStyle() const
gets the cap style of median lines
QColor getMeanFillColor() const
set the color of filling of the symbol for the mean
void setWhiskerCapLineWidth(double __value)
set the width [pt] of whisker cap lines
void initBoxplotStyle(JKQTBasePlotter *parent, int &parentPlotStyle)
Qt::PenJoinStyle getMedianLineJoinStyle() const
returns the join style of median lines
void setMedianLineStyle(Qt::PenStyle __value)
set the line style of median lines
Qt::PenCapStyle getWhiskerLineCapStyle() const
gets the cap style of whisker lines
void setWhiskerLineDashPattern(const QVector< qreal > &pattern)
sets the dash pattern for a custom dash style of whisker lines
void setWhiskerLineWidth(double __value)
set the width [pt] of whisker lines
JKQTPGraphSymbols getMeanSymbolType() const
get the type of the symbol for the mean
JKQTPGraphSymbols m_meanSymbolType
which symbol to use for the datapoints
Definition jkqtpboxplotstylingmixins.h:399
double getRelativeNotchIndent() const
single-sided indention of the notch (if any), relative to the box width (default: 0....
void setMedianLineCapStyle(Qt::PenCapStyle style)
sets the cap style of median lines
void setMeanColor(const QColor &__value)
set the color of the symbol for the mean, or mean line
double relativeWhiskerWidth
width of the whiskers, relative to the box width (default: 0.5)
Definition jkqtpboxplotstylingmixins.h:428
QColor m_meanSymbolFillColor
color of the symbol filling
Definition jkqtpboxplotstylingmixins.h:405
void plotHorizontalKeyMarker(JKQTBasePlotter *parent, JKQTPEnhancedPainter &painter, const QRectF &rect)
draw a small, stylized, horizontal symbol into rect that symbolizes a boxplot, e.g....
bool getDrawBox() const
enables/disables drawing of the actual box of the boxplot (false leads to Tufte Style boxplots )
This Mix-In class provides setter/getter methods, storage and other facilities for the graph filling ...
Definition jkqtpgraphsbasestylingmixins.h:529
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:49
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
JKQTPGraphSymbols
symbols that can be used to plot a datapoint for a graph
Definition jkqtpdrawingtools.h:143
#define JKQTP_NAN
double-value NotANumber
Definition jkqtpmathtools.h:87