1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _CHART2_BARCHART_HXX
25 #define _CHART2_BARCHART_HXX
26 
27 #include "VSeriesPlotter.hxx"
28 
29 //.............................................................................
30 namespace chart
31 {
32 //.............................................................................
33 class BarPositionHelper;
34 
35 class BarChart : public VSeriesPlotter
36 {
37 	//-------------------------------------------------------------------------
38 	// public methods
39 	//-------------------------------------------------------------------------
40 public:
41 	BarChart( const ::com::sun::star::uno::Reference<
42             ::com::sun::star::chart2::XChartType >& xChartTypeModel
43             , sal_Int32 nDimensionCount );
44 	virtual ~BarChart();
45 
46 	virtual void createShapes();
47     virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
48 
49     //-------------------
50     virtual ::com::sun::star::drawing::Direction3D  getPreferredDiagramAspectRatio() const;
51     virtual bool keepAspectRatio() const;
52 
53     //-------------------------------------------------------------------------
54     //-------------------------------------------------------------------------
55     //-------------------------------------------------------------------------
56 
57 private: //methods
58 	//no default constructor
59 	BarChart();
60 
61     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
62         createDataPoint3D_Bar(
63                           const ::com::sun::star::uno::Reference<
64                                 ::com::sun::star::drawing::XShapes >& xTarget
65                         , const ::com::sun::star::drawing::Position3D& rPosition
66                         , const ::com::sun::star::drawing::Direction3D& rSize
67                         , double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree
68                         , const ::com::sun::star::uno::Reference<
69                                 ::com::sun::star::beans::XPropertySet >& xObjectProperties
70                         , sal_Int32 nGeometry3D );
71 
72     ::com::sun::star::awt::Point getLabelScreenPositionAndAlignment(
73                         LabelAlignment& rAlignment, sal_Int32 nLabelPlacement
74                         , double fScaledX, double fScaledLowerYValue, double fScaledUpperYValue, double fScaledZ
75                         , double fScaledLowerBarDepth, double fScaledUpperBarDepth, double fBaseValue
76                         , BarPositionHelper* pPosHelper ) const;
77 
78     virtual PlottingPositionHelper& getPlottingPositionHelper( sal_Int32 nAxisIndex ) const;//nAxisIndex indicates wether the position belongs to the main axis ( nAxisIndex==0 ) or secondary axis ( nAxisIndex==1 )
79 
80     void adaptOverlapAndGapwidthForGroupBarsPerAxis();
81 
82 private: //member
83     BarPositionHelper*                   m_pMainPosHelper;
84     ::com::sun::star::uno::Sequence< sal_Int32 > m_aOverlapSequence;
85     ::com::sun::star::uno::Sequence< sal_Int32 > m_aGapwidthSequence;
86 };
87 //.............................................................................
88 } //namespace chart
89 //.............................................................................
90 #endif
91