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

Method testRange02

tests/backend/BarPlot/BarPlotTest.cpp:53–80  ·  view source on GitHub ↗

! * \brief one dataset, grouped, with a negative value */

Source from the content-addressed store, hash-verified

51 * \brief one dataset, grouped, with a negative value
52 */
53void BarPlotTest::testRange02() {
54 Project project;
55 auto* ws = new Worksheet(QStringLiteral("worksheet"));
56 project.addChild(ws);
57
58 auto* p = new CartesianPlot(QStringLiteral("plot"));
59 ws->addChild(p);
60
61 auto* barPlot = new BarPlot(QStringLiteral("barplot"));
62 p->addChild(barPlot);
63
64 // set the data
65 QVector<const AbstractColumn*> dataColumns;
66 auto* c = new Column(QStringLiteral("data"));
67 c->setValueAt(0, 3.);
68 c->setValueAt(1, -6.);
69 c->setValueAt(2, 9.);
70 c->setValueAt(3, 12.);
71 dataColumns << c;
72
73 barPlot->setDataColumns(dataColumns);
74
75 // check the min and max range values
76 QCOMPARE(barPlot->minimum(Dimension::X), 0.0);
77 QCOMPARE(barPlot->maximum(Dimension::X), 4.0);
78 QCOMPARE(barPlot->minimum(Dimension::Y), -6.);
79 QCOMPARE(barPlot->maximum(Dimension::Y), 12.);
80}
81
82/*!
83 * \brief two datasets, stacked

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