diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2019-05-21 10:18:26 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-05-22 08:09:53 +0200 |
commit | 729c8d135b6b958e6d2cd87ee72166ecdb0afbfc (patch) | |
tree | 062c20e014fb58d2d92ccf7bf05b0820869d8bc2 /chart2 | |
parent | 2d3a907973d04f0b8368a132d262e0318c4445dc (diff) |
tdf#125335 fix order of bar chart legend names in top-bottom positions
by considering the axis direction.
Note: Legend name order in left/right position was fixed in
commit 40144617ce05d7eff86eeb8a412c6991fe0b819e
Change-Id: Id5bd585a666c3bcf346af5317e9197e6460f932a
Reviewed-on: https://gerrit.libreoffice.org/72670
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/VSeriesPlotter.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 17f044654535..350254c14764 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -2402,7 +2402,7 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries( // add entries reverse if chart is stacked in y-direction and the legend is not wide. // If the legend is wide and we have a stacked bar-chart the normal order - // is the correct one + // is the correct one, unless the chart type is horizontal bar-chart. bool bReverse = false; if( eLegendExpansion != css::chart::ChartLegendExpansion_WIDE ) { @@ -2414,6 +2414,11 @@ std::vector< ViewLegendEntry > VSeriesPlotter::createLegendEntries( bReverse = !bReverse; } } + else if( bSwapXAndY ) + { + StackingDirection eStackingDirection( pSeries->getStackingDirection() ); + bReverse = ( eStackingDirection != StackingDirection_Y_STACKING ); + } if (bReverse) aResult.insert( aResult.begin(), aSeriesEntries.begin(), aSeriesEntries.end() ); |