summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTünde Tóth <tundeth@gmail.com>2020-02-03 15:51:52 +0100
committerLászló Németh <nemeth@numbertext.org>2020-02-07 18:36:18 +0100
commita979047eefec607b311773c7e2a71bb3ee2c6362 (patch)
tree97f274a45e3374872cd37792e0155cd5230b9eb8 /chart2
parentcbfa11ab8f429bf0cb279c732ec7a8dba0090104 (diff)
tdf#130380 Chart: Fix area chart data labels position
Regression from commit: f8966bb398cf0623be841c618b123866801a063c (tdf#130031 Chart OOXML import: fix area chart data label position) Change-Id: Iafcbacb0ecf6f8a175adbf0782ee3e3a1185a726 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87881 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/AreaChart.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 158d3f21bca6..f6101c15917c 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -903,7 +903,10 @@ void AreaChart::createShapes()
if (m_bArea && nLabelPlacement == css::chart::DataLabelPlacement::CENTER)
{
- fLogicY -= (fLogicY - fPreviousYValue) / 2.0;
+ if (fPreviousYValue)
+ fLogicY -= (fLogicY - fPreviousYValue) / 2.0;
+ else
+ fLogicY = (fLogicY + rPosHelper.getLogicMinY()) / 2.0;
aScenePosition = rPosHelper.transformLogicToScene(fLogicX, fLogicY, fLogicZ, false);
}