! * \brief one dataset, grouped, with a negative value */
| 51 | * \brief one dataset, grouped, with a negative value |
| 52 | */ |
| 53 | void BarPlotTest::testRange02() { |
| 54 | Project project; |
| 55 | auto* ws = new Worksheet(QStringLiteral("worksheet")); |
| 56 | project.addChild(ws); |
| 57 | |
| 58 | auto* p = new CartesianPlot(QStringLiteral("plot")); |
| 59 | ws->addChild(p); |
| 60 | |
| 61 | auto* barPlot = new BarPlot(QStringLiteral("barplot")); |
| 62 | p->addChild(barPlot); |
| 63 | |
| 64 | // set the data |
| 65 | QVector<const AbstractColumn*> dataColumns; |
| 66 | auto* c = new Column(QStringLiteral("data")); |
| 67 | c->setValueAt(0, 3.); |
| 68 | c->setValueAt(1, -6.); |
| 69 | c->setValueAt(2, 9.); |
| 70 | c->setValueAt(3, 12.); |
| 71 | dataColumns << c; |
| 72 | |
| 73 | barPlot->setDataColumns(dataColumns); |
| 74 | |
| 75 | // check the min and max range values |
| 76 | QCOMPARE(barPlot->minimum(Dimension::X), 0.0); |
| 77 | QCOMPARE(barPlot->maximum(Dimension::X), 4.0); |
| 78 | QCOMPARE(barPlot->minimum(Dimension::Y), -6.); |
| 79 | QCOMPARE(barPlot->maximum(Dimension::Y), 12.); |
| 80 | } |
| 81 | |
| 82 | /*! |
| 83 | * \brief two datasets, stacked |
nothing calls this directly
no test coverage detected