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

Method addPlot

src/frontend/spreadsheet/StatisticsColumnWidget.cpp:641–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641CartesianPlot* StatisticsColumnWidget::addPlot(QWidget* widget) {
642 auto* ws = new Worksheet(QString());
643 ws->setUseViewSize(true);
644 ws->setLayoutTopMargin(0.);
645 ws->setLayoutBottomMargin(0.);
646 ws->setLayoutLeftMargin(0.);
647 ws->setLayoutRightMargin(0.);
648 m_project->addChild(ws);
649
650 auto* plot = new CartesianPlot(QString());
651 plot->setSuppressRetransform(true);
652 plot->setType(CartesianPlot::Type::TwoAxes);
653 plot->setSymmetricPadding(false);
654 const double padding = Worksheet::convertToSceneUnits(1.0, Worksheet::Unit::Centimeter);
655 plot->setRightPadding(padding);
656 plot->setVerticalPadding(padding);
657 plot->plotArea()->borderLine()->setStyle(Qt::NoPen);
658
659 ws->addChild(plot);
660 plot->setSuppressRetransform(false);
661
662 auto* layout = new QVBoxLayout(widget);
663 layout->setSpacing(0);
664 layout->addWidget(ws->view());
665 ws->setInteractive(false);
666 widget->setLayout(layout);
667
668 return plot;
669}
670
671// helpers
672const QString StatisticsColumnWidget::isNanValue(const double value) const {

Callers

nothing calls this directly

Calls 15

setUseViewSizeMethod · 0.80
setSymmetricPaddingMethod · 0.80
setRightPaddingMethod · 0.80
setVerticalPaddingMethod · 0.80
plotAreaMethod · 0.80
setSpacingMethod · 0.80
setInteractiveMethod · 0.80
setLayoutMethod · 0.80
QStringClass · 0.50
setLayoutTopMarginMethod · 0.45
setLayoutBottomMarginMethod · 0.45
setLayoutLeftMarginMethod · 0.45

Tested by

no test coverage detected