summaryrefslogtreecommitdiff
path: root/chart2/source/view/charttypes/VSeriesPlotter.cxx
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2020-01-15 16:31:35 +0100
committerLászló Németh <nemeth@numbertext.org>2020-01-30 10:43:02 +0100
commit4223ff2be69f03e571464b0b09ad0d278918631b (patch)
tree7205f05cf9773f53f0ad4433703055794eb3f997 /chart2/source/view/charttypes/VSeriesPlotter.cxx
parente265037d6c655675416116b19882c3c29bb7bf40 (diff)
tdf#48436 Chart: add CustomLabelPosition UNO API property
and CUSTOM DataLabelPlacement to support custom data label positions, and its initial implementation: only UI support with OOXML import (tdf#130030), yet. Change-Id: I01d986071d78ae3e2a5f43d5711e9f60b8410c21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86859 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/source/view/charttypes/VSeriesPlotter.cxx')
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index f7e828425246..b6382943b418 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -707,7 +707,6 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
// in case text is rotated, the transformation property of the text
// shape is modified.
- const awt::Point aUnrotatedTextPos( xTextShape->getPosition() );
if( fRotationDegrees != 0.0 )
{
const double fDegreesPi( -basegfx::deg2rad(fRotationDegrees) );
@@ -717,8 +716,17 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re
LabelPositionHelper::correctPositionForRotation( xTextShape, eAlignment, fRotationDegrees, true /*bRotateAroundCenter*/ );
}
+ awt::Point aTextShapePos(xTextShape->getPosition());
+ if( rDataSeries.isLabelCustomPos(nPointIndex) )
+ {
+ awt::Point aRelPos = rDataSeries.getLabelPosition(aTextShapePos, nPointIndex);
+ if( aRelPos.X != -1 )
+ xTextShape->setPosition(aRelPos);
+ }
+
// in case legend symbol has to be displayed, text shape position is
// slightly changed.
+ const awt::Point aUnrotatedTextPos(xTextShape->getPosition());
if( xSymbol.is() )
{
const awt::Point aOldTextPos( xTextShape->getPosition() );