Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
qwt, how to fill area above a curve with color?
ConfaMiky last edited by
Colud aomeone help in qwt fillCurve using?
I try to fill the curve below and over the baseline with different color. I try to use the code that I found and for clipping different regions it's ok.
But I'm not been able to fill it with different color could someone help me. I try with setBrush(...) but nothing happen.
void Curve::fillCurve(QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRectF & canvasRect, QPolygonF & polygon) const
QBrush *brush1 = new QBrush (Qt::green, Qt::SolidPattern);
// QwtPlotCurve::fillCurve(painter, xMap, yMap, canvasRect, polygon);
painter->setClipRect(0,0,1000,yMap.transform(baseline()), Qt::ReplaceClip); QwtPlotCurve::fillCurve(painter, xMap, yMap, canvasRect, polygon); painter->restore();