MCPcopy Create free account
hub / github.com/KDE/labplot / testRangeLollipopPlot02

Method testRangeLollipopPlot02

tests/backend/BarPlot/BarPlotTest.cpp:240–268  ·  view source on GitHub ↗

! * \brief lollipop plot wiht one dataset, vertical */

Source from the content-addressed store, hash-verified

238 * \brief lollipop plot wiht one dataset, vertical
239 */
240void 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
270QTEST_MAIN(BarPlotTest)

Callers

nothing calls this directly

Calls 6

addChildMethod · 0.45
setOrientationMethod · 0.45
setValueAtMethod · 0.45
setDataColumnsMethod · 0.45
minimumMethod · 0.45
maximumMethod · 0.45

Tested by

no test coverage detected