1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_chart2.hxx"
31 #include "ChartTypeHelper.hxx"
32 #include "DiagramHelper.hxx"
33 #include "DataSeriesHelper.hxx"
35 #include "servicenames_charttypes.hxx"
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #include <com/sun/star/chart/DataLabelPlacement.hpp>
39 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
40 #include <com/sun/star/chart/MissingValueTreatment.hpp>
42 //.............................................................................
43 using namespace ::com::sun::star
;
44 using namespace ::com::sun::star::chart2
;
46 //.............................................................................
50 bool ChartTypeHelper::isSupportingAxisSideBySide(
51 const uno::Reference
< chart2::XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
55 if( xChartType
.is() &&
59 bool bAmbiguous
=false;
60 StackMode eStackMode
= DiagramHelper::getStackModeFromChartType( xChartType
, bFound
, bAmbiguous
, 0 );
61 if( eStackMode
== StackMode_NONE
&& !bAmbiguous
)
63 rtl::OUString aChartTypeName
= xChartType
->getChartType();
64 bResult
= ( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) ||
65 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) );
72 sal_Bool
ChartTypeHelper::isSupportingGeometryProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
74 //form tab only for 3D-bar and 3D-column charts.
76 //@todo ask charttype itself --> need model change first
79 if(nDimensionCount
==3)
81 rtl::OUString aChartTypeName
= xChartType
->getChartType();
82 if( aChartTypeName
.equals(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
84 if( aChartTypeName
.equals(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) )
91 sal_Bool
ChartTypeHelper::isSupportingStatisticProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
93 //3D charts, pie, net and stock do not support statistic properties
95 //@todo ask charttype itself (and series? --> stock chart?) --> need model change first
98 if(nDimensionCount
==3)
101 rtl::OUString aChartTypeName
= xChartType
->getChartType();
102 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
104 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
106 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
108 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
110 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) ) //todo: BubbleChart support error bars and trend lines
116 sal_Bool
ChartTypeHelper::isSupportingRegressionProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
118 // note: old chart: only scatter chart
119 return isSupportingStatisticProperties( xChartType
, nDimensionCount
);
122 sal_Bool
ChartTypeHelper::isSupportingAreaProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
124 //2D line charts, net and stock do not support area properties
126 //@todo ask charttype itself --> need model change first
129 if(nDimensionCount
==2)
131 rtl::OUString aChartTypeName
= xChartType
->getChartType();
132 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) )
134 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
136 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
138 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
145 sal_Bool
ChartTypeHelper::isSupportingSymbolProperties( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
147 //2D line charts, 2D scatter charts and 2D net charts do support symbols
149 //@todo ask charttype itself --> need model change first
152 if(nDimensionCount
==3)
155 rtl::OUString aChartTypeName
= xChartType
->getChartType();
156 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) )
158 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
160 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
166 sal_Bool
ChartTypeHelper::isSupportingMainAxis( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
, sal_Int32 nDimensionIndex
)
168 //pie charts do not support axis at all
169 //no 3rd axis for 2D charts
171 //@todo ask charttype itself --> need model change first
174 rtl::OUString aChartTypeName
= xChartType
->getChartType();
175 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
178 if( nDimensionIndex
== 2 )
179 return nDimensionCount
== 3;
184 sal_Bool
ChartTypeHelper::isSupportingSecondaryAxis( const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
, sal_Int32
/*nDimensionIndex*/ )
186 //3D, pie and net charts do not support a secondary axis at all
188 //@todo ask charttype itself --> need model change first
191 if(nDimensionCount
==3)
194 rtl::OUString aChartTypeName
= xChartType
->getChartType();
195 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
197 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
199 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
205 sal_Bool
ChartTypeHelper::isSupportingOverlapAndGapWidthProperties(
206 const uno::Reference
< XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
208 //2D bar charts do support a this special properties
210 //@todo ask charttype itself --> need model change first
213 if(nDimensionCount
==3)
216 rtl::OUString aChartTypeName
= xChartType
->getChartType();
217 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) )
219 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
225 sal_Bool
ChartTypeHelper::isSupportingBarConnectors(
226 const uno::Reference
< chart2::XChartType
>& xChartType
, sal_Int32 nDimensionCount
)
228 //2D bar charts with stacked series support this
230 //@todo ask charttype itself --> need model change first
233 if(nDimensionCount
==3)
237 bool bAmbiguous
=false;
238 StackMode eStackMode
= DiagramHelper::getStackModeFromChartType( xChartType
, bFound
, bAmbiguous
, 0 );
239 if( eStackMode
!= StackMode_Y_STACKED
|| bAmbiguous
)
242 rtl::OUString aChartTypeName
= xChartType
->getChartType();
243 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) )
245 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
246 return sal_True
; // note: old chart was false here
251 uno::Sequence
< sal_Int32
> ChartTypeHelper::getSupportedLabelPlacements( const uno::Reference
< chart2::XChartType
>& xChartType
252 , sal_Int32 nDimensionCount
, sal_Bool bSwapXAndY
253 , const uno::Reference
< chart2::XDataSeries
>& xSeries
)
255 (void)nDimensionCount
;
257 uno::Sequence
< sal_Int32
> aRet
;
258 if( !xChartType
.is() )
261 rtl::OUString aChartTypeName
= xChartType
->getChartType();
262 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
265 uno::Reference
< beans::XPropertySet
> xChartTypeProp( xChartType
, uno::UNO_QUERY_THROW
);
266 if(xChartTypeProp
.is())
267 xChartTypeProp
->getPropertyValue( C2U("UseRings")) >>= bDonut
;
272 sal_Int32
* pSeq
= aRet
.getArray();
273 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::AVOID_OVERLAP
;
274 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
275 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::INSIDE
;
276 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
281 sal_Int32
* pSeq
= aRet
.getArray();
282 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
285 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
)
286 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
)
287 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
)
291 sal_Int32
* pSeq
= aRet
.getArray();
292 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
293 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::BOTTOM
;
294 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::LEFT
;
295 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::RIGHT
;
296 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
298 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
)
299 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
302 bool bStacked
= false;
304 uno::Reference
< beans::XPropertySet
> xSeriesProp( xSeries
, uno::UNO_QUERY
);
305 chart2::StackingDirection eStacking
= chart2::StackingDirection_NO_STACKING
;
306 xSeriesProp
->getPropertyValue( C2U("StackingDirection") ) >>= eStacking
;
307 bStacked
= (chart2::StackingDirection_Y_STACKING
== eStacking
);
310 aRet
.realloc( bStacked
? 3 : 6 );
311 sal_Int32
* pSeq
= aRet
.getArray();
316 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::RIGHT
;
317 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::LEFT
;
321 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
322 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::BOTTOM
;
325 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
327 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
328 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::INSIDE
;
329 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::NEAR_ORIGIN
;
331 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
) )
334 sal_Int32
* pSeq
= aRet
.getArray();
335 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
337 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
340 sal_Int32
* pSeq
= aRet
.getArray();
341 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
342 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::TOP
;
343 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::BOTTOM
;
344 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::LEFT
;
345 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::RIGHT
;
346 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::CENTER
;
348 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
351 sal_Int32
* pSeq
= aRet
.getArray();
352 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
354 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
357 sal_Int32
* pSeq
= aRet
.getArray();
358 *pSeq
++ = ::com::sun::star::chart::DataLabelPlacement::OUTSIDE
;
362 OSL_ENSURE( false, "unknown charttype" );
368 sal_Bool
ChartTypeHelper::isSupportingRightAngledAxes( const uno::Reference
< chart2::XChartType
>& xChartType
)
372 rtl::OUString aChartTypeName
= xChartType
->getChartType();
373 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
379 bool ChartTypeHelper::isSupportingStartingAngle( const uno::Reference
< chart2::XChartType
>& xChartType
)
383 rtl::OUString aChartTypeName
= xChartType
->getChartType();
384 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
389 bool ChartTypeHelper::isSupportingBaseValue( const uno::Reference
< chart2::XChartType
>& xChartType
)
393 rtl::OUString aChartTypeName
= xChartType
->getChartType();
394 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
)
395 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
)
396 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
)
403 bool ChartTypeHelper::isSupportingAxisPositioning( const uno::Reference
< chart2::XChartType
>& xChartType
, sal_Int32 nDimensionCount
, sal_Int32 nDimensionIndex
)
407 rtl::OUString aChartTypeName
= xChartType
->getChartType();
408 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) )
410 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
413 if( nDimensionCount
==3 )
414 return nDimensionIndex
<2;
418 bool ChartTypeHelper::shiftTicksAtXAxisPerDefault( const uno::Reference
< chart2::XChartType
>& xChartType
)
422 rtl::OUString aChartTypeName
= xChartType
->getChartType();
423 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
)
424 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) )
430 bool ChartTypeHelper::noBordersForSimpleScheme( const uno::Reference
< chart2::XChartType
>& xChartType
)
434 rtl::OUString aChartTypeName
= xChartType
->getChartType();
435 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
442 sal_Int32
ChartTypeHelper::getDefaultDirectLightColor( bool bSimple
, const uno::Reference
< chart2::XChartType
>& xChartType
)
444 sal_Int32 nRet
= static_cast< sal_Int32
>( 0x808080 ); // grey
445 if( xChartType
.is() )
447 rtl::OUString aChartType
= xChartType
->getChartType();
448 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
451 nRet
= static_cast< sal_Int32
>( 0x333333 ); // grey80
453 nRet
= static_cast< sal_Int32
>( 0xb3b3b3 ); // grey30
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
463 sal_Int32
ChartTypeHelper::getDefaultAmbientLightColor( bool bSimple
, const uno::Reference
< chart2::XChartType
>& xChartType
)
465 sal_Int32 nRet
= static_cast< sal_Int32
>( 0x999999 ); // grey40
466 if( xChartType
.is() )
468 rtl::OUString aChartType
= xChartType
->getChartType();
469 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
472 nRet
= static_cast< sal_Int32
>( 0xcccccc ); // grey20
474 nRet
= static_cast< sal_Int32
>( 0x666666 ); // grey60
480 drawing::Direction3D
ChartTypeHelper::getDefaultSimpleLightDirection( const uno::Reference
< chart2::XChartType
>& xChartType
)
482 drawing::Direction3D
aRet(0.0, 0.0, 1.0);
483 if( xChartType
.is() )
485 rtl::OUString aChartType
= xChartType
->getChartType();
486 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
487 aRet
= drawing::Direction3D(0.0, 0.8, 0.5);
488 else if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_LINE
)
489 || aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
490 aRet
= drawing::Direction3D(0.9, 0.5, 0.05);
495 drawing::Direction3D
ChartTypeHelper::getDefaultRealisticLightDirection( const uno::Reference
< chart2::XChartType
>& xChartType
)
497 drawing::Direction3D
aRet(0.0, 0.0, 1.0);
498 if( xChartType
.is() )
500 rtl::OUString aChartType
= xChartType
->getChartType();
501 if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) )
502 aRet
= drawing::Direction3D(0.6, 0.6, 0.6);
503 else if( aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_LINE
)
504 || aChartType
.equals(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
505 aRet
= drawing::Direction3D(0.9, 0.5, 0.05);
510 sal_Int32
ChartTypeHelper::getAxisType( const uno::Reference
<
511 XChartType
>& xChartType
, sal_Int32 nDimensionIndex
)
513 //retruned is a constant from constant group ::com::sun::star::chart2::AxisType
515 //@todo ask charttype itself --> need model change first
517 return AxisType::CATEGORY
;
519 rtl::OUString aChartTypeName
= xChartType
->getChartType();
520 if(2==nDimensionIndex
)//z-axis
521 return AxisType::SERIES
;
522 if(1==nDimensionIndex
)//y-axis
523 return AxisType::REALNUMBER
;
524 if(0==nDimensionIndex
)//x-axis
526 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
)
527 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
528 return AxisType::REALNUMBER
;
529 return AxisType::CATEGORY
;
531 return AxisType::CATEGORY
;
534 sal_Int32
ChartTypeHelper::getNumberOfDisplayedSeries(
535 const uno::Reference
< XChartType
>& xChartType
,
536 sal_Int32 nNumberOfSeries
)
538 if( xChartType
.is() )
542 rtl::OUString aChartTypeName
= xChartType
->getChartType();
543 if( aChartTypeName
.equals(CHART2_SERVICE_NAME_CHARTTYPE_PIE
))
545 uno::Reference
< beans::XPropertySet
> xChartTypeProp( xChartType
, uno::UNO_QUERY_THROW
);
547 if( (xChartTypeProp
->getPropertyValue( C2U("UseRings")) >>= bDonut
)
550 return nNumberOfSeries
>0 ? 1 : 0;
554 catch( const uno::Exception
& ex
)
556 ASSERT_EXCEPTION( ex
);
559 return nNumberOfSeries
;
562 uno::Sequence
< sal_Int32
> ChartTypeHelper::getSupportedMissingValueTreatments( const uno::Reference
< XChartType
>& xChartType
)
564 uno::Sequence
< sal_Int32
> aRet
;
565 if( !xChartType
.is() )
568 bool bStacked
= false;
570 bool bAmbiguous
=false;
571 StackMode eStackMode
= DiagramHelper::getStackModeFromChartType( xChartType
, bFound
, bAmbiguous
, 0 );
572 bStacked
= bFound
&& (StackMode_Y_STACKED
== eStackMode
);
574 rtl::OUString aChartTypeName
= xChartType
->getChartType();
575 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN
) ||
576 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR
) ||
577 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
580 sal_Int32
* pSeq
= aRet
.getArray();
581 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP
;
582 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
584 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
) )
586 aRet
.realloc( bStacked
? 1 : 2 );
587 sal_Int32
* pSeq
= aRet
.getArray();
588 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
590 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::CONTINUE
;
592 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) ||
593 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_NET
) ||
594 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
596 aRet
.realloc( bStacked
? 2 : 3 );
597 sal_Int32
* pSeq
= aRet
.getArray();
598 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP
;
599 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
601 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::CONTINUE
;
603 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) )
606 sal_Int32
* pSeq
= aRet
.getArray();
607 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::CONTINUE
;
608 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP
;
609 *pSeq
++ = ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
;
611 else if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_PIE
) ||
612 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
618 OSL_ENSURE( false, "unknown charttype" );
624 bool ChartTypeHelper::isSeriesInFrontOfAxisLine( const uno::Reference
< XChartType
>& xChartType
)
626 if( xChartType
.is() )
628 rtl::OUString aChartTypeName
= xChartType
->getChartType();
629 if( aChartTypeName
.match( CHART2_SERVICE_NAME_CHARTTYPE_FILLED_NET
) )
635 rtl::OUString
ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( const uno::Reference
< XChartType
>& xChartType
)
637 rtl::OUString
aRet( C2U( "values-y" ) );
638 if( !xChartType
.is() )
640 rtl::OUString aChartTypeName
= xChartType
->getChartType();
641 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
) )
642 aRet
= xChartType
->getRoleOfSequenceForSeriesLabel();
646 rtl::OUString
ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( const uno::Reference
< XChartType
>& xChartType
)
648 rtl::OUString
aRet( C2U( "values-y" ) );
649 if( !xChartType
.is() )
651 rtl::OUString aChartTypeName
= xChartType
->getChartType();
652 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
)
653 || aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
654 aRet
= xChartType
->getRoleOfSequenceForSeriesLabel();
658 bool ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( const uno::Reference
< XChartType
>& xChartType
)
661 rtl::OUString aChartTypeName
= xChartType
->getChartType();
662 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE
) )
667 bool ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( const uno::Reference
< XChartType
>& xChartType
)
670 if( !xChartType
.is() )
673 rtl::OUString aChartTypeName
= xChartType
->getChartType();
674 if( aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE
) ||
675 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER
) ||
676 aChartTypeName
.match(CHART2_SERVICE_NAME_CHARTTYPE_AREA
) )
683 //.............................................................................
685 //.............................................................................