PDA

View Full Version : Changing/Customizing QwtPlot background into areas



Momergil
26th April 2013, 17:57
Hello!

I'm not sure if this is actually a Qwt issue or general Qt, but since I want to apply it to a QwtPlot, here it goes:

I'ld like to create a QwtPlot with limited yLeft axis 0-100% and then divide the background into four different areas, each of which with a different color in a gradient style (areas 0-25, 25-50, 50-75 and 75-100). All the rest of the plotting will be normal.

How could I do this?

Thanks,

Momergil

Uwe
27th April 2013, 10:31
When your background is related to plot coordinates you can use QwtPlotZoneItem, otherwise you can use use the palette of the plot canvas. In both cases you want to use brushes with linear gradients: see QBrush and QLinearGradient.

Uwe