##// END OF EJS Templates
Fixes axischart example
Michal Klocek -
r225:2caa52bc206b
parent child
Show More
@@ -39,20 +39,25 int main(int argc, char *argv[])
39 39 chartView->addSeries(series0);
40 40 chartView->addSeries(series1);
41 41
42
43 42 QLinearGradient backgroundGradient;
44 43 backgroundGradient.setColorAt(0.0, Qt::white);
45 44 backgroundGradient.setColorAt(1.0, QRgb(0xffff80));
46 45 backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode);
47 46 chartView->setChartBackgroundBrush(backgroundGradient);
48 47
49 QChartAxis axis = chartView->defaultAxisX();
50 axis.setLabelsOrientation(QChartAxis::LabelsOrientationSlide);
51 axis.setGridPen(Qt::DashLine);
48 QChartAxis* axisX = chartView->axisX();
49 axisX->setLabelsAngle(45);
50 axisX->setGridPen(Qt::DashLine);
51 axisX->addAxisTickLabel(0,"low");
52 axisX->addAxisTickLabel(50,"medium");
53 axisX->addAxisTickLabel(100,"High");
52 54
53 chartView->setDefaultAxisX(axis);
54 axis.setShadesBrush(Qt::yellow);
55 chartView->setDefaultAxisY(axis);
55 QChartAxis* axisY = chartView->axisY();
56 axisY->setLabelsAngle(45);
57 axisY->setShadesBrush(Qt::yellow);
58 axisY->addAxisTickLabel(0,"low");
59 axisY->addAxisTickLabel(50,"medium");
60 axisY->addAxisTickLabel(100,"High");
56 61
57 62 window.setCentralWidget(chartView);
58 63 window.resize(400, 300);
General Comments 0
You need to be logged in to leave comments. Login now