1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef _CHART2_VSERIESPLOTTER_HXX 28*cdf0e10cSrcweir #define _CHART2_VSERIESPLOTTER_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include "PlotterBase.hxx" 31*cdf0e10cSrcweir #include "VDataSeries.hxx" 32*cdf0e10cSrcweir #include "LabelAlignment.hxx" 33*cdf0e10cSrcweir #include "MinimumAndMaximumSupplier.hxx" 34*cdf0e10cSrcweir #include "LegendEntryProvider.hxx" 35*cdf0e10cSrcweir #include "ExplicitCategoriesProvider.hxx" 36*cdf0e10cSrcweir #include <com/sun/star/chart2/XChartType.hpp> 37*cdf0e10cSrcweir #include <com/sun/star/drawing/Direction3D.hpp> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir namespace com { namespace sun { namespace star { 41*cdf0e10cSrcweir namespace util { 42*cdf0e10cSrcweir class XNumberFormatsSupplier; 43*cdf0e10cSrcweir } 44*cdf0e10cSrcweir namespace chart2 { 45*cdf0e10cSrcweir class XColorScheme; 46*cdf0e10cSrcweir class XRegressionCurveCalculator; 47*cdf0e10cSrcweir } 48*cdf0e10cSrcweir }}} 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir //............................................................................. 51*cdf0e10cSrcweir namespace chart 52*cdf0e10cSrcweir { 53*cdf0e10cSrcweir //............................................................................. 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir class NumberFormatterWrapper; 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir class AxesNumberFormats 58*cdf0e10cSrcweir { 59*cdf0e10cSrcweir public: 60*cdf0e10cSrcweir AxesNumberFormats() {}; 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir void setFormat( sal_Int32 nFormatKey, sal_Int32 nDimIndex, sal_Int32 nAxisIndex ) 63*cdf0e10cSrcweir { 64*cdf0e10cSrcweir m_aNumberFormatMap[tFullAxisIndex(nDimIndex,nAxisIndex)] = nFormatKey; 65*cdf0e10cSrcweir } 66*cdf0e10cSrcweir sal_Int32 hasFormat( sal_Int32 nDimIndex, sal_Int32 nAxisIndex ) const 67*cdf0e10cSrcweir { 68*cdf0e10cSrcweir return (m_aNumberFormatMap.find(tFullAxisIndex(nDimIndex,nAxisIndex)) !=m_aNumberFormatMap.end()); 69*cdf0e10cSrcweir } 70*cdf0e10cSrcweir sal_Int32 getFormat( sal_Int32 nDimIndex, sal_Int32 nAxisIndex ) const 71*cdf0e10cSrcweir { 72*cdf0e10cSrcweir tNumberFormatMap::const_iterator aIt = m_aNumberFormatMap.find(tFullAxisIndex(nDimIndex,nAxisIndex)); 73*cdf0e10cSrcweir if( aIt !=m_aNumberFormatMap.end() ) 74*cdf0e10cSrcweir return aIt->second; 75*cdf0e10cSrcweir return 0; 76*cdf0e10cSrcweir } 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir private: 79*cdf0e10cSrcweir typedef std::pair< sal_Int32, sal_Int32 > tFullAxisIndex; 80*cdf0e10cSrcweir typedef std::map< tFullAxisIndex, sal_Int32 > tNumberFormatMap; 81*cdf0e10cSrcweir tNumberFormatMap m_aNumberFormatMap; 82*cdf0e10cSrcweir }; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir //----------------------------------------------------------------------------- 85*cdf0e10cSrcweir /** 86*cdf0e10cSrcweir */ 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir //enum StackType { STACK_NORMAL, STACK_NONE, STACK_BESIDES, STACK_ONTOP, STACK_BEHIND }; 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir class VDataSeriesGroup 91*cdf0e10cSrcweir { 92*cdf0e10cSrcweir //a list of series that have the same CoordinateSystem 93*cdf0e10cSrcweir //they are used to be plotted maybe in a stacked manner by a plotter 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir public: 96*cdf0e10cSrcweir VDataSeriesGroup(); 97*cdf0e10cSrcweir VDataSeriesGroup( VDataSeries* pSeries ); 98*cdf0e10cSrcweir virtual ~VDataSeriesGroup(); 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir void addSeries( VDataSeries* pSeries );//takes ownership of pSeries 101*cdf0e10cSrcweir sal_Int32 getSeriesCount() const; 102*cdf0e10cSrcweir void deleteSeries(); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir sal_Int32 getPointCount() const; 105*cdf0e10cSrcweir sal_Int32 getAttachedAxisIndexForFirstSeries() const; 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir void getMinimumAndMaximiumX( double& rfMinimum, double& rfMaximum ) const; 108*cdf0e10cSrcweir void getMinimumAndMaximiumYInContinuousXRange( double& rfMinY, double& rfMaxY, double fMinX, double fMaxX, sal_Int32 nAxisIndex ) const; 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir void calculateYMinAndMaxForCategory( sal_Int32 nCategoryIndex 111*cdf0e10cSrcweir , bool bSeperateStackingForDifferentSigns 112*cdf0e10cSrcweir , double& rfMinimumY, double& rfMaximumY, sal_Int32 nAxisIndex ); 113*cdf0e10cSrcweir void calculateYMinAndMaxForCategoryRange( sal_Int32 nStartCategoryIndex, sal_Int32 nEndCategoryIndex 114*cdf0e10cSrcweir , bool bSeperateStackingForDifferentSigns 115*cdf0e10cSrcweir , double& rfMinimumY, double& rfMaximumY, sal_Int32 nAxisIndex ); 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir ::std::vector< VDataSeries* > m_aSeriesVector; 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir private: 120*cdf0e10cSrcweir //cached values 121*cdf0e10cSrcweir struct CachedYValues 122*cdf0e10cSrcweir { 123*cdf0e10cSrcweir CachedYValues(); 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir bool m_bValuesDirty; 126*cdf0e10cSrcweir double m_fMinimumY; 127*cdf0e10cSrcweir double m_fMaximumY; 128*cdf0e10cSrcweir }; 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir mutable bool m_bMaxPointCountDirty; 131*cdf0e10cSrcweir mutable sal_Int32 m_nMaxPointCount; 132*cdf0e10cSrcweir typedef std::map< sal_Int32, CachedYValues > tCachedYValuesPerAxisIndexMap; 133*cdf0e10cSrcweir mutable ::std::vector< tCachedYValuesPerAxisIndexMap > m_aListOfCachedYValues; 134*cdf0e10cSrcweir }; 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir class VSeriesPlotter : public PlotterBase, public MinimumAndMaximumSupplier, public LegendEntryProvider 137*cdf0e10cSrcweir { 138*cdf0e10cSrcweir //------------------------------------------------------------------------- 139*cdf0e10cSrcweir // public methods 140*cdf0e10cSrcweir //------------------------------------------------------------------------- 141*cdf0e10cSrcweir public: 142*cdf0e10cSrcweir virtual ~VSeriesPlotter(); 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir /* 145*cdf0e10cSrcweir * A new series can be positioned relative to other series in a chart. 146*cdf0e10cSrcweir * This positioning has two dimensions. First a series can be placed 147*cdf0e10cSrcweir * next to each other on the category axis. This position is indicated by xSlot. 148*cdf0e10cSrcweir * Second a series can be stacked on top of another. This position is indicated by ySlot. 149*cdf0e10cSrcweir * The positions are counted from 0 on. 150*cdf0e10cSrcweir * xSlot < 0 : append the series to already existing x series 151*cdf0e10cSrcweir * xSlot > occupied : append the series to already existing x series 152*cdf0e10cSrcweir * 153*cdf0e10cSrcweir * If the xSlot is already occupied the given ySlot decides what should happen: 154*cdf0e10cSrcweir * ySlot < -1 : move all existing series in the xSlot to next slot 155*cdf0e10cSrcweir * ySlot == -1 : stack on top at given x position 156*cdf0e10cSrcweir * ySlot == already occupied : insert at given y and x position 157*cdf0e10cSrcweir * ySlot > occupied : stack on top at given x position 158*cdf0e10cSrcweir */ 159*cdf0e10cSrcweir virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 ); 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir /** a value <= 0 for a directions means that this direction can be stretched arbitrary 162*cdf0e10cSrcweir */ 163*cdf0e10cSrcweir virtual ::com::sun::star::drawing::Direction3D getPreferredDiagramAspectRatio() const; 164*cdf0e10cSrcweir virtual bool keepAspectRatio() const; 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir /** this enables you to handle series on the same x axis with different y axis 167*cdf0e10cSrcweir the property AttachedAxisIndex at a dataseries indicates which value scale is to use 168*cdf0e10cSrcweir (0==AttachedAxisIndex or a not set AttachedAxisIndex property indicates that this series should be scaled at the main y-axis; 169*cdf0e10cSrcweir 1==AttachedAxisIndex indicates that the series should be scaled at the first secondary axis if there is any otherwise at the main y axis 170*cdf0e10cSrcweir and so on. 171*cdf0e10cSrcweir The parameter nAxisIndex matches this DataSereis property 'AttachedAxisIndex'. 172*cdf0e10cSrcweir nAxisIndex must be greater than 0. nAxisIndex==1 referres to the first secondary axis. 173*cdf0e10cSrcweir ) 174*cdf0e10cSrcweir */ 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir virtual void addSecondaryValueScale( const ExplicitScaleData& rScale, sal_Int32 nAxisIndex ) 177*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir //------------------------------------------------------------------------- 180*cdf0e10cSrcweir // MinimumAndMaximumSupplier 181*cdf0e10cSrcweir //------------------------------------------------------------------------- 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir virtual double getMinimumX(); 184*cdf0e10cSrcweir virtual double getMaximumX(); 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir virtual double getMinimumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ); 187*cdf0e10cSrcweir virtual double getMaximumYInRange( double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex ); 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir virtual double getMinimumZ(); 190*cdf0e10cSrcweir virtual double getMaximumZ(); 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir virtual bool isExpandBorderToIncrementRhythm( sal_Int32 nDimensionIndex ); 193*cdf0e10cSrcweir virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex ); 194*cdf0e10cSrcweir virtual bool isExpandWideValuesToZero( sal_Int32 nDimensionIndex ); 195*cdf0e10cSrcweir virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ); 196*cdf0e10cSrcweir virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex ); 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir virtual long calculateTimeResolutionOnXAxis(); 199*cdf0e10cSrcweir virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ); 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir //------ 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir void getMinimumAndMaximiumX( double& rfMinimum, double& rfMaximum ) const; 204*cdf0e10cSrcweir void getMinimumAndMaximiumYInContinuousXRange( double& rfMinY, double& rfMaxY, double fMinX, double fMaxX, sal_Int32 nAxisIndex ) const; 205*cdf0e10cSrcweir 206*cdf0e10cSrcweir //------------------------------------------------------------------------- 207*cdf0e10cSrcweir //------------------------------------------------------------------------- 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir virtual std::vector< ViewLegendEntry > createLegendEntries( 210*cdf0e10cSrcweir const ::com::sun::star::awt::Size& rEntryKeyAspectRatio, 211*cdf0e10cSrcweir ::com::sun::star::chart::ChartLegendExpansion eLegendExpansion, 212*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 213*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet >& xTextProperties, 214*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 215*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget, 216*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 217*cdf0e10cSrcweir ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory, 218*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 219*cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext >& xContext 220*cdf0e10cSrcweir ); 221*cdf0e10cSrcweir 222*cdf0e10cSrcweir 223*cdf0e10cSrcweir virtual LegendSymbolStyle getLegendSymbolStyle(); 224*cdf0e10cSrcweir virtual com::sun::star::awt::Size getPreferredLegendKeyAspectRatio(); 225*cdf0e10cSrcweir 226*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any getExplicitSymbol( const VDataSeries& rSeries, sal_Int32 nPointIndex=-1/*-1 for series symbol*/ ); 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLegendSymbolForSeries( 229*cdf0e10cSrcweir const ::com::sun::star::awt::Size& rEntryKeyAspectRatio 230*cdf0e10cSrcweir , const VDataSeries& rSeries 231*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget 232*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory ); 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > createLegendSymbolForPoint( 235*cdf0e10cSrcweir const ::com::sun::star::awt::Size& rEntryKeyAspectRatio 236*cdf0e10cSrcweir , const VDataSeries& rSeries 237*cdf0e10cSrcweir , sal_Int32 nPointIndex 238*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget 239*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory ); 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir virtual std::vector< ViewLegendEntry > createLegendEntriesForSeries( 242*cdf0e10cSrcweir const ::com::sun::star::awt::Size& rEntryKeyAspectRatio, 243*cdf0e10cSrcweir const VDataSeries& rSeries, 244*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 245*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet >& xTextProperties, 246*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 247*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget, 248*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 249*cdf0e10cSrcweir ::com::sun::star::lang::XMultiServiceFactory >& xShapeFactory, 250*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 251*cdf0e10cSrcweir ::com::sun::star::uno::XComponentContext >& xContext 252*cdf0e10cSrcweir ); 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir ::std::vector< VDataSeries* > getAllSeries(); 255*cdf0e10cSrcweir 256*cdf0e10cSrcweir //------------------------------------------------------------------------- 257*cdf0e10cSrcweir //------------------------------------------------------------------------- 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir static VSeriesPlotter* createSeriesPlotter( const ::com::sun::star::uno::Reference< 260*cdf0e10cSrcweir ::com::sun::star::chart2::XChartType >& xChartTypeModel 261*cdf0e10cSrcweir , sal_Int32 nDimensionCount 262*cdf0e10cSrcweir , bool bExcludingPositioning = false /*for pie and donut charts labels and exploded segments are excluded from the given size*/); 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir sal_Int32 getPointCount() const; 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir void setNumberFormatsSupplier( const ::com::sun::star::uno::Reference< 267*cdf0e10cSrcweir ::com::sun::star::util::XNumberFormatsSupplier > & xNumFmtSupplier ); 268*cdf0e10cSrcweir void setAxesNumberFormats( const AxesNumberFormats& rAxesNumberFormats ) { m_aAxesNumberFormats = rAxesNumberFormats; }; 269*cdf0e10cSrcweir 270*cdf0e10cSrcweir void setColorScheme( const ::com::sun::star::uno::Reference< 271*cdf0e10cSrcweir ::com::sun::star::chart2::XColorScheme >& xColorScheme ); 272*cdf0e10cSrcweir 273*cdf0e10cSrcweir void setExplicitCategoriesProvider( ExplicitCategoriesProvider* pExplicitCategoriesProvider ); 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir //get series names for the z axis labels 276*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< rtl::OUString > getSeriesNames() const; 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir void setPageReferenceSize( const ::com::sun::star::awt::Size & rPageRefSize ); 279*cdf0e10cSrcweir //better performance for big data 280*cdf0e10cSrcweir void setCoordinateSystemResolution( const ::com::sun::star::uno::Sequence< sal_Int32 >& rCoordinateSystemResolution ); 281*cdf0e10cSrcweir bool PointsWereSkipped() const; 282*cdf0e10cSrcweir 283*cdf0e10cSrcweir //return the depth for a logic 1 284*cdf0e10cSrcweir double getTransformedDepth() const; 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir void releaseShapes(); 287*cdf0e10cSrcweir 288*cdf0e10cSrcweir virtual void rearrangeLabelToAvoidOverlapIfRequested( const ::com::sun::star::awt::Size& rPageSize ); 289*cdf0e10cSrcweir 290*cdf0e10cSrcweir bool WantToPlotInFrontOfAxisLine(); 291*cdf0e10cSrcweir virtual bool shouldSnapRectToUsedArea(); 292*cdf0e10cSrcweir 293*cdf0e10cSrcweir //------------------------------------------------------------------------- 294*cdf0e10cSrcweir //------------------------------------------------------------------------- 295*cdf0e10cSrcweir //------------------------------------------------------------------------- 296*cdf0e10cSrcweir private: //methods 297*cdf0e10cSrcweir //no default constructor 298*cdf0e10cSrcweir VSeriesPlotter(); 299*cdf0e10cSrcweir 300*cdf0e10cSrcweir protected: //methods 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir VSeriesPlotter( const ::com::sun::star::uno::Reference< 303*cdf0e10cSrcweir ::com::sun::star::chart2::XChartType >& xChartTypeModel 304*cdf0e10cSrcweir , sal_Int32 nDimensionCount 305*cdf0e10cSrcweir , bool bCategoryXAxis=true ); 306*cdf0e10cSrcweir 307*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > 308*cdf0e10cSrcweir getSeriesGroupShape( VDataSeries* pDataSeries 309*cdf0e10cSrcweir , const::com::sun::star:: uno::Reference< 310*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget ); 311*cdf0e10cSrcweir 312*cdf0e10cSrcweir //the following group shapes will be created as children of SeriesGroupShape on demand 313*cdf0e10cSrcweir //they can be used to assure that some parts of a series shape are always in front of others (e.g. symbols in front of lines) 314*cdf0e10cSrcweir //parameter xTarget will be used as parent for the series group shape 315*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > 316*cdf0e10cSrcweir getSeriesGroupShapeFrontChild( VDataSeries* pDataSeries 317*cdf0e10cSrcweir , const::com::sun::star:: uno::Reference< 318*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget ); 319*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > 320*cdf0e10cSrcweir getSeriesGroupShapeBackChild( VDataSeries* pDataSeries 321*cdf0e10cSrcweir , const::com::sun::star:: uno::Reference< 322*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget ); 323*cdf0e10cSrcweir 324*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > 325*cdf0e10cSrcweir getLabelsGroupShape( VDataSeries& rDataSeries 326*cdf0e10cSrcweir , const::com::sun::star:: uno::Reference< 327*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget ); 328*cdf0e10cSrcweir 329*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > 330*cdf0e10cSrcweir getErrorBarsGroupShape( VDataSeries& rDataSeries 331*cdf0e10cSrcweir , const::com::sun::star:: uno::Reference< 332*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget ); 333*cdf0e10cSrcweir 334*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > 335*cdf0e10cSrcweir createDataLabel( const ::com::sun::star::uno::Reference< 336*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget 337*cdf0e10cSrcweir , VDataSeries& rDataSeries 338*cdf0e10cSrcweir , sal_Int32 nPointIndex 339*cdf0e10cSrcweir , double fValue 340*cdf0e10cSrcweir , double fSumValue 341*cdf0e10cSrcweir , const ::com::sun::star::awt::Point& rScreenPosition2D 342*cdf0e10cSrcweir , LabelAlignment eAlignment=LABEL_ALIGN_CENTER 343*cdf0e10cSrcweir , sal_Int32 nOffset=0 ); 344*cdf0e10cSrcweir 345*cdf0e10cSrcweir ::rtl::OUString getLabelTextForValue( VDataSeries& rDataSeries 346*cdf0e10cSrcweir , sal_Int32 nPointIndex 347*cdf0e10cSrcweir , double fValue 348*cdf0e10cSrcweir , bool bAsPercentage ); 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir /** creates two T-shaped error bars in both directions (up/down or 351*cdf0e10cSrcweir left/right depending on the bVertical parameter) 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir @param rPos 354*cdf0e10cSrcweir logic coordinates 355*cdf0e10cSrcweir 356*cdf0e10cSrcweir @param xErrorBarProperties 357*cdf0e10cSrcweir the XPropertySet returned by the DataPoint-property "ErrorBarX" or 358*cdf0e10cSrcweir "ErrorBarY". 359*cdf0e10cSrcweir 360*cdf0e10cSrcweir @param nIndex 361*cdf0e10cSrcweir the index of the data point in rData for which the calculation is 362*cdf0e10cSrcweir done. 363*cdf0e10cSrcweir 364*cdf0e10cSrcweir @param bVertical 365*cdf0e10cSrcweir for y-error bars this is true, for x-error-bars it is false. 366*cdf0e10cSrcweir */ 367*cdf0e10cSrcweir virtual void createErrorBar( 368*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 369*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget 370*cdf0e10cSrcweir , const ::com::sun::star::drawing::Position3D & rPos 371*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 372*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > & xErrorBarProperties 373*cdf0e10cSrcweir , const VDataSeries& rVDataSeries 374*cdf0e10cSrcweir , sal_Int32 nIndex 375*cdf0e10cSrcweir , bool bVertical 376*cdf0e10cSrcweir , double* pfScaledLogicX 377*cdf0e10cSrcweir ); 378*cdf0e10cSrcweir 379*cdf0e10cSrcweir virtual void createErrorBar_Y( const ::com::sun::star::drawing::Position3D& rUnscaledLogicPosition 380*cdf0e10cSrcweir , VDataSeries& rVDataSeries, sal_Int32 nPointIndex 381*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 382*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget 383*cdf0e10cSrcweir , double* pfScaledLogicX=0 ); 384*cdf0e10cSrcweir 385*cdf0e10cSrcweir virtual void createRegressionCurvesShapes( VDataSeries& rVDataSeries 386*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 387*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xTarget 388*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 389*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xEquationTarget 390*cdf0e10cSrcweir , bool bMaySkipPointsInRegressionCalculation ); 391*cdf0e10cSrcweir 392*cdf0e10cSrcweir virtual void createRegressionCurveEquationShapes( const ::rtl::OUString & rEquationCID 393*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 394*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > & xEquationProperties 395*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 396*cdf0e10cSrcweir ::com::sun::star::drawing::XShapes >& xEquationTarget 397*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 398*cdf0e10cSrcweir ::com::sun::star::chart2::XRegressionCurveCalculator > & xRegressionCurveCalculator 399*cdf0e10cSrcweir , ::com::sun::star::awt::Point aDefaultPos ); 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir virtual void setMappedProperties( 402*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 403*cdf0e10cSrcweir ::com::sun::star::drawing::XShape >& xTarget 404*cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 405*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet >& xSource 406*cdf0e10cSrcweir , const tPropertyNameMap& rMap 407*cdf0e10cSrcweir , tPropertyNameValueMap* pOverwriteMap=0 ); 408*cdf0e10cSrcweir 409*cdf0e10cSrcweir virtual PlottingPositionHelper& getPlottingPositionHelper( sal_Int32 nAxisIndex ) const;//nAxisIndex indicates wether the position belongs to the main axis ( nAxisIndex==0 ) or secondary axis ( nAxisIndex==1 ) 410*cdf0e10cSrcweir 411*cdf0e10cSrcweir VDataSeries* getFirstSeries() const; 412*cdf0e10cSrcweir 413*cdf0e10cSrcweir protected: //member 414*cdf0e10cSrcweir PlottingPositionHelper* m_pMainPosHelper; 415*cdf0e10cSrcweir 416*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 417*cdf0e10cSrcweir ::com::sun::star::chart2::XChartType > m_xChartTypeModel; 418*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 419*cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > m_xChartTypeModelProps; 420*cdf0e10cSrcweir 421*cdf0e10cSrcweir ::std::vector< ::std::vector< VDataSeriesGroup > > m_aZSlots; 422*cdf0e10cSrcweir 423*cdf0e10cSrcweir bool m_bCategoryXAxis;//true->xvalues are indices (this would not be necessary if series for category chart wouldn't have x-values) 424*cdf0e10cSrcweir long m_nTimeResolution; 425*cdf0e10cSrcweir Date m_aNullDate; 426*cdf0e10cSrcweir 427*cdf0e10cSrcweir ::std::auto_ptr< NumberFormatterWrapper > m_apNumberFormatterWrapper; 428*cdf0e10cSrcweir AxesNumberFormats m_aAxesNumberFormats;//direct numberformats on axes, if empty ask the data series instead 429*cdf0e10cSrcweir 430*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 431*cdf0e10cSrcweir ::com::sun::star::chart2::XColorScheme > m_xColorScheme; 432*cdf0e10cSrcweir 433*cdf0e10cSrcweir ExplicitCategoriesProvider* m_pExplicitCategoriesProvider; 434*cdf0e10cSrcweir 435*cdf0e10cSrcweir //better performance for big data 436*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< sal_Int32 > m_aCoordinateSystemResolution; 437*cdf0e10cSrcweir bool m_bPointsWereSkipped; 438*cdf0e10cSrcweir 439*cdf0e10cSrcweir private: //member 440*cdf0e10cSrcweir typedef std::map< sal_Int32 , ExplicitScaleData > tSecondaryValueScales; 441*cdf0e10cSrcweir tSecondaryValueScales m_aSecondaryValueScales; 442*cdf0e10cSrcweir 443*cdf0e10cSrcweir typedef std::map< sal_Int32 , PlottingPositionHelper* > tSecondaryPosHelperMap; 444*cdf0e10cSrcweir mutable tSecondaryPosHelperMap m_aSecondaryPosHelperMap; 445*cdf0e10cSrcweir ::com::sun::star::awt::Size m_aPageReferenceSize; 446*cdf0e10cSrcweir }; 447*cdf0e10cSrcweir 448*cdf0e10cSrcweir //............................................................................. 449*cdf0e10cSrcweir } //namespace chart 450*cdf0e10cSrcweir //............................................................................. 451*cdf0e10cSrcweir #endif 452