! * \brief one dataset, grouped */
| 19 | * \brief one dataset, grouped |
| 20 | */ |
| 21 | void BarPlotTest::testRange01() { |
| 22 | Project project; |
| 23 | auto* ws = new Worksheet(QStringLiteral("worksheet")); |
| 24 | project.addChild(ws); |
| 25 | |
| 26 | auto* p = new CartesianPlot(QStringLiteral("plot")); |
| 27 | ws->addChild(p); |
| 28 | |
| 29 | auto* barPlot = new BarPlot(QStringLiteral("barplot")); |
| 30 | p->addChild(barPlot); |
| 31 | |
| 32 | // set the data |
| 33 | QVector<const AbstractColumn*> dataColumns; |
| 34 | auto* c = new Column(QStringLiteral("data")); |
| 35 | c->setValueAt(0, 3.); |
| 36 | c->setValueAt(1, 6.); |
| 37 | c->setValueAt(2, 9.); |
| 38 | c->setValueAt(3, 12.); |
| 39 | dataColumns << c; |
| 40 | |
| 41 | barPlot->setDataColumns(dataColumns); |
| 42 | |
| 43 | // check the min and max range values |
| 44 | QCOMPARE(barPlot->minimum(Dimension::X), 0.0); |
| 45 | QCOMPARE(barPlot->maximum(Dimension::X), 4.0); |
| 46 | QCOMPARE(barPlot->minimum(Dimension::Y), 0.); |
| 47 | QCOMPARE(barPlot->maximum(Dimension::Y), 12.); |
| 48 | } |
| 49 | |
| 50 | /*! |
| 51 | * \brief one dataset, grouped, with a negative value |
nothing calls this directly
no test coverage detected