Dear All, I've been trying to apply a gradient to fill the space under the curve.
QLinearGradient linearGrad(QPointF(0, 0), QPointF(0, 120)); QColor w(Qt::transparent); w.setAlphaF(.5); QColor g(Qt::red); g.setAlphaF(.5); QColor b(Qt::black); b.setAlphaF(.5); linearGrad.setColorAt(0, w); linearGrad.setColorAt(0.5, g); linearGrad.setColorAt(1, b); ... ui->plot->addGraph(); // yellow line: set point ui->plot->graph(LIVE_TEMPERATURE_GRAPH)->setBrush(linearGrad);
But is wrong because of fixed points. My problem is that I don't understand how to set the 2 points in lineadGrad. How to set the space from the x axis to each point of the curve ?
Does anybody solved this scenario ?