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: ChartTypeHelper.cxx,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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
34 #include "ChartTypeHelper.hxx"
35 #include "DiagramHelper.hxx"
36 #include "DataSeriesHelper.hxx"
38 #include "servicenames_charttypes.hxx"
40 #include <com/sun/star/beans/XPropertySet.hpp>
41 #include <com/sun/star/chart/DataLabelPlacement.hpp>
42 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
43 #include <com/sun/star/chart/MissingValueTreatment.hpp>
45 //.............................................................................
46 using namespace ::com::sun::star
;
47 using namespace ::com::sun::star::chart2
;
49 //.............................................................................
53 bool ChartTypeHelper::isSupportingAxisSideBySide(
54 const uno::Reference
< chart2::XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
58 if( xChartType
.is() &&
62 bool bAmbiguous
=false;
63 StackMode eStackMode
= DiagramHelper::getStackModeFromChartType( xChartType
, bFound
, bAmbiguous
, 0 );
64 if( eStackMode
== StackMode_NONE
&& !bAmbiguous
)
66 rtl::OUString aChartTypeName
= xChartType
->getChartType();
67 bResult
= ( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) ||
68 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) );
75 sal_Bool
ChartTypeHelper::isSupportingGeometryProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
77 //form tab only for 3D-bar and 3D-column charts.
79 //@todo ask charttype itself --> need model change first
82 if(nDimensionCount
==3)
84 rtl::OUString aChartTypeName
= xChartType
->getChartType();
85 if( aChartTypeName
.equals(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
87 if( aChartTypeName
.equals(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) )
94 sal_Bool
ChartTypeHelper::isSupportingStatisticProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
96 //3D charts, pie, net and stock do not support statistic properties
98 //@todo ask charttype itself (and series? --> stock chart?) --> need model change first
101 if(nDimensionCount
==3)
104 rtl::OUString aChartTypeName
= xChartType
->getChartType();
105 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
107 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
109 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
111 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
113 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) ) //todo: BubbleChart support error bars and trend lines
119 sal_Bool
ChartTypeHelper::isSupportingRegressionProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
121 // note: old chart: only scatter chart
122 return isSupportingStatisticProperties( xChartType
, nDimensionCount
);
125 sal_Bool
ChartTypeHelper::isSupportingAreaProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
127 //2D line charts, net and stock do not support area properties
129 //@todo ask charttype itself --> need model change first
132 if(nDimensionCount
==2)
134 rtl::OUString aChartTypeName
= xChartType
->getChartType();
135 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) )
137 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
139 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
141 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
148 sal_Bool
ChartTypeHelper::isSupportingSymbolProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
150 //2D line charts, 2D scatter charts and 2D net charts do support symbols
152 //@todo ask charttype itself --> need model change first
155 if(nDimensionCount
==3)
158 rtl::OUString aChartTypeName
= xChartType
->getChartType();
159 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) )
161 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
163 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
169 sal_Bool
ChartTypeHelper::isSupportingMainAxis( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
, sal_Int32 nDimensionIndex
)
171 //pie charts do not support axis at all
172 //no 3rd axis for 2D charts
174 //@todo ask charttype itself --> need model change first
177 rtl::OUString aChartTypeName
= xChartType
->getChartType();
178 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
181 if( nDimensionIndex
== 2 )
182 return nDimensionCount
== 3;
187 sal_Bool
ChartTypeHelper::isSupportingSecondaryAxis( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
, sal_Int32
/*nDimensionIndex*/ )
189 //3D, pie and net charts do not support a secondary axis at all
191 //@todo ask charttype itself --> need model change first
194 if(nDimensionCount
==3)
197 rtl::OUString aChartTypeName
= xChartType
->getChartType();
198 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
200 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
202 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
208 sal_Bool
ChartTypeHelper::isSupportingOverlapAndGapWidthProperties(
209 const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
211 //2D bar charts do support a this special properties
213 //@todo ask charttype itself --> need model change first
216 if(nDimensionCount
==3)
219 rtl::OUString aChartTypeName
= xChartType
->getChartType();
220 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) )
222 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
228 sal_Bool
ChartTypeHelper::isSupportingBarConnectors(
229 const uno::Reference
< chart2::XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
231 //2D bar charts with stacked series support this
233 //@todo ask charttype itself --> need model change first
236 if(nDimensionCount
==3)
240 bool bAmbiguous
=false;
241 StackMode eStackMode
= DiagramHelper::getStackModeFromChartType( xChartType
, bFound
, bAmbiguous
, 0 );
242 if( eStackMode
!= StackMode_Y_STACKED
|| bAmbiguous
)
245 rtl::OUString aChartTypeName
= xChartType
->getChartType();
246 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) )
248 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
249 return sal_True
; // note: old chart was false here
254 uno::Sequence
< sal_Int32
> ChartTypeHelper::getSupportedLabelPlacements( const uno::Reference
< chart2::XChartType
>& xChartType
255 , sal_Int32 nDimensionCount
, sal_Bool bSwapXAndY
256 , const uno::Reference
< chart2::XDataSeries
>& xSeries
)
258 (void)nDimensionCount
;
260 uno::Sequence
< sal_Int32
> aRet
;
261 if( !xChartType
.is() )
264 rtl::OUString aChartTypeName
= xChartType
->getChartType();
265 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
268 uno::Reference
< beans::XPropertySet
> xChartTypeProp( xChartType
, uno::UNO_QUERY_THROW
);
269 if(xChartTypeProp
.is())
270 xChartTypeProp
->getPropertyValue( C2U("UseRings")) >>= bDonut
;
275 sal_Int32
* pSeq
= aRet
.getArray();
276 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::AVOID_OVERLAP
;
277 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
278 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::INSIDE
;
279 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
284 sal_Int32
* pSeq
= aRet
.getArray();
285 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
288 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
)
289 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
)
290 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
)
294 sal_Int32
* pSeq
= aRet
.getArray();
295 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
296 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::BOTTOM
;
297 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::LEFT
;
298 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::RIGHT
;
299 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
301 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
)
302 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
305 bool bStacked
= false;
307 uno::Reference
< beans::XPropertySet
> xSeriesProp( xSeries
, uno::UNO_QUERY
);
308 chart2::StackingDirection eStacking
= chart2::StackingDirection_NO_STACKING
;
309 xSeriesProp
->getPropertyValue( C2U("StackingDirection") ) >>= eStacking
;
310 bStacked
= (chart2::StackingDirection_Y_STACKING
== eStacking
);
313 aRet
.realloc( bStacked
? 3 : 6 );
314 sal_Int32
* pSeq
= aRet
.getArray();
319 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::RIGHT
;
320 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::LEFT
;
324 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
325 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::BOTTOM
;
328 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
330 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
331 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::INSIDE
;
332 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::NEAR_ORIGIN
;
334 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
) )
337 sal_Int32
* pSeq
= aRet
.getArray();
338 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
340 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
343 sal_Int32
* pSeq
= aRet
.getArray();
344 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
345 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
346 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::BOTTOM
;
347 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::LEFT
;
348 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::RIGHT
;
349 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
351 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
354 sal_Int32
* pSeq
= aRet
.getArray();
355 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
357 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
360 sal_Int32
* pSeq
= aRet
.getArray();
361 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
365 OSL_ENSURE( false, "unknown charttype" );
371 sal_Bool
ChartTypeHelper::isSupportingRightAngledAxes( const uno::Reference
< chart2::XChartType
>& xChartType
)
375 rtl::OUString aChartTypeName
= xChartType
->getChartType();
376 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
382 bool ChartTypeHelper::isSupportingStartingAngle( const uno::Reference
< chart2::XChartType
>& xChartType
)
386 rtl::OUString aChartTypeName
= xChartType
->getChartType();
387 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
392 bool ChartTypeHelper::isSupportingBaseValue( const uno::Reference
< chart2::XChartType
>& xChartType
)
396 rtl::OUString aChartTypeName
= xChartType
->getChartType();
397 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
)
398 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
)
399 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
)
406 bool ChartTypeHelper::isSupportingAxisPositioning( const uno::Reference
< chart2::XChartType
>& xChartType
, sal_Int32 nDimensionCount
, sal_Int32 nDimensionIndex
)
410 rtl::OUString aChartTypeName
= xChartType
->getChartType();
411 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
413 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
416 if( nDimensionCount
==3 )
417 return nDimensionIndex
<2;
421 bool ChartTypeHelper::shiftTicksAtXAxisPerDefault( const uno::Reference
< chart2::XChartType
>& xChartType
)
425 rtl::OUString aChartTypeName
= xChartType
->getChartType();
426 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
)
427 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
433 bool ChartTypeHelper::noBordersForSimpleScheme( const uno::Reference
< chart2::XChartType
>& xChartType
)
437 rtl::OUString aChartTypeName
= xChartType
->getChartType();
438 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
445 sal_Int32
ChartTypeHelper::getDefaultDirectLightColor( bool bSimple
, const uno::Reference
< chart2::XChartType
>& xChartType
)
449 sal_Int32 nRet
= static_cast< sal_Int32
>( 0x999999 ); // grey40
450 if( xChartType
.is() )
452 rtl::OUString aChartType
= xChartType
->getChartType();
453 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
454 nRet
= static_cast< sal_Int32
>( 0x333333 ); // grey80
455 else if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_LINE
)
456 || aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
457 nRet
= static_cast< sal_Int32
>( 0x666666 ); // grey60
461 return static_cast< sal_Int32
>( 0xb3b3b3 ); // grey30
465 sal_Int32
ChartTypeHelper::getDefaultAmbientLightColor( bool bSimple
, const uno::Reference
< chart2::XChartType
>& xChartType
)
469 sal_Int32 nRet
= static_cast< sal_Int32
>( 0x999999 ); // grey40
470 if( xChartType
.is() )
472 rtl::OUString aChartType
= xChartType
->getChartType();
473 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
474 nRet
= static_cast< sal_Int32
>( 0xcccccc ); // grey20
478 return static_cast< sal_Int32
>( 0x666666 ); // grey60
481 drawing::Direction3D
ChartTypeHelper::getDefaultSimpleLightDirection( const uno::Reference
< chart2::XChartType
>& xChartType
)
483 //drawing::Direction3D aRet(0.0, 0.0, 1.0);
484 drawing::Direction3D
aRet(-0.2, 0.7, 0.6);
485 if( xChartType
.is() )
487 rtl::OUString aChartType
= xChartType
->getChartType();
488 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
489 aRet
= drawing::Direction3D(0.0, 0.8, 0.5);
490 else if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_LINE
)
491 || aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
492 aRet
= drawing::Direction3D(0.9, 0.5, 0.05);
497 drawing::Direction3D
ChartTypeHelper::getDefaultRealisticLightDirection( const uno::Reference
< chart2::XChartType
>& xChartType
)
499 drawing::Direction3D
aRet(-0.1, 0.6, 0.8);
500 if( xChartType
.is() )
502 rtl::OUString aChartType
= xChartType
->getChartType();
503 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
504 aRet
= drawing::Direction3D(0.6, 0.6, 0.6);
505 else if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_LINE
)
506 || aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
507 aRet
= drawing::Direction3D(0.9, 0.5, 0.05);
512 sal_Int32
ChartTypeHelper::getAxisType( const uno::Reference
<
513 XChartType
>& xChartType
, sal_Int32 nDimensionIndex
)
515 //retruned is a constant from constant group ::com::sun::star::chart2::AxisType
517 //@todo ask charttype itself --> need model change first
519 return AxisType::CATEGORY
;
521 rtl::OUString aChartTypeName
= xChartType
->getChartType();
522 if(2==nDimensionIndex
)//z-axis
523 return AxisType::SERIES
;
524 if(1==nDimensionIndex
)//y-axis
525 return AxisType::REALNUMBER
;
526 if(0==nDimensionIndex
)//x-axis
528 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
)
529 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
530 return AxisType::REALNUMBER
;
531 return AxisType::CATEGORY
;
533 return AxisType::CATEGORY
;
536 sal_Int32
ChartTypeHelper::getNumberOfDisplayedSeries(
537 const uno::Reference
< XChartType
>& xChartType
,
538 sal_Int32 nNumberOfSeries
)
540 if( xChartType
.is() )
544 rtl::OUString aChartTypeName
= xChartType
->getChartType();
545 if( aChartTypeName
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
))
547 uno::Reference
< beans::XPropertySet
> xChartTypeProp( xChartType
, uno::UNO_QUERY_THROW
);
549 if( (xChartTypeProp
->getPropertyValue( C2U("UseRings")) >>= bDonut
)
556 catch( const uno::Exception
& ex
)
558 ASSERT_EXCEPTION( ex
);
561 return nNumberOfSeries
;
564 uno::Sequence
< sal_Int32
> ChartTypeHelper::getSupportedMissingValueTreatments( const uno::Reference
< XChartType
>& xChartType
)
566 uno::Sequence
< sal_Int32
> aRet
;
567 if( !xChartType
.is() )
570 bool bStacked
= false;
572 bool bAmbiguous
=false;
573 StackMode eStackMode
= DiagramHelper::getStackModeFromChartType( xChartType
, bFound
, bAmbiguous
, 0 );
574 bStacked
= bFound
&& (StackMode_Y_STACKED
== eStackMode
);
576 rtl::OUString aChartTypeName
= xChartType
->getChartType();
577 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) ||
578 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) ||
579 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
582 sal_Int32
* pSeq
= aRet
.getArray();
583 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP
;
584 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
586 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
) )
588 aRet
.realloc( bStacked
? 1 : 2 );
589 sal_Int32
* pSeq
= aRet
.getArray();
590 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
592 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::CONTINUE
;
594 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) ||
595 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) ||
596 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
598 aRet
.realloc( bStacked
? 2 : 3 );
599 sal_Int32
* pSeq
= aRet
.getArray();
600 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP
;
601 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
603 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::CONTINUE
;
605 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
608 sal_Int32
* pSeq
= aRet
.getArray();
609 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::CONTINUE
;
610 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP
;
611 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
613 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) ||
614 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
620 OSL_ENSURE( false, "unknown charttype" );
626 bool ChartTypeHelper::isSeriesInFrontOfAxisLine( const uno::Reference
< XChartType
>& xChartType
)
628 if( xChartType
.is() )
630 rtl::OUString aChartTypeName
= xChartType
->getChartType();
631 if( aChartTypeName
.match( CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
637 rtl::OUString
ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( const uno::Reference
< XChartType
>& xChartType
)
639 rtl::OUString
aRet( C2U( "values-y" ) );
640 if( !xChartType
.is() )
642 rtl::OUString aChartTypeName
= xChartType
->getChartType();
643 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
644 aRet
= xChartType
->getRoleOfSequenceForSeriesLabel();
648 rtl::OUString
ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( const uno::Reference
< XChartType
>& xChartType
)
650 rtl::OUString
aRet( C2U( "values-y" ) );
651 if( !xChartType
.is() )
653 rtl::OUString aChartTypeName
= xChartType
->getChartType();
654 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
)
655 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
656 aRet
= xChartType
->getRoleOfSequenceForSeriesLabel();
660 bool ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( const uno::Reference
< XChartType
>& xChartType
)
663 rtl::OUString aChartTypeName
= xChartType
->getChartType();
664 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
669 bool ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( const uno::Reference
< XChartType
>& xChartType
)
672 if( !xChartType
.is() )
675 rtl::OUString aChartTypeName
= xChartType
->getChartType();
676 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) ||
677 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) ||
678 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
) )
685 //.............................................................................
687 //.............................................................................