LibreOffice Module chart2 (master) 1
VAxisBase.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include "VAxisOrGridBase.hxx"
22#include "VAxisProperties.hxx"
23#include "Tickmarks.hxx"
24
25namespace com::sun::star::util { class XNumberFormatsSupplier; }
26namespace com::sun::star::uno { class XComponentContext; }
27
28namespace chart
29{
30
31class VSeriesPlotter;
32class DataTableView;
33class ChartModel;
34class LegendEntryProvider;
35
37{
38public:
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;
43
48 sal_Int32 getDimensionCount() const;
49
50 virtual void createMaximumLabels()=0;
51 virtual void createLabels()=0;
52 virtual void updatePositions()=0;
53
54 virtual bool isAnythingToDraw();
55 virtual void initAxisLabelProperties(
56 const css::awt::Size& rFontReferenceSize
57 , const css::awt::Rectangle& rMaximumSpaceForLabels );
58
60 const ExplicitScaleData& rScale
61 , const ExplicitIncrementData& rIncrement ) override;
62
63 virtual sal_Int32 estimateMaximumAutoMainIncrementCount();
64 virtual void createAllTickInfos( TickInfoArraysType& rAllTickInfos );
65
66 void setExtraLinePositionAtOtherAxis( double fCrossingAt );
67
68 virtual void createDataTableView(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
69 css::uno::Reference<css::util::XNumberFormatsSupplier> const& xNumberFormatsSupplier,
71 css::uno::Reference<css::uno::XComponentContext> const& rComponentContext);
72
73 std::shared_ptr<DataTableView> getDataTableView() { return m_pDataTableView; }
74
75protected: //methods
76 static size_t getIndexOfLongestLabel( const css::uno::Sequence<OUString>& rLabels );
79
80 virtual bool prepareShapeCreation();
81 void recordMaximumTextSize( SvxShape& xShape, double fRotationAngleDegree );
82
83 bool isDateAxis() const;
84 bool isComplexCategoryAxis() const;
85
86protected: //member
87 css::uno::Reference< css::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier;
90 css::uno::Sequence< OUString > m_aTextLabels;
92
96
97 std::shared_ptr<DataTableView> m_pDataTableView;
98
110
114};
115
116} //namespace chart
117
118/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static size_t getIndexOfLongestLabel(const css::uno::Sequence< OUString > &rLabels)
Definition: VAxisBase.cxx:195
virtual void createLabels()=0
std::shared_ptr< DataTableView > m_pDataTableView
Definition: VAxisBase.hxx:97
AxisLabelProperties m_aAxisLabelProperties
Definition: VAxisBase.hxx:89
virtual sal_Int32 estimateMaximumAutoMainIncrementCount()
Definition: VAxisBase.cxx:114
bool isDateAxis() const
Definition: VAxisBase.cxx:93
virtual void initAxisLabelProperties(const css::awt::Size &rFontReferenceSize, const css::awt::Rectangle &rMaximumSpaceForLabels)
Definition: VAxisBase.cxx:57
virtual void setExplicitScaleAndIncrement(const ExplicitScaleData &rScale, const ExplicitIncrementData &rIncrement) override
Definition: VAxisBase.cxx:148
virtual void createDataTableView(std::vector< std::unique_ptr< VSeriesPlotter > > &rSeriesPlotterList, css::uno::Reference< css::util::XNumberFormatsSupplier > const &xNumberFormatsSupplier, rtl::Reference<::chart::ChartModel > const &xChartDoc, css::uno::Reference< css::uno::XComponentContext > const &rComponentContext)
Definition: VAxisBase.cxx:245
sal_Int32 m_nMaximumTextWidthSoFar
Definition: VAxisBase.hxx:112
AxisProperties m_aAxisProperties
Definition: VAxisBase.hxx:88
css::uno::Sequence< OUString > m_aTextLabels
Definition: VAxisBase.hxx:90
VAxisBase(sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount, const AxisProperties &rAxisProperties, const css::uno::Reference< css::util::XNumberFormatsSupplier > &xNumberFormatsSupplier)
Definition: VAxisBase.cxx:39
rtl::Reference< SvxShapeGroupAnyD > m_xDataTableTarget
Definition: VAxisBase.hxx:95
virtual ~VAxisBase() override
Definition: VAxisBase.cxx:53
virtual bool prepareShapeCreation()
Definition: VAxisBase.cxx:166
void recordMaximumTextSize(SvxShape &xShape, double fRotationAngleDegree)
Definition: VAxisBase.cxx:102
css::uno::Reference< css::util::XNumberFormatsSupplier > m_xNumberFormatsSupplier
Definition: VAxisBase.hxx:87
void removeTextShapesFromTicks()
Definition: VAxisBase.cxx:214
bool m_bRecordMaximumTextSize
Definition: VAxisBase.hxx:111
bool isComplexCategoryAxis() const
Definition: VAxisBase.cxx:97
void updateUnscaledValuesAtTicks(TickIter &rIter)
Definition: VAxisBase.cxx:232
rtl::Reference< SvxShapeGroupAnyD > m_xTextTarget
Definition: VAxisBase.hxx:94
sal_Int32 getDimensionCount() const
Return the number of dimensions the diagram has.
Definition: VAxisBase.cxx:124
std::shared_ptr< DataTableView > getDataTableView()
Definition: VAxisBase.hxx:73
rtl::Reference< SvxShapeGroupAnyD > m_xGroupShape_Shapes
Definition: VAxisBase.hxx:93
virtual void createMaximumLabels()=0
sal_Int32 m_nMaximumTextHeightSoFar
Definition: VAxisBase.hxx:113
virtual bool isAnythingToDraw()
Definition: VAxisBase.cxx:129
virtual void updatePositions()=0
virtual void createAllTickInfos(TickInfoArraysType &rAllTickInfos)
Definition: VAxisBase.cxx:157
TickInfoArraysType m_aAllTickInfos
This typically consists of 2 TickInfo vectors (i.e.
Definition: VAxisBase.hxx:108
bool m_bReCreateAllTickInfos
Definition: VAxisBase.hxx:109
void setExtraLinePositionAtOtherAxis(double fCrossingAt)
Definition: VAxisBase.cxx:119
std::vector< TickInfoArrayType > TickInfoArraysType
Definition: Tickmarks.hxx:59
describes how tickmarks are positioned on the scale of an axis.
This structure contains the explicit values for a scale like Minimum and Maximum.