From addcd016bf1bed16299697fd18b8f9b1faf2cf3f Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 13 Aug 2022 14:14:00 +0200 Subject: chart2: support data table rendering when the X axis is swapped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- chart2/source/view/axes/VAxisProperties.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'chart2/source/view/axes/VAxisProperties.cxx') 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() -- cgit