QCustomPlot Discussion and Comments

Sine wave gradientReturn to overview

Hello. I have a sine wave. I want to fill it with a gradient in both directions for the positive half and negative half. How to do it?

    QLinearGradient linearGrad(QPointF(0, 0), QPointF(0, 1));
    linearGrad.setCoordinateMode(QGradient::ObjectBoundingMode);
    linearGrad.setColorAt(0, Qt::darkGray);
    linearGrad.setColorAt(0.5, Qt::white);
    linearGrad.setColorAt(1, Qt::darkGray);

    Graph->setBrush(linearGrad);