1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: AreaChart.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CHART2_AREACHART_HXX
32 #define _CHART2_AREACHART_HXX
34 #include "VSeriesPlotter.hxx"
35 #include <com/sun/star/chart2/CurveStyle.hpp>
37 //.............................................................................
40 //.............................................................................
41 class AreaPositionHelper
;
43 class AreaChart
: public VSeriesPlotter
45 //-------------------------------------------------------------------------
47 //-------------------------------------------------------------------------
49 AreaChart( const ::com::sun::star::uno::Reference
<
50 ::com::sun::star::chart2::XChartType
>& xChartTypeModel
51 , sal_Int32 nDimensionCount
52 , bool bCategoryXAxis
, bool bNoArea
=false
53 , PlottingPositionHelper
* pPlottingPositionHelper
=NULL
//takes owner ship
54 , bool bConnectLastToFirstPoint
=false
55 , bool bAddOneToXMax
=false
56 , bool bExpandIfValuesCloseToBorder
=true
57 , sal_Int32 nKeepAspectRatio
=-1 //0->no 1->yes other value->automatic
58 , const ::com::sun::star::drawing::Direction3D
& rAspectRatio
=::com::sun::star::drawing::Direction3D(1,1,1)//only taken into account if nKeepAspectRatio==1
62 //-------------------------------------------------------------------------
64 //-------------------------------------------------------------------------
66 virtual void SAL_CALL
createShapes();
68 virtual ::rtl::OUString SAL_CALL getCoordinateSystemTypeID( ) throw (::com::sun::star::uno::RuntimeException);
69 virtual void SAL_CALL setScales( const ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::ExplicitScaleData >& rScales ) throw (::com::sun::star::uno::RuntimeException);
70 virtual void SAL_CALL setTransformation( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToLogicTarget, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XTransformation >& xTransformationToFinalPage ) throw (::com::sun::star::uno::RuntimeException);
73 virtual void addSeries( VDataSeries
* pSeries
, sal_Int32 zSlot
= -1, sal_Int32 xSlot
= -1,sal_Int32 ySlot
= -1 );
76 virtual ::com::sun::star::drawing::Direction3D
getPreferredDiagramAspectRatio() const;
77 virtual bool keepAspectRatio() const;
79 //-------------------------------------------------------------------------
80 // MinimumAndMaximumSupplier
81 //-------------------------------------------------------------------------
82 virtual double getMaximumX();
83 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex
);
84 virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex
);
86 //-------------------------------------------------------------------------
88 virtual ::com::sun::star::chart2::LegendSymbolStyle
getLegendSymbolStyle();
89 virtual ::com::sun::star::uno::Any
getExplicitSymbol( const VDataSeries
& rSeries
, sal_Int32 nPointIndex
=-1/*-1 for series symbol*/ );
91 //-------------------------------------------------------------------------
92 //-------------------------------------------------------------------------
93 //-------------------------------------------------------------------------
95 //no default constructor
98 void impl_createSeriesShapes();
99 bool impl_createArea( VDataSeries
* pSeries
100 , ::com::sun::star::drawing::PolyPolygonShape3D
* pSeriesPoly
101 , ::com::sun::star::drawing::PolyPolygonShape3D
* pPreviousSeriesPoly
102 , PlottingPositionHelper
* pPosHelper
);
103 bool impl_createLine( VDataSeries
* pSeries
104 , ::com::sun::star::drawing::PolyPolygonShape3D
* pSeriesPoly
105 , PlottingPositionHelper
* pPosHelper
);
108 PlottingPositionHelper
* m_pMainPosHelper
;
110 bool m_bArea
;//false -> line or symbol only
113 bool m_bIsPolarCooSys
;//used e.g. for net chart (the data labels need to be placed different)
114 bool m_bConnectLastToFirstPoint
;//used e.g. for net chart
115 bool m_bAddOneToXMax
;//used e.g. for net chart (the angle axis needs a different autoscaling)
116 bool m_bExpandIfValuesCloseToBorder
; // e.g. false for net charts
118 sal_Int32 m_nKeepAspectRatio
; //0->no 1->yes other value->automatic
119 ::com::sun::star::drawing::Direction3D m_aGivenAspectRatio
; //only used if nKeepAspectRatio==1
121 //Properties for splines:
122 ::com::sun::star::chart2::CurveStyle m_eCurveStyle
;
123 sal_Int32 m_nCurveResolution
;
124 sal_Int32 m_nSplineOrder
;
126 ::com::sun::star::uno::Reference
<
127 ::com::sun::star::drawing::XShapes
> m_xSeriesTarget
;
128 ::com::sun::star::uno::Reference
<
129 ::com::sun::star::drawing::XShapes
> m_xErrorBarTarget
;
130 ::com::sun::star::uno::Reference
<
131 ::com::sun::star::drawing::XShapes
> m_xTextTarget
;
132 ::com::sun::star::uno::Reference
<
133 ::com::sun::star::drawing::XShapes
> m_xRegressionCurveEquationTarget
;
135 //.............................................................................
137 //.............................................................................