MCPcopy Create free account
hub / github.com/LUX-Core/lux / drawStatisticalBox

Method drawStatisticalBox

src/qt/qcustomplot.cpp:24821–24844  ·  view source on GitHub ↗

! Draws the graphical representation of a single statistical box with the data given by the iterator \a it with the provided \a painter. If the statistical box has a set of outlier data points, they are drawn with \a outlierStyle. \see getQuartileBox, getWhiskerBackboneLines, getWhiskerBarLines */

Source from the content-addressed store, hash-verified

24819 \see getQuartileBox, getWhiskerBackboneLines, getWhiskerBarLines
24820*/
24821void QCPStatisticalBox::drawStatisticalBox(QCPPainter *painter, QCPStatisticalBoxDataContainer::const_iterator it, const QCPScatterStyle &outlierStyle) const
24822{
24823 // draw quartile box:
24824 applyDefaultAntialiasingHint(painter);
24825 const QRectF quartileBox = getQuartileBox(it);
24826 painter->drawRect(quartileBox);
24827 // draw median line with cliprect set to quartile box:
24828 painter->save();
24829 painter->setClipRect(quartileBox, Qt::IntersectClip);
24830 painter->setPen(mMedianPen);
24831 painter->drawLine(QLineF(coordsToPixels(it->key-mWidth*0.5, it->median), coordsToPixels(it->key+mWidth*0.5, it->median)));
24832 painter->restore();
24833 // draw whisker lines:
24834 applyAntialiasingHint(painter, mWhiskerAntialiased, QCP::aePlottables);
24835 painter->setPen(mWhiskerPen);
24836 painter->drawLines(getWhiskerBackboneLines(it));
24837 painter->setPen(mWhiskerBarPen);
24838 painter->drawLines(getWhiskerBarLines(it));
24839 // draw outliers:
24840 applyScattersAntialiasingHint(painter);
24841 outlierStyle.applyTo(painter, mPen);
24842 for (int i=0; i<it->outliers.size(); ++i)
24843 outlierStyle.drawShape(painter, coordsToPixels(it->key, it->outliers.at(i)));
24844}
24845
24846/*! \internal
24847

Callers

nothing calls this directly

Calls 8

setPenMethod · 0.80
drawLineMethod · 0.80
restoreMethod · 0.80
applyToMethod · 0.80
drawShapeMethod · 0.80
saveMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected