! * \brief lollipop plot wiht one dataset, vertical */
| 238 | * \brief lollipop plot wiht one dataset, vertical |
| 239 | */ |
| 240 | void BarPlotTest::testRangeLollipopPlot02() { |
| 241 | Project project; |
| 242 | auto* ws = new Worksheet(QStringLiteral("worksheet")); |
| 243 | project.addChild(ws); |
| 244 | |
| 245 | auto* p = new CartesianPlot(QStringLiteral("plot")); |
| 246 | ws->addChild(p); |
| 247 | |
| 248 | auto* barPlot = new LollipopPlot(QStringLiteral("barplot")); |
| 249 | barPlot->setOrientation(LollipopPlot::Orientation::Horizontal); |
| 250 | p->addChild(barPlot); |
| 251 | |
| 252 | // set the data |
| 253 | QVector<const AbstractColumn*> dataColumns; |
| 254 | auto* c = new Column(QStringLiteral("data")); |
| 255 | c->setValueAt(0, 3.); |
| 256 | c->setValueAt(1, 6.); |
| 257 | c->setValueAt(2, 9.); |
| 258 | c->setValueAt(3, 12.); |
| 259 | dataColumns << c; |
| 260 | |
| 261 | barPlot->setDataColumns(dataColumns); |
| 262 | |
| 263 | // check the min and max range values |
| 264 | QCOMPARE(barPlot->minimum(Dimension::X), 0.0); |
| 265 | QCOMPARE(barPlot->maximum(Dimension::X), 12.0); |
| 266 | QCOMPARE(barPlot->minimum(Dimension::Y), 0.); |
| 267 | QCOMPARE(barPlot->maximum(Dimension::Y), 4.0); |
| 268 | } |
| 269 | |
| 270 | QTEST_MAIN(BarPlotTest) |
nothing calls this directly
no test coverage detected