diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-05-08 13:12:46 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-05-08 14:00:12 +0300 |
commit | a1abb208b1ea157bbda7b823b480a133dc8791fd (patch) | |
tree | 22f0ef9e593e7efc573b6ef70c1786ce0f04b50e /examples | |
parent | 8956755bc504774bbdcc18e3aab830b6b21ecf62 (diff) |
Added plot area background customization to customchart example
Change-Id: Ic61470741a71e0eab2e9a66763eb14bb968bde86
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/customchart/main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/customchart/main.cpp b/examples/customchart/main.cpp index b7a885be..50076f8c 100644 --- a/examples/customchart/main.cpp +++ b/examples/customchart/main.cpp @@ -59,6 +59,16 @@ int main(int argc, char *argv[]) backgroundGradient.setColorAt(1.0, QRgb(0x4c4547)); backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); chart->setBackgroundBrush(backgroundGradient); + + // Customize plot area background + QLinearGradient plotAreaGradient; + plotAreaGradient.setStart(QPointF(0, 1)); + plotAreaGradient.setFinalStop(QPointF(1, 0)); + plotAreaGradient.setColorAt(0.0, QRgb(0x555555)); + plotAreaGradient.setColorAt(1.0, QRgb(0x55aa55)); + plotAreaGradient.setCoordinateMode(QGradient::ObjectBoundingMode); + chart->setPlotAreaBackgroundBrush(plotAreaGradient); + chart->setPlotAreaBackgroundVisible(true); //![2] //![3] @@ -86,7 +96,7 @@ int main(int argc, char *argv[]) axisX->setGridLineVisible(false); axisY->setGridLineVisible(false); axisY->setShadesPen(Qt::NoPen); - axisY->setShadesBrush(QBrush(QRgb(0xa5a2a3))); + axisY->setShadesBrush(QBrush(QColor(0x99, 0xcc, 0xcc, 0x55))); axisY->setShadesVisible(true); //![3] |