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