! * \brief lollipop plot wiht one dataset, horizontal */
| 206 | * \brief lollipop plot wiht one dataset, horizontal |
| 207 | */ |
| 208 | void BarPlotTest::testRangeLollipopPlot01() { |
| 209 | Project project; |
| 210 | auto* ws = new Worksheet(QStringLiteral("worksheet")); |
| 211 | project.addChild(ws); |
| 212 | |
| 213 | auto* p = new CartesianPlot(QStringLiteral("plot")); |
| 214 | ws->addChild(p); |
| 215 | |
| 216 | auto* barPlot = new LollipopPlot(QStringLiteral("barplot")); |
| 217 | p->addChild(barPlot); |
| 218 | |
| 219 | // set the data |
| 220 | QVector<const AbstractColumn*> dataColumns; |
| 221 | auto* c = new Column(QStringLiteral("data")); |
| 222 | c->setValueAt(0, 3.); |
| 223 | c->setValueAt(1, 6.); |
| 224 | c->setValueAt(2, 9.); |
| 225 | c->setValueAt(3, 12.); |
| 226 | dataColumns << c; |
| 227 | |
| 228 | barPlot->setDataColumns(dataColumns); |
| 229 | |
| 230 | // check the min and max range values |
| 231 | QCOMPARE(barPlot->minimum(Dimension::X), 0.0); |
| 232 | QCOMPARE(barPlot->maximum(Dimension::X), 4.0); |
| 233 | QCOMPARE(barPlot->minimum(Dimension::Y), 0.); |
| 234 | QCOMPARE(barPlot->maximum(Dimension::Y), 12.); |
| 235 | } |
| 236 | |
| 237 | /*! |
| 238 | * \brief lollipop plot wiht one dataset, vertical |
nothing calls this directly
no test coverage detected