! 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 */
| 24819 | \see getQuartileBox, getWhiskerBackboneLines, getWhiskerBarLines |
| 24820 | */ |
| 24821 | void 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 |