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 .
20 #ifndef _CHART2_AREACHART_HXX
21 #define _CHART2_AREACHART_HXX
23 #include "VSeriesPlotter.hxx"
24 #include <com/sun/star/chart2/CurveStyle.hpp>
26 //.............................................................................
29 //.............................................................................
31 class AreaChart
: public VSeriesPlotter
33 //-------------------------------------------------------------------------
35 //-------------------------------------------------------------------------
37 AreaChart( const ::com::sun::star::uno::Reference
<
38 ::com::sun::star::chart2::XChartType
>& xChartTypeModel
39 , sal_Int32 nDimensionCount
40 , bool bCategoryXAxis
, bool bNoArea
=false
41 , PlottingPositionHelper
* pPlottingPositionHelper
=NULL
//takes owner ship
42 , bool bConnectLastToFirstPoint
=false
43 , bool bExpandIfValuesCloseToBorder
=true
44 , sal_Int32 nKeepAspectRatio
=-1 //0->no 1->yes other value->automatic
45 , const ::com::sun::star::drawing::Direction3D
& rAspectRatio
=::com::sun::star::drawing::Direction3D(1,1,1)//only taken into account if nKeepAspectRatio==1
49 virtual void createShapes();
50 virtual void addSeries( VDataSeries
* pSeries
, sal_Int32 zSlot
= -1, sal_Int32 xSlot
= -1,sal_Int32 ySlot
= -1 );
53 virtual ::com::sun::star::drawing::Direction3D
getPreferredDiagramAspectRatio() const;
54 virtual bool keepAspectRatio() const;
56 //-------------------------------------------------------------------------
57 // MinimumAndMaximumSupplier
58 //-------------------------------------------------------------------------
59 virtual double getMaximumX();
60 virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex
);
61 virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex
);
63 //-------------------------------------------------------------------------
65 virtual LegendSymbolStyle
getLegendSymbolStyle();
66 virtual ::com::sun::star::uno::Any
getExplicitSymbol( const VDataSeries
& rSeries
, sal_Int32 nPointIndex
=-1/*-1 for series symbol*/ );
68 //-------------------------------------------------------------------------
69 //-------------------------------------------------------------------------
70 //-------------------------------------------------------------------------
72 //no default constructor
75 void impl_createSeriesShapes();
76 bool impl_createArea( VDataSeries
* pSeries
77 , ::com::sun::star::drawing::PolyPolygonShape3D
* pSeriesPoly
78 , ::com::sun::star::drawing::PolyPolygonShape3D
* pPreviousSeriesPoly
79 , PlottingPositionHelper
* pPosHelper
);
80 bool impl_createLine( VDataSeries
* pSeries
81 , ::com::sun::star::drawing::PolyPolygonShape3D
* pSeriesPoly
82 , PlottingPositionHelper
* pPosHelper
);
83 bool create_stepped_line( ::com::sun::star::drawing::PolyPolygonShape3D aStartPoly
84 , ::com::sun::star::chart2::CurveStyle eCurveStyle
85 , PlottingPositionHelper
* pPosHelper
86 , ::com::sun::star::drawing::PolyPolygonShape3D
&aPoly
);
89 PlottingPositionHelper
* m_pMainPosHelper
;
91 bool m_bArea
;//false -> line or symbol only
94 bool m_bIsPolarCooSys
;//used e.g. for net chart (the data labels need to be placed different)
95 bool m_bConnectLastToFirstPoint
;//used e.g. for net chart
96 bool m_bExpandIfValuesCloseToBorder
; // e.g. false for net charts
98 sal_Int32 m_nKeepAspectRatio
; //0->no 1->yes other value->automatic
99 ::com::sun::star::drawing::Direction3D m_aGivenAspectRatio
; //only used if nKeepAspectRatio==1
101 //Properties for splines:
102 ::com::sun::star::chart2::CurveStyle m_eCurveStyle
;
103 sal_Int32 m_nCurveResolution
;
104 sal_Int32 m_nSplineOrder
;
106 ::com::sun::star::uno::Reference
<
107 ::com::sun::star::drawing::XShapes
> m_xSeriesTarget
;
108 ::com::sun::star::uno::Reference
<
109 ::com::sun::star::drawing::XShapes
> m_xErrorBarTarget
;
110 ::com::sun::star::uno::Reference
<
111 ::com::sun::star::drawing::XShapes
> m_xTextTarget
;
112 ::com::sun::star::uno::Reference
<
113 ::com::sun::star::drawing::XShapes
> m_xRegressionCurveEquationTarget
;
115 //.............................................................................
117 //.............................................................................
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */