QCustomPlot Discussion and Comments

Fill curve with setBrush from the bottom of the chartReturn to overview

I have a chart which shows the temperature. I have filled the curve with setBrush, what works fine. But when I have negative values it fills the negative values of the curve between the measured value and 0, not from the bottom of the plot.
Is there a way, to say that the curve has to be filled everytime from the bottom of the plot, not from value 0?

For easier explanation: see example https://www.qcustomplot.com/index.php/demos/simpledemo
I would like to have the blue brush from the bottom of the plot, not from value 0.

Only workaround I see at the moment is to create a dummy graph, which is a horizontal line with the value of the bottom of the plot and fill between this dummy graph and the temperature graph. But I guess there is an easier way.

You can use QLinearGradient

    QLinearGradient gradient(0, 0, 1, 0);
    gradient.setColorAt(1, QColor(40, 110, 255, 255));
    gradient.setColorAt(0, QColor(40, 110, 255, 255));
    QBrush brush(gradient);

no easier way, just create a dummy gray :)

dummy graph