summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2019-09-05 16:43:23 +0200
committerLászló Németh <nemeth@numbertext.org>2019-09-09 11:18:28 +0200
commit55136439e71b7adc62a46a3d3dc8de26d54d989d (patch)
treec00236d8dd039df54f7a75f5ac245642433ad67d /chart2
parent9670abc43051e1f7a3f2ed9369ca9a3748aa7a2b (diff)
tdf127448 Chart: Avoid distortion of charts with multilevel axis labels
and too long tickmark lines. Note: larger chart distortion is a regression from commit: 4b3a648a2fd7d733674f95bb7f20670c57e99252 (tdf#127304 Chart: fix rotation of multilevel axis labels) Change-Id: Idbcd40d93c21a685e9ad1e49eb8c088a20ecae15 Reviewed-on: https://gerrit.libreoffice.org/78662 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/axes/VCartesianAxis.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 4874f7f9575f..ce795abb17d0 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -1619,7 +1619,11 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel
if( nTextLevel>0 )
{
lcl_shiftLabels(*apTickIter, aCummulatedLabelsDistance);
- fRotationAngleDegree = 0.0;
+ //multilevel labels: 0 or 90 by default
+ if( m_aAxisProperties.m_bSwapXAndY )
+ fRotationAngleDegree = 90.0;
+ else
+ fRotationAngleDegree = 0.0;
}
aCummulatedLabelsDistance += lcl_getLabelsDistance(
*apTickIter, pTickFactory2D->getDistanceAxisTickToText(m_aAxisProperties),
@@ -1682,6 +1686,7 @@ void VCartesianAxis::createLabels()
aComplexProps.bOverlapAllowed = aComplexProps.fRotationAngleDegree != 0.0;
if( nTextLevel > 0 )
{
+ //multilevel labels: 0 or 90 by default
if( m_aAxisProperties.m_bSwapXAndY )
aComplexProps.fRotationAngleDegree = 90.0;
else
@@ -1769,7 +1774,7 @@ void VCartesianAxis::updatePositions()
double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
if( nDepth > 0 )
{
- /* Multi-level Labels: default to 0 or 90 */
+ //multilevel labels: 0 or 90 by default
if( pTickFactory2D->isHorizontalAxis() )
fRotationAngleDegree = 0.0;
else
@@ -1863,6 +1868,14 @@ void VCartesianAxis::createShapes()
if( apTickIter )
{
double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree;
+ if( nTextLevel > 0 )
+ {
+ //Multi-level Labels: default to 0 or 90
+ if( m_aAxisProperties.m_bSwapXAndY )
+ fRotationAngleDegree = 90.0;
+ else
+ fRotationAngleDegree = 0.0;
+ }
B2DVector aLabelsDistance(lcl_getLabelsDistance(
*apTickIter, pTickFactory2D->getDistanceAxisTickToText(m_aAxisProperties),
fRotationAngleDegree));