1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "VAxisOrGridBase.hxx"
22 #include "VAxisProperties.hxx"
23 #include "Tickmarks.hxx"
25 namespace com::sun::star::util
{ class XNumberFormatsSupplier
; }
26 namespace com::sun::star::uno
{ class XComponentContext
; }
34 class LegendEntryProvider
;
36 class VAxisBase
: public VAxisOrGridBase
39 VAxisBase( sal_Int32 nDimensionIndex
, sal_Int32 nDimensionCount
40 , const AxisProperties
& rAxisProperties
41 , const css::uno::Reference
< css::util::XNumberFormatsSupplier
>& xNumberFormatsSupplier
);
42 virtual ~VAxisBase() override
;
45 * Return the number of dimensions the diagram has. 2 for x and y, and 3
48 sal_Int32
getDimensionCount() const;
50 virtual void createMaximumLabels()=0;
51 virtual void createLabels()=0;
52 virtual void updatePositions()=0;
54 virtual bool isAnythingToDraw();
55 virtual void initAxisLabelProperties(
56 const css::awt::Size
& rFontReferenceSize
57 , const css::awt::Rectangle
& rMaximumSpaceForLabels
);
59 virtual void setExplicitScaleAndIncrement(
60 const ExplicitScaleData
& rScale
61 , const ExplicitIncrementData
& rIncrement
) override
;
63 virtual sal_Int32
estimateMaximumAutoMainIncrementCount();
64 virtual void createAllTickInfos( TickInfoArraysType
& rAllTickInfos
);
66 void setExtraLinePositionAtOtherAxis( double fCrossingAt
);
68 virtual void createDataTableView(std::vector
<std::unique_ptr
<VSeriesPlotter
>>& rSeriesPlotterList
,
69 css::uno::Reference
<css::util::XNumberFormatsSupplier
> const& xNumberFormatsSupplier
,
70 rtl::Reference
<::chart::ChartModel
> const& xChartDoc
,
71 css::uno::Reference
<css::uno::XComponentContext
> const& rComponentContext
);
73 const std::shared_ptr
<DataTableView
> & getDataTableView() { return m_pDataTableView
; }
76 static size_t getIndexOfLongestLabel( const css::uno::Sequence
<OUString
>& rLabels
);
77 void removeTextShapesFromTicks();
78 void updateUnscaledValuesAtTicks( TickIter
& rIter
);
80 virtual bool prepareShapeCreation();
81 void recordMaximumTextSize( SvxShape
& xShape
, double fRotationAngleDegree
);
83 bool isDateAxis() const;
84 bool isComplexCategoryAxis() const;
87 css::uno::Reference
< css::util::XNumberFormatsSupplier
> m_xNumberFormatsSupplier
;
88 AxisProperties m_aAxisProperties
;
89 AxisLabelProperties m_aAxisLabelProperties
;
90 css::uno::Sequence
< OUString
> m_aTextLabels
;
91 bool m_bUseTextLabels
;
93 rtl::Reference
< SvxShapeGroupAnyD
> m_xGroupShape_Shapes
;
94 rtl::Reference
< SvxShapeGroupAnyD
> m_xTextTarget
;
95 rtl::Reference
< SvxShapeGroupAnyD
> m_xDataTableTarget
;
97 std::shared_ptr
<DataTableView
> m_pDataTableView
;
100 * This typically consists of 2 TickInfo vectors (i.e. the outer vector
101 * has 2 child vector elements) for normal axis. The first vector
102 * corresponds with the major ticks while the second corresponds with the
105 * It may have more than 2 TickInfo vectors for complex category axis
106 * which has multi-level axis labels.
108 TickInfoArraysType m_aAllTickInfos
;
109 bool m_bReCreateAllTickInfos
;
111 bool m_bRecordMaximumTextSize
;
112 sal_Int32 m_nMaximumTextWidthSoFar
;
113 sal_Int32 m_nMaximumTextHeightSoFar
;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */