Added minimal size of pie part for text on pie chart view.

This commit is contained in:
23rd 2023-09-25 18:31:48 +03:00 committed by John Preston
parent be17e2b919
commit d2578e9e47
1 changed files with 4 additions and 0 deletions

View File

@ -629,6 +629,7 @@ void StackLinearChartView::paintZoomedFooter(
}
void StackLinearChartView::paintPieText(QPainter &p, const PaintContext &c) {
constexpr auto kMinPercentage = 0.03;
if (_transition.progress == 1.) {
savePieTextParts(c);
}
@ -653,6 +654,9 @@ void StackLinearChartView::paintPieText(QPainter &p, const PaintContext &c) {
: -180;
const auto now = parts[k].stackedAngle;
const auto percentage = parts[k].roundedPercentage;
if (percentage <= kMinPercentage) {
continue;
}
const auto rText = side * std::sqrt(1. - percentage);
const auto textAngle = (previous + kPieAngleOffset)