! * adds additional elements for background and line properties according to the current * number of data columns to be plotted. */
| 738 | * number of data columns to be plotted. |
| 739 | */ |
| 740 | void 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. |
nothing calls this directly
no test coverage detected