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 <chartview/chartviewdllapi.hxx>
22 #include <com/sun/star/chart/TimeInterval.hpp>
23 #include <com/sun/star/chart2/AxisOrientation.hpp>
24 #include <com/sun/star/chart2/XScaling.hpp>
25 #include <tools/date.hxx>
28 namespace com::sun::star::chart2
35 /** This structure contains the explicit values for a scale like Minimum and Maximum.
36 See also css::chart2::ScaleData.
38 struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData
46 css::chart2::AxisOrientation Orientation
;
48 css::uno::Reference
<css::chart2::XScaling
> Scaling
;
50 sal_Int32 AxisType
; //see css::chart2::AxisType
51 bool m_bShiftedCategoryPosition
;
52 sal_Int32 TimeResolution
; //constant of type <type>css::chart::TimeUnit</type>
56 struct ExplicitSubIncrement
58 ExplicitSubIncrement();
60 /** Numbers of intervals between two superior ticks. For an axis
61 this usually means, that <code>IntervalCount - 1</code>
62 sub-tick-marks are displayed between two superior ticks.
65 sal_Int32 IntervalCount
;
67 /** If <TRUE/>, the distance between two sub-tick-marks on the
68 screen is always the same. If <FALSE/>, the distances may
69 differ depending on the <type>XScaling</type>.
74 /** describes how tickmarks are positioned on the scale of an axis.
76 struct OOO_DLLPUBLIC_CHARTVIEW ExplicitIncrementData
78 ExplicitIncrementData();
80 /** the following two members are only for date-time axis
82 css::chart::TimeInterval MajorTimeInterval
;
83 css::chart::TimeInterval MinorTimeInterval
;
85 /** the other members are for *not* date-time axis
88 /** <member>Distance</member> describes the distance between two
89 neighboring main tickmarks on a <type>Scale</type> of an axis.
90 All neighboring main tickmarks have the same constant distance.
92 <p>If the Scale has a <type>XScaling</type> the <member>Distance</member>
93 may be measured in two different ways - that is - before or after the
94 scaling is applied.</p>
96 <p>On a logarithmic scale for example the distance between two main
97 tickmarks is typically measured after the scaling is applied:
98 Distance = log(tick2)-log(tick1)
99 ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ).
100 The resulting tickmarks will always look equidistant on the screen.
101 The other possibility is to have a Distance = tick2-tick1 measured constant
102 before a scaling is applied, which may lead to non equidistant tickmarks
105 <p><member>PostEquidistant</member> rules whether the <member>Distance</member>
106 is meant to be a value before or after scaling.</p>
111 <member>PostEquidistant</member> rules whether the member <member>Distance</member>
112 describes a distance before or after the scaling is applied.
114 <p>If <member>PostEquidistant</member> equals <TRUE/> <member>Distance</member>
115 is given in values after <type>XScaling</type> is applied, thus resulting
116 main tickmarks will always look equidistant on the screen.
117 If <member>PostEquidistant</member> equals <FALSE/> <member>Distance</member>
118 is given in values before <type>XScaling</type> is applied.</p>
120 bool PostEquidistant
;
122 /** The <member>BaseValue</member> gives a starting point on the scale
123 to which all further main tickmarks are relatively positioned.
125 <p>The <member>BaseValue</member> is always a value on the scale before
126 a possible scaling is applied. If the given value is not valid in the
127 associated scaling the minimum of the scaling is assumed,
128 if there is no minimum any other obvious value will be assumed.</p>
130 <p>E.g.: assume a scale from 0 to 6 with identical scaling.
131 Further assume this Increment to have Distance==2 and PostEquidistant==false.
132 Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6;
133 Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3;
134 Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3;
135 And setting BaseValue to 2, -2, 4, -4 etc. in this example
136 leads to the same result as BaseValue=0.</p>
140 /** <member>SubIncrements</member> describes the positioning of further
141 sub tickmarks on the scale of an axis.
143 <p>The first SubIncrement in this sequence determines how the
144 distance between two neighboring main tickmarks is divided for positioning
145 of further sub tickmarks. Every following SubIncrement determines the
146 positions of subsequent tickmarks in relation to their parent tickmarks
147 given by the preceding SubIncrement.</p>
149 std::vector
<ExplicitSubIncrement
> SubIncrements
;
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */