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

Method showBoxPlot

src/frontend/spreadsheet/StatisticsColumnWidget.cpp:394–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394void StatisticsColumnWidget::showBoxPlot() {
395 // add plot
396 auto* plot = addPlot(&m_boxPlotWidget);
397
398 auto axes = plot->children<Axis>();
399 for (auto* axis : std::as_const(axes)) {
400 if (axis->orientation() == Axis::Orientation::Horizontal) {
401 axis->setLabelsPosition(Axis::LabelsPosition::NoLabels);
402 axis->setMajorTicksDirection(Axis::noTicks);
403 axis->majorGridLine()->setStyle(Qt::NoPen);
404 axis->minorGridLine()->setStyle(Qt::NoPen);
405 axis->title()->setText(QString());
406 } else
407 axis->title()->setText(m_column->name());
408
409 axis->setMinorTicksDirection(Axis::noTicks);
410 }
411 QApplication::processEvents(QEventLoop::AllEvents, 100);
412
413 auto* boxPlot = new BoxPlot(QString());
414 boxPlot->setOrientation(BoxPlot::Orientation::Vertical);
415 boxPlot->setWhiskersType(BoxPlot::WhiskersType::IQR);
416 boxPlot->setDataColumns({m_column});
417
418 // add the child to the parent _after_ the data column was set so the theme settings are properly applied in loadThemeConfig().
419 plot->addChild(boxPlot);
420
421 m_boxPlotInitialized = true;
422}
423
424void StatisticsColumnWidget::showBarPlot() {
425 // add plot

Callers

nothing calls this directly

Calls 15

setLabelsPositionMethod · 0.80
majorGridLineMethod · 0.80
minorGridLineMethod · 0.80
setWhiskersTypeMethod · 0.80
QStringClass · 0.50
orientationMethod · 0.45
setStyleMethod · 0.45
setTextMethod · 0.45
titleMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected