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

Method testRange01

tests/backend/BarPlot/BarPlotTest.cpp:21–48  ·  view source on GitHub ↗

! * \brief one dataset, grouped */

Source from the content-addressed store, hash-verified

19 * \brief one dataset, grouped
20 */
21void BarPlotTest::testRange01() {
22 Project project;
23 auto* ws = new Worksheet(QStringLiteral("worksheet"));
24 project.addChild(ws);
25
26 auto* p = new CartesianPlot(QStringLiteral("plot"));
27 ws->addChild(p);
28
29 auto* barPlot = new BarPlot(QStringLiteral("barplot"));
30 p->addChild(barPlot);
31
32 // set the data
33 QVector<const AbstractColumn*> dataColumns;
34 auto* c = new Column(QStringLiteral("data"));
35 c->setValueAt(0, 3.);
36 c->setValueAt(1, 6.);
37 c->setValueAt(2, 9.);
38 c->setValueAt(3, 12.);
39 dataColumns << c;
40
41 barPlot->setDataColumns(dataColumns);
42
43 // check the min and max range values
44 QCOMPARE(barPlot->minimum(Dimension::X), 0.0);
45 QCOMPARE(barPlot->maximum(Dimension::X), 4.0);
46 QCOMPARE(barPlot->minimum(Dimension::Y), 0.);
47 QCOMPARE(barPlot->maximum(Dimension::Y), 12.);
48}
49
50/*!
51 * \brief one dataset, grouped, with a negative value

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