! recalculates the painter path for the lines connecting the data points. Called each time when the type of this connection is changed. */
| 968 | Called each time when the type of this connection is changed. |
| 969 | */ |
| 970 | void HistogramPrivate::updateLines() { |
| 971 | PERFTRACE(name() + QLatin1String(Q_FUNC_INFO)); |
| 972 | |
| 973 | linePath = QPainterPath(); |
| 974 | lines.clear(); |
| 975 | linesUnclipped.clear(); |
| 976 | pointsLogical.clear(); |
| 977 | pointsScene.clear(); |
| 978 | |
| 979 | if (orientation == Histogram::Orientation::Vertical) |
| 980 | verticalHistogram(); |
| 981 | else |
| 982 | horizontalHistogram(); |
| 983 | |
| 984 | // map the lines and the symbol positions to the scene coordinates |
| 985 | linesUnclipped = q->cSystem->mapLogicalToScene(lines, AbstractCoordinateSystem::MappingFlag::SuppressPageClipping); |
| 986 | lines = q->cSystem->mapLogicalToScene(lines); |
| 987 | visiblePoints = std::vector<bool>(pointsLogical.count(), false); |
| 988 | q->cSystem->mapLogicalToScene(pointsLogical, pointsScene, visiblePoints); |
| 989 | |
| 990 | // new line path |
| 991 | for (const auto& line : lines) { |
| 992 | linePath.moveTo(line.p1()); |
| 993 | linePath.lineTo(line.p2()); |
| 994 | } |
| 995 | |
| 996 | updateFilling(); |
| 997 | recalcShapeAndBoundingRect(); |
| 998 | } |
| 999 | |
| 1000 | void HistogramPrivate::histogramValue(double& value, int bin) const { |
| 1001 | switch (normalization) { |
no test coverage detected