From edaa216847e59ad93b8b99e95f293f8bb04344cc Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Tue, 30 Nov 2010 01:45:03 +0100 Subject: chart46: #i25706# implement date axis --- .../source/inc/chartview/ExplicitScaleValues.hxx | 165 +++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 chart2/source/inc/chartview/ExplicitScaleValues.hxx (limited to 'chart2/source/inc/chartview/ExplicitScaleValues.hxx') diff --git a/chart2/source/inc/chartview/ExplicitScaleValues.hxx b/chart2/source/inc/chartview/ExplicitScaleValues.hxx new file mode 100644 index 000000000000..a2902391b6c2 --- /dev/null +++ b/chart2/source/inc/chartview/ExplicitScaleValues.hxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _CHART2_EXPLICITSCALEVALUES_HXX +#define _CHART2_EXPLICITSCALEVALUES_HXX + +#include "chartviewdllapi.hxx" +#include +#include +#include +#include +#include +#include +#include +//............................................................................. +namespace chart +{ +//............................................................................. + +//----------------------------------------------------------------------------- +/** This structure contains the explicit values for a scale like Minimum and Maximum. + See also ::com::sun::star::chart2::ScaleData. +*/ + +struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData +{ + ExplicitScaleData(); + + double Minimum; + double Maximum; + double Origin; + + ::com::sun::star::chart2::AxisOrientation Orientation; + + ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > Scaling; + + long AxisType;//see ::com::sun::star::chart2::AxisType + bool ShiftedCategoryPosition; + long TimeResolution; //constant of type ::com::sun::star::chart::TimeUnit + Date NullDate; +}; + +struct OOO_DLLPUBLIC_CHARTVIEW ExplicitSubIncrement +{ + ExplicitSubIncrement(); + + /** Numbers of intervals between two superior ticks. For an axis + this usually means, that IntervalCount - 1 + sub-tick-marks are displayed between two superior ticks. + + */ + long IntervalCount; + + /** If , the distance between two sub-tick-marks on the + screen is always the same. If , the distances may + differ depending on the XScaling. + */ + bool PostEquidistant; +}; + +/** describes how tickmarks are positioned on the scale of an axis. +*/ +struct OOO_DLLPUBLIC_CHARTVIEW ExplicitIncrementData +{ + ExplicitIncrementData(); + + /** the following two members are only for date-time axis + */ + ::com::sun::star::chart::TimeInterval MajorTimeInterval; + ::com::sun::star::chart::TimeInterval MinorTimeInterval; + + /** the other members are for *not* date-time axis + */ + + /** Distance describes the distance between two + neighboring main tickmarks on a Scale of an axis. + All neighboring main tickmarks have the same constant distance. + +

If the Scale has a XScaling the Distance + may be measured in two different ways - that is - before or after the + scaling is applied.

+ +

On a logarithmic scale for example the distance between two main + tickmarks is typically measured after the scaling is applied: + Distance = log(tick2)-log(tick1) + ( log(1000)-log(100)==log(100)-log(10)==log(10)-log(1)==1==Distance ). + The resulting tickmarks will always look equidistant on the screen. + The other possibility is to have a Distance = tick2-tick1 measured constant + before a scaling is applied, which may lead to non equidistant tickmarks + on the screen.

+ +

PostEquidistant rules wether the Distance + is meant to be a value before or after scaling.

+ */ + double Distance; + + /** + PostEquidistant rules wether the member Distance + describes a distance before or after the scaling is applied. + +

If PostEquidistant equals Distance + is given in values after XScaling is applied, thus resulting + main tickmarks will always look equidistant on the screen. + If PostEquidistant equals Distance + is given in values before XScaling is applied.

+ */ + bool PostEquidistant; + + /** The BaseValue gives a starting point on the scale + to which all further main tickmarks are relatively positioned. + +

The BaseValue is always a value on the scale before + a possible scaling is applied. If the given value is not valid in the + associated scaling the minimum of the scaling is assumed, + if there is no minimum any other obvious value will be assumed.

+ +

E.g.: assume a scale from 0 to 6 with identical scaling. + Further assume this Increment to have Distance==2 and PostEquidistant==false. + Setting BaseValue=0 would lead to main tickmarks 0; 2; 4; 6; + Setting BaseValue=1,3 would lead to main tickmarks 1,3; 3,3; 5,3; + Setting BaseValue=-0,7 would also lead to main tickmarks 1,3; 3,3; 5,3; + And setting BaseValue to 2, -2, 4, -4 etc. in this example + leads to the same result as BaseValue=0.

+ */ + double BaseValue; + + /** SubIncrements describes the positioning of further + sub tickmarks on the scale of an axis. + +

The first SubIncrement in this sequence determines how the + distance between two neighboring main tickmarks is divided for positioning + of further sub tickmarks. Every following SubIncrement determines the + positions of subsequent tickmarks in relation to their parent tickmarks + iven by the preceding SubIncrement.

+ */ + ::std::vector< ExplicitSubIncrement > SubIncrements; +}; + +//............................................................................. +} //namespace chart +//............................................................................. +#endif -- cgit From c8b75257f0fe4a6f13922a9cbd78acf0e72d7e91 Mon Sep 17 00:00:00 2001 From: "Ingrid Halama [iha]" Date: Wed, 8 Dec 2010 09:57:08 +0100 Subject: chart46: #i25706# implement date axis - compiler warnings --- chart2/source/inc/chartview/ExplicitScaleValues.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'chart2/source/inc/chartview/ExplicitScaleValues.hxx') diff --git a/chart2/source/inc/chartview/ExplicitScaleValues.hxx b/chart2/source/inc/chartview/ExplicitScaleValues.hxx index a2902391b6c2..48c9ef942d03 100644 --- a/chart2/source/inc/chartview/ExplicitScaleValues.hxx +++ b/chart2/source/inc/chartview/ExplicitScaleValues.hxx @@ -57,10 +57,10 @@ struct OOO_DLLPUBLIC_CHARTVIEW ExplicitScaleData ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling > Scaling; - long AxisType;//see ::com::sun::star::chart2::AxisType - bool ShiftedCategoryPosition; - long TimeResolution; //constant of type ::com::sun::star::chart::TimeUnit - Date NullDate; + sal_Int32 AxisType;//see ::com::sun::star::chart2::AxisType + bool ShiftedCategoryPosition; + sal_Int32 TimeResolution; //constant of type ::com::sun::star::chart::TimeUnit + Date NullDate; }; struct OOO_DLLPUBLIC_CHARTVIEW ExplicitSubIncrement @@ -72,13 +72,13 @@ struct OOO_DLLPUBLIC_CHARTVIEW ExplicitSubIncrement sub-tick-marks are displayed between two superior ticks. */ - long IntervalCount; + sal_Int32 IntervalCount; /** If , the distance between two sub-tick-marks on the screen is always the same. If , the distances may differ depending on the XScaling. */ - bool PostEquidistant; + bool PostEquidistant; }; /** describes how tickmarks are positioned on the scale of an axis. -- cgit