! 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 */
| 24895 | \see getQuartileBox, getWhiskerBackboneLines, getWhiskerBarLines |
| 24896 | */ |
| 24897 | void QCPStatisticalBox::drawStatisticalBox(QCPPainter *painter, QCPStatisticalBoxDataContainer::const_iterator it, const QCPScatterStyle &outlierStyle) const |
| 24898 | { |
| 24899 | // draw quartile box: |
| 24900 | applyDefaultAntialiasingHint(painter); |
| 24901 | const QRectF quartileBox = getQuartileBox(it); |
| 24902 | painter->drawRect(quartileBox); |
| 24903 | // draw median line with cliprect set to quartile box: |
| 24904 | painter->save(); |
| 24905 | painter->setClipRect(quartileBox, Qt::IntersectClip); |
| 24906 | painter->setPen(mMedianPen); |
| 24907 | painter->drawLine(QLineF(coordsToPixels(it->key-mWidth*0.5, it->median), coordsToPixels(it->key+mWidth*0.5, it->median))); |
| 24908 | painter->restore(); |
| 24909 | // draw whisker lines: |
| 24910 | applyAntialiasingHint(painter, mWhiskerAntialiased, QCP::aePlottables); |
| 24911 | painter->setPen(mWhiskerPen); |
| 24912 | painter->drawLines(getWhiskerBackboneLines(it)); |
| 24913 | painter->setPen(mWhiskerBarPen); |
| 24914 | painter->drawLines(getWhiskerBarLines(it)); |
| 24915 | // draw outliers: |
| 24916 | applyScattersAntialiasingHint(painter); |
| 24917 | outlierStyle.applyTo(painter, mPen); |
| 24918 | for (int i=0; i<it->outliers.size(); ++i) |
| 24919 | outlierStyle.drawShape(painter, coordsToPixels(it->key, it->outliers.at(i))); |
| 24920 | } |
| 24921 | |
| 24922 | /*! \internal |
| 24923 |