summaryrefslogtreecommitdiff
path: root/chart2/source/view/charttypes/PieChart.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/charttypes/PieChart.cxx')
-rw-r--r--chart2/source/view/charttypes/PieChart.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 2d1ebd9fc634..ae447c733a54 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -1595,7 +1595,18 @@ void PieChart::performLabelBestFit(ShapeParam& rShapeParam, PieLabelInfo const &
if( !performLabelBestFitInnerPlacement(rShapeParam, rPieLabelInfo) )
{
- // TODO
+ // If it does not fit inside, let's put it outside
+ PolarLabelPositionHelper aPolarPosHelper(m_pPosHelper.get(),m_nDimension,m_xLogicTarget,m_pShapeFactory);
+ auto eAlignment = LABEL_ALIGN_CENTER;
+ awt::Point aScreenPosition2D(
+ aPolarPosHelper.getLabelScreenPositionAndAlignmentForUnitCircleValues(eAlignment, css::chart::DataLabelPlacement::OUTSIDE
+ , rShapeParam.mfUnitCircleStartAngleDegree, rShapeParam.mfUnitCircleWidthAngleDegree
+ , rShapeParam.mfUnitCircleInnerRadius, rShapeParam.mfUnitCircleOuterRadius, rShapeParam.mfLogicZ+0.5, 0 ));
+ basegfx::B2IVector aTranslationVector = rPieLabelInfo.aFirstPosition - rPieLabelInfo.aOrigin;
+ aTranslationVector.setLength(150);
+ aScreenPosition2D.X += aTranslationVector.getX();
+ aScreenPosition2D.Y += aTranslationVector.getY();
+ rPieLabelInfo.xLabelGroupShape->setPosition(aScreenPosition2D);
}
}