27#include <com/sun/star/beans/XPropertySet.hpp>
28#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp>
29#include <com/sun/star/chart2/AxisType.hpp>
32#include <rtl/math.hxx>
41 mfLabelDirection(1.0),
42 mfInnerTickDirection(1.0),
48 double fPercent = 1.0;
66 return static_cast<sal_Int32
>(nWidth*fPercent);
71 double fPercent = 0.0;
82 switch(nTickmarkStyle)
98 sal_Int32 nDepth )
const
106 sal_Int32 nTickmarkStyle = 1;
124 if( nTickmarkStyle != 0 )
132 return aTickmarkProperties;
136 sal_Int32 nTickLength, sal_Int32 nTickStartDistanceToAxis )
const
141 aTickmarkProperties.
Length = nTickLength;
144 return aTickmarkProperties;
150 sal_Int32 nTickmarkStyle = 3;
153 return aTickmarkProperties;
159 : m_xAxisModel(
std::move(xAxisModel))
161 , m_bIsMainAxis(true)
162 , m_bSwapXAndY(false)
163 , m_eCrossoverType( css::
chart::ChartAxisPosition_ZERO )
164 , m_eLabelPos( css::
chart::ChartAxisLabelPosition_NEAR_AXIS )
165 , m_eTickmarkPos( css::
chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS )
166 , m_bCrossingAxisHasReverseDirection(false)
167 , m_bCrossingAxisIsCategoryAxes(false)
168 , m_bDisplayDataTable(false)
169 , m_bDataTableAlignAxisValuesWithColumns(false)
170 , m_bDisplayLabels( true )
171 , m_bTryStaggeringFirst( false )
172 , m_nNumberFormatKey(0)
173 , m_nMajorTickmarks(1)
174 , m_nMinorTickmarks(1)
176 , m_bComplexCategories(false)
177 , m_pExplicitCategoriesProvider(pExplicitCategoriesProvider)
178 , m_bLimitSpaceForLabels(false)
179 , m_xDataTableModel(xDataTableModel)
209 if( !xAxisProp.is() )
219 xAxisProp->getPropertyValue(
"CrossoverValue") >>= fValue;
222 fValue = ::rtl::math::round(fValue);
228 xAxisProp->getPropertyValue(
"LabelPosition") >>=
m_eLabelPos;
236 m_eLabelPos = css::chart::ChartAxisLabelPosition_NEAR_AXIS;
240 catch(
const uno::Exception& )
275 if(
m_eLabelPos == css::chart::ChartAxisLabelPosition_NEAR_AXIS )
277 else if(
m_eLabelPos == css::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE )
279 else if(
m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_START )
281 else if(
m_eLabelPos == css::chart::ChartAxisLabelPosition_OUTSIDE_END )
290 if( bIsYAxisPosition )
319 sal_Int32 nMaxDepth = 0;
326 for( sal_Int32 nDepth=0; nDepth<nMaxDepth; nDepth++ )
332 catch(
const uno::Exception& )
351 , m_aMaximumSpaceForLabels( 0 , 0, m_aFontReferenceSize.
Width, m_aFontReferenceSize.
Height )
352 , m_nNumberFormatKey(0)
354 , m_bLineBreakAllowed( false )
355 , m_bOverlapAllowed( false )
356 , m_bStackCharacters( false )
357 , m_fRotationAngleDegree( 0.0 )
375 css::chart::ChartAxisArrangeOrderType eArrangeOrder;
376 xAxisModel->getPropertyValue(
"ArrangeOrder" ) >>= eArrangeOrder;
377 switch(eArrangeOrder)
379 case css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE:
382 case css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN:
385 case css::chart::ChartAxisArrangeOrderType_STAGGER_ODD:
393 catch(
const uno::Exception& )
sal_Int32 m_nDimensionIndex
static void checkDateAxis(css::chart2::ScaleData &rScale, ExplicitCategoriesProvider *pExplicitCategoriesProvider, bool bChartTypeAllowsDateAxis)
static bool isAxisPositioningEnabled()
bool hasComplexCategories() const
#define TOOLS_WARN_EXCEPTION(area, stream)
static sal_Int32 lcl_calcTickLengthForDepth(sal_Int32 nDepth, sal_Int32 nTickmarkStyle)
static LabelAlignment lcl_getLabelAlignmentForZAxis(const AxisProperties &rAxisProperties)
const sal_Int32 AXIS2D_TICKLENGTH
static double lcl_getTickOffset(sal_Int32 nLength, sal_Int32 nTickmarkStyle)
static LabelAlignment lcl_getLabelAlignmentForYAxis(const AxisProperties &rAxisProperties)
static LabelAlignment lcl_getLabelAlignmentForXAxis(const AxisProperties &rAxisProperties)
double mfInnerTickDirection
which direction the labels are to be drawn.
LabelAlignment meAlignment
which direction the inner tickmarks are to be drawn.
AxisLabelStaggering m_eStaggering
void init(const rtl::Reference< ::chart::Axis > &xAxisModel)
double m_fRotationAngleDegree
const VLineProperties & makeLinePropertiesForDepth() const
bool m_bDataTableAlignAxisValuesWithColumns
std::optional< double > m_pfMainLinePositionAtOtherAxis
static TickmarkProperties getBiggestTickmarkProperties()
VLineProperties m_aLineProperties
void init(bool bCartesian=false)
bool m_bCrossingAxisHasReverseDirection
sal_Int32 m_nMajorTickmarks
bool m_bComplexCategories
AxisLabelAlignment maLabelAlignment
ExplicitCategoriesProvider * m_pExplicitCategoriesProvider
bool m_bTryStaggeringFirst
TickmarkProperties makeTickmarkPropertiesForComplexCategories(sal_Int32 nTickLength, sal_Int32 nTickStartDistanceToAxis) const
css::chart::ChartAxisMarkPosition m_eTickmarkPos
sal_Int32 m_nDimensionIndex
void initAxisPositioning(const css::uno::Reference< css::beans::XPropertySet > &xAxisProp)
rtl::Reference<::chart::Axis > m_xAxisModel
TickmarkProperties makeTickmarkProperties(sal_Int32 nDepth) const
std::vector< TickmarkProperties > m_aTickmarkPropertiesList
css::chart::ChartAxisLabelPosition m_eLabelPos
css::chart::ChartAxisPosition m_eCrossoverType
rtl::Reference<::chart::DataTable > m_xDataTableModel
sal_Int32 m_nMinorTickmarks
bool m_bCrossingAxisIsCategoryAxes
VLineProperties aLineProperties
void initFromPropertySet(const css::uno::Reference< css::beans::XPropertySet > &xProp)