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

Method testRangeLollipopPlot01

tests/backend/BarPlot/BarPlotTest.cpp:208–235  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

206 * \brief lollipop plot wiht one dataset, horizontal
207 */
208void 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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected