@@ -39,20 +39,25 int main(int argc, char *argv[]) | |||||
39 | chartView->addSeries(series0); |
|
39 | chartView->addSeries(series0); | |
40 | chartView->addSeries(series1); |
|
40 | chartView->addSeries(series1); | |
41 |
|
41 | |||
42 |
|
||||
43 | QLinearGradient backgroundGradient; |
|
42 | QLinearGradient backgroundGradient; | |
44 | backgroundGradient.setColorAt(0.0, Qt::white); |
|
43 | backgroundGradient.setColorAt(0.0, Qt::white); | |
45 | backgroundGradient.setColorAt(1.0, QRgb(0xffff80)); |
|
44 | backgroundGradient.setColorAt(1.0, QRgb(0xffff80)); | |
46 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); |
|
45 | backgroundGradient.setCoordinateMode(QGradient::ObjectBoundingMode); | |
47 | chartView->setChartBackgroundBrush(backgroundGradient); |
|
46 | chartView->setChartBackgroundBrush(backgroundGradient); | |
48 |
|
47 | |||
49 |
QChartAxis axis = chartView-> |
|
48 | QChartAxis* axisX = chartView->axisX(); | |
50 | axis.setLabelsOrientation(QChartAxis::LabelsOrientationSlide); |
|
49 | axisX->setLabelsAngle(45); | |
51 |
axis |
|
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); |
|
55 | QChartAxis* axisY = chartView->axisY(); | |
54 | axis.setShadesBrush(Qt::yellow); |
|
56 | axisY->setLabelsAngle(45); | |
55 | chartView->setDefaultAxisY(axis); |
|
57 | axisY->setShadesBrush(Qt::yellow); | |
|
58 | axisY->addAxisTickLabel(0,"low"); | |||
|
59 | axisY->addAxisTickLabel(50,"medium"); | |||
|
60 | axisY->addAxisTickLabel(100,"High"); | |||
56 |
|
61 | |||
57 | window.setCentralWidget(chartView); |
|
62 | window.setCentralWidget(chartView); | |
58 | window.resize(400, 300); |
|
63 | window.resize(400, 300); |
General Comments 0
You need to be logged in to leave comments.
Login now