summaryrefslogtreecommitdiff
path: root/chart2/source/view/axes/VAxisProperties.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-08-13 14:14:00 +0200
committerTomaž Vajngerl <quikee@gmail.com>2022-08-16 16:40:39 +0200
commitaddcd016bf1bed16299697fd18b8f9b1faf2cf3f (patch)
tree70c6589e97157cd0dc1924bce962ff1f0b0dac33 /chart2/source/view/axes/VAxisProperties.cxx
parent089f7b437326021beb0f61a05bdd180f1de8bb59 (diff)
chart2: support data table rendering when the X axis is swapped
In case when the X axis is swapped, so the Y axis is rendered in the place of X axis, we need to render the data table below the Y-axis labels. This is best done to put the data table into the Y-axis instead, so we get the correct size and position of the data table, and then just allow rendering of the axis labels and (re)position the table below Y-axis. Change-Id: I74aa79402a5638133b0d1ed83bbd8aad6f6c9d1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138336 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/source/view/axes/VAxisProperties.cxx')
-rw-r--r--chart2/source/view/axes/VAxisProperties.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx
index f39420c9ce02..da038d27471c 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -257,7 +257,7 @@ void AxisProperties::init( bool bCartesian )
if( bCartesian )
{
- if (m_nDimensionIndex == 0)
+ if ((!m_bSwapXAndY && m_nDimensionIndex == 0) || (m_bSwapXAndY && m_nDimensionIndex == 1))
{
m_bDisplayDataTable = m_xDataTableModel.is();
}
@@ -332,6 +332,17 @@ void AxisProperties::init( bool bCartesian )
{
TOOLS_WARN_EXCEPTION("chart2", "" );
}
+
+ if (m_bDisplayDataTable)
+ {
+ m_bDataTableAlignAxisValuesWithColumns = (m_nDimensionIndex == 0);
+
+ if (m_nDimensionIndex == 0)
+ {
+ m_bDisplayLabels = false;
+ }
+
+ }
}
AxisLabelProperties::AxisLabelProperties()