diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2020-09-30 13:11:26 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-10-19 08:58:51 +0200 |
commit | db49cdcf2f367e27ed8fb5f1619f0b41f2c63fd2 (patch) | |
tree | 78fcb53c14a82af63b9b8f13efab77e1679be6d0 /chart2/source/view | |
parent | 56847f654de05ca610f7117d5a19784b0fb421d5 (diff) |
tdf#137154 pie chart: improve Outside position of data labels
Some pie chart data labels were too close to the pie
with Outside placement.
Change-Id: I0eecdfc32601bdfa8bb3115183f9ca723a9f945b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103683
Tested-by: Jenkins
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/main/PolarLabelPositionHelper.cxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/chart2/source/view/main/PolarLabelPositionHelper.cxx b/chart2/source/view/main/PolarLabelPositionHelper.cxx index a3e9a7cd9778..8ebe9ca4c4cc 100644 --- a/chart2/source/view/main/PolarLabelPositionHelper.cxx +++ b/chart2/source/view/main/PolarLabelPositionHelper.cxx @@ -129,26 +129,22 @@ awt::Point PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCi bool bOutside = nLabelPlacement == css::chart::DataLabelPlacement::OUTSIDE; - if(fAngleDegree==0.0) - rAlignment = LABEL_ALIGN_CENTER; - else if(fAngleDegree<=22.5) + if (fAngleDegree <= 5 || fAngleDegree >= 355) rAlignment = bOutside ? LABEL_ALIGN_RIGHT : LABEL_ALIGN_LEFT; - else if(fAngleDegree<67.5) + else if (fAngleDegree < 85) rAlignment = bOutside ? LABEL_ALIGN_RIGHT_TOP : LABEL_ALIGN_LEFT_BOTTOM; - else if(fAngleDegree<112.5) + else if (fAngleDegree <= 95) rAlignment = bOutside ? LABEL_ALIGN_TOP : LABEL_ALIGN_BOTTOM; - else if(fAngleDegree<=157.5) + else if (fAngleDegree < 175) rAlignment = bOutside ? LABEL_ALIGN_LEFT_TOP : LABEL_ALIGN_RIGHT_BOTTOM; - else if(fAngleDegree<=202.5) + else if (fAngleDegree <= 185) rAlignment = bOutside ? LABEL_ALIGN_LEFT : LABEL_ALIGN_RIGHT; - else if(fAngleDegree<247.5) + else if (fAngleDegree < 265) rAlignment = bOutside ? LABEL_ALIGN_LEFT_BOTTOM : LABEL_ALIGN_RIGHT_TOP; - else if(fAngleDegree<292.5) + else if (fAngleDegree <= 275) rAlignment = bOutside ? LABEL_ALIGN_BOTTOM : LABEL_ALIGN_TOP; - else if(fAngleDegree<337.5) - rAlignment = bOutside ? LABEL_ALIGN_RIGHT_BOTTOM : LABEL_ALIGN_LEFT_TOP; else - rAlignment = bOutside ? LABEL_ALIGN_RIGHT : LABEL_ALIGN_LEFT; + rAlignment = bOutside ? LABEL_ALIGN_RIGHT_BOTTOM : LABEL_ALIGN_LEFT_TOP; } else { |