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

Method adjustPropertiesContainers

src/backend/worksheet/plots/cartesian/BoxPlot.cpp:740–762  ·  view source on GitHub ↗

! * adds additional elements for background and line properties according to the current * number of data columns to be plotted. */

Source from the content-addressed store, hash-verified

738 * number of data columns to be plotted.
739 */
740void BoxPlotPrivate::adjustPropertiesContainers() {
741 int diff = dataColumns.size() - backgrounds.size();
742 if (diff > 0) {
743 // one more box needs to be added
744 KConfig config;
745 KConfigGroup group = config.group(QLatin1String("XYCurve"));
746 const auto* plot = static_cast<const CartesianPlot*>(q->parentAspect());
747
748 for (int i = 0; i < diff; ++i) {
749 // box filling and border line
750 auto* background = addBackground(group);
751 auto* borderLine = addBorderLine(group);
752 auto* medianLine = addMedianLine(group);
753
754 if (plot) {
755 const auto& themeColor = plot->themeColorPalette(backgrounds.count() - 1);
756 background->setFirstColor(themeColor);
757 borderLine->setColor(themeColor);
758 medianLine->setColor(themeColor);
759 }
760 }
761 }
762}
763
764/*!
765 called when the size of the plot or its data ranges (manual changes, zooming, etc.) were changed.

Callers

nothing calls this directly

Calls 7

parentAspectMethod · 0.80
setFirstColorMethod · 0.80
sizeMethod · 0.45
groupMethod · 0.45
themeColorPaletteMethod · 0.45
countMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected