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: StatisticsItemConverter.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"
33 #include "StatisticsItemConverter.hxx"
34 #include "SchWhichPairs.hxx"
36 #include "RegressionCurveHelper.hxx"
37 #include "ItemPropertyMap.hxx"
38 #include "ErrorBar.hxx"
39 #include "PropertyHelper.hxx"
40 #include "ChartModelHelper.hxx"
41 #include "ChartTypeHelper.hxx"
42 #include "StatisticsHelper.hxx"
44 #include "GraphicPropertyItemConverter.hxx"
46 #include <svtools/stritem.hxx>
47 #include <svx/chrtitem.hxx>
48 #include <svtools/intitem.hxx>
49 #include <rtl/math.hxx>
51 #include <com/sun/star/chart2/DataPointLabel.hpp>
52 #include <com/sun/star/chart2/XInternalDataProvider.hpp>
53 #include <com/sun/star/chart/ErrorBarStyle.hpp>
54 #include <com/sun/star/lang/XServiceName.hpp>
60 using namespace ::com::sun::star
;
65 uno::Reference
< beans::XPropertySet
> lcl_GetYErrorBar(
66 const uno::Reference
< beans::XPropertySet
> & xProp
)
68 uno::Reference
< beans::XPropertySet
> xResult
;
73 ( xProp
->getPropertyValue( C2U( "ErrorBarY" )) >>= xResult
);
75 catch( uno::Exception
& ex
)
77 ASSERT_EXCEPTION( ex
);
83 ::chart::RegressionCurveHelper::tRegressionType
lcl_convertRegressionType( SvxChartRegress eRegress
)
85 ::chart::RegressionCurveHelper::tRegressionType eType
= ::chart::RegressionCurveHelper::REGRESSION_TYPE_NONE
;
88 case CHREGRESS_LINEAR
:
89 eType
= ::chart::RegressionCurveHelper::REGRESSION_TYPE_LINEAR
;
92 eType
= ::chart::RegressionCurveHelper::REGRESSION_TYPE_LOG
;
95 eType
= ::chart::RegressionCurveHelper::REGRESSION_TYPE_EXP
;
98 eType
= ::chart::RegressionCurveHelper::REGRESSION_TYPE_POWER
;
107 uno::Reference
< beans::XPropertySet
> lcl_GetDefaultErrorBar()
109 // todo: use a valid context
110 return uno::Reference
< beans::XPropertySet
>(
111 ::chart::createErrorBar( uno::Reference
< uno::XComponentContext
>()));
114 void lcl_getErrorValues( const uno::Reference
< beans::XPropertySet
> & xErrorBarProp
,
115 double & rOutPosError
, double & rOutNegError
)
117 if( ! xErrorBarProp
.is())
122 xErrorBarProp
->getPropertyValue( C2U( "PositiveError" )) >>= rOutPosError
;
123 xErrorBarProp
->getPropertyValue( C2U( "NegativeError" )) >>= rOutNegError
;
125 catch( uno::Exception
& ex
)
127 ASSERT_EXCEPTION( ex
);
131 void lcl_getErrorIndicatorValues(
132 const uno::Reference
< beans::XPropertySet
> & xErrorBarProp
,
133 bool & rOutShowPosError
, bool & rOutShowNegError
)
135 if( ! xErrorBarProp
.is())
140 xErrorBarProp
->getPropertyValue( C2U( "ShowPositiveError" )) >>= rOutShowPosError
;
141 xErrorBarProp
->getPropertyValue( C2U( "ShowNegativeError" )) >>= rOutShowNegError
;
143 catch( uno::Exception
& ex
)
145 ASSERT_EXCEPTION( ex
);
149 uno::Reference
< beans::XPropertySet
> lcl_getEquationProperties(
150 const uno::Reference
< beans::XPropertySet
> & xSeriesPropSet
, const SfxItemSet
* pItemSet
)
152 bool bEquationExists
= true;
154 // ensure that a trendline is on
157 SvxChartRegress eRegress
= CHREGRESS_NONE
;
158 const SfxPoolItem
*pPoolItem
= NULL
;
159 if( pItemSet
->GetItemState( SCHATTR_REGRESSION_TYPE
, TRUE
, &pPoolItem
) == SFX_ITEM_SET
)
161 eRegress
= static_cast< const SvxChartRegressItem
* >( pPoolItem
)->GetValue();
162 bEquationExists
= ( eRegress
!= CHREGRESS_NONE
);
166 if( bEquationExists
)
168 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropSet
, uno::UNO_QUERY
);
169 uno::Reference
< chart2::XRegressionCurve
> xCurve(
170 ::chart::RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt
));
173 return xCurve
->getEquationProperties();
177 return uno::Reference
< beans::XPropertySet
>();
180 } // anonymous namespace
187 StatisticsItemConverter::StatisticsItemConverter(
188 const uno::Reference
< frame::XModel
> & xModel
,
189 const uno::Reference
< beans::XPropertySet
> & rPropertySet
,
190 SfxItemPool
& rItemPool
) :
191 ItemConverter( rPropertySet
, rItemPool
),
194 OSL_ASSERT( static_cast< int >( RegressionCurveHelper::REGRESSION_TYPE_NONE
) ==
195 static_cast< int >( CHREGRESS_NONE
));
196 OSL_ASSERT( static_cast< int >( RegressionCurveHelper::REGRESSION_TYPE_LINEAR
) ==
197 static_cast< int >( CHREGRESS_LINEAR
));
198 OSL_ASSERT( static_cast< int >( RegressionCurveHelper::REGRESSION_TYPE_LOG
) ==
199 static_cast< int >( CHREGRESS_LOG
));
200 OSL_ASSERT( static_cast< int >( RegressionCurveHelper::REGRESSION_TYPE_EXP
) ==
201 static_cast< int >( CHREGRESS_EXP
));
202 OSL_ASSERT( static_cast< int >( RegressionCurveHelper::REGRESSION_TYPE_POWER
) ==
203 static_cast< int >( CHREGRESS_POWER
));
206 StatisticsItemConverter::~StatisticsItemConverter()
209 const USHORT
* StatisticsItemConverter::GetWhichPairs() const
211 // must span all used items!
212 return nStatWhichPairs
;
215 bool StatisticsItemConverter::GetItemProperty(
216 tWhichIdType
/* nWhichId */,
217 tPropertyNameWithMemberId
& /* rOutProperty */ ) const
222 bool StatisticsItemConverter::ApplySpecialItem(
223 USHORT nWhichId
, const SfxItemSet
& rItemSet
)
224 throw( uno::Exception
)
226 bool bChanged
= false;
231 case SCHATTR_STAT_AVERAGE
:
233 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt(
234 GetPropertySet(), uno::UNO_QUERY
);
235 bool bOldHasMeanValueLine
= RegressionCurveHelper::hasMeanValueLine( xRegCnt
);
237 bool bNewHasMeanValueLine
=
238 static_cast< const SfxBoolItem
& >( rItemSet
.Get( nWhichId
)).GetValue();
240 if( bOldHasMeanValueLine
!= bNewHasMeanValueLine
)
242 if( ! bNewHasMeanValueLine
)
243 RegressionCurveHelper::removeMeanValueLine( xRegCnt
);
245 RegressionCurveHelper::addMeanValueLine(
246 xRegCnt
, uno::Reference
< uno::XComponentContext
>(), GetPropertySet() );
252 // Attention !!! This case must be passed before SCHATTR_STAT_PERCENT,
253 // SCHATTR_STAT_BIGERROR, SCHATTR_STAT_CONSTPLUS,
254 // SCHATTR_STAT_CONSTMINUS and SCHATTR_STAT_INDICATE
255 case SCHATTR_STAT_KIND_ERROR
:
257 uno::Reference
< beans::XPropertySet
> xErrorBarProp(
258 lcl_GetYErrorBar( GetPropertySet() ));
260 SvxChartKindError eErrorKind
=
261 static_cast< const SvxChartKindErrorItem
& >(
262 rItemSet
.Get( nWhichId
)).GetValue();
264 if( !xErrorBarProp
.is() && eErrorKind
== CHERROR_NONE
)
270 sal_Int32 nStyle
= ::com::sun::star::chart::ErrorBarStyle::NONE
;
275 nStyle
= ::com::sun::star::chart::ErrorBarStyle::NONE
; break;
276 case CHERROR_VARIANT
:
277 nStyle
= ::com::sun::star::chart::ErrorBarStyle::VARIANCE
; break;
279 nStyle
= ::com::sun::star::chart::ErrorBarStyle::STANDARD_DEVIATION
; break;
280 case CHERROR_PERCENT
:
281 nStyle
= ::com::sun::star::chart::ErrorBarStyle::RELATIVE
; break;
282 case CHERROR_BIGERROR
:
283 nStyle
= ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN
; break;
285 nStyle
= ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
; break;
286 case CHERROR_STDERROR
:
287 nStyle
= ::com::sun::star::chart::ErrorBarStyle::STANDARD_ERROR
; break;
289 nStyle
= ::com::sun::star::chart::ErrorBarStyle::FROM_DATA
; break;
292 if( !xErrorBarProp
.is() )
294 xErrorBarProp
= lcl_GetDefaultErrorBar();
295 GetPropertySet()->setPropertyValue(
296 C2U( "ErrorBarY" ), uno::makeAny( xErrorBarProp
));
299 xErrorBarProp
->setPropertyValue( C2U( "ErrorBarStyle" ),
300 uno::makeAny( nStyle
));
306 case SCHATTR_STAT_PERCENT
:
307 case SCHATTR_STAT_BIGERROR
:
309 OSL_ENSURE( false, "Deprectaed item" );
310 uno::Reference
< beans::XPropertySet
> xErrorBarProp(
311 lcl_GetYErrorBar( GetPropertySet()));
312 bool bOldHasErrorBar
= xErrorBarProp
.is();
315 static_cast< const SvxDoubleItem
& >(
316 rItemSet
.Get( nWhichId
)).GetValue();
318 lcl_getErrorValues( xErrorBarProp
, fPos
, fNeg
);
320 if( bOldHasErrorBar
&&
321 ! ( ::rtl::math::approxEqual( fPos
, fValue
) &&
322 ::rtl::math::approxEqual( fNeg
, fValue
)))
324 xErrorBarProp
->setPropertyValue( C2U( "PositiveError" ),
325 uno::makeAny( fValue
));
326 xErrorBarProp
->setPropertyValue( C2U( "NegativeError" ),
327 uno::makeAny( fValue
));
333 case SCHATTR_STAT_CONSTPLUS
:
335 uno::Reference
< beans::XPropertySet
> xErrorBarProp(
336 lcl_GetYErrorBar( GetPropertySet()));
337 bool bOldHasErrorBar
= xErrorBarProp
.is();
340 static_cast< const SvxDoubleItem
& >(
341 rItemSet
.Get( nWhichId
)).GetValue();
343 lcl_getErrorValues( xErrorBarProp
, fPos
, fNeg
);
345 if( bOldHasErrorBar
&&
346 ! ::rtl::math::approxEqual( fPos
, fValue
))
348 xErrorBarProp
->setPropertyValue( C2U( "PositiveError" ), uno::makeAny( fValue
));
354 case SCHATTR_STAT_CONSTMINUS
:
356 uno::Reference
< beans::XPropertySet
> xErrorBarProp(
357 lcl_GetYErrorBar( GetPropertySet()));
358 bool bOldHasErrorBar
= xErrorBarProp
.is();
361 static_cast< const SvxDoubleItem
& >(
362 rItemSet
.Get( nWhichId
)).GetValue();
364 lcl_getErrorValues( xErrorBarProp
, fPos
, fNeg
);
366 if( bOldHasErrorBar
&&
367 ! ::rtl::math::approxEqual( fNeg
, fValue
))
369 xErrorBarProp
->setPropertyValue( C2U( "NegativeError" ), uno::makeAny( fValue
));
375 case SCHATTR_REGRESSION_TYPE
:
377 SvxChartRegress eRegress
=
378 static_cast< const SvxChartRegressItem
& >(
379 rItemSet
.Get( nWhichId
)).GetValue();
381 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt(
382 GetPropertySet(), uno::UNO_QUERY
);
384 if( eRegress
== CHREGRESS_NONE
)
386 bChanged
= RegressionCurveHelper::removeAllExceptMeanValueLine( xRegCnt
);
390 SvxChartRegress
eOldRegress(
391 static_cast< SvxChartRegress
>(
392 static_cast< sal_Int32
>(
393 RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine( xRegCnt
))));
394 if( eOldRegress
!= eRegress
)
396 RegressionCurveHelper::replaceOrAddCurveAndReduceToOne(
397 lcl_convertRegressionType( eRegress
), xRegCnt
,
398 uno::Reference
< uno::XComponentContext
>());
405 case SCHATTR_REGRESSION_SHOW_EQUATION
:
407 uno::Reference
< beans::XPropertySet
> xEqProp( lcl_getEquationProperties( GetPropertySet(), &rItemSet
));
410 bool bShowEq
= false;
411 xEqProp
->getPropertyValue( C2U("ShowEquation")) >>= bShowEq
;
413 static_cast< const SfxBoolItem
& >( rItemSet
.Get( nWhichId
)).GetValue();
414 if( bShowEq
!= bNewShowEq
)
416 xEqProp
->setPropertyValue( C2U("ShowEquation"), uno::makeAny( bNewShowEq
));
423 case SCHATTR_REGRESSION_SHOW_COEFF
:
425 uno::Reference
< beans::XPropertySet
> xEqProp( lcl_getEquationProperties( GetPropertySet(), &rItemSet
));
428 bool bShowCoeff
= false;
429 xEqProp
->getPropertyValue( C2U("ShowCorrelationCoefficient")) >>= bShowCoeff
;
431 static_cast< const SfxBoolItem
& >( rItemSet
.Get( nWhichId
)).GetValue();
432 if( bShowCoeff
!= bNewShowCoeff
)
434 xEqProp
->setPropertyValue( C2U("ShowCorrelationCoefficient"), uno::makeAny( bNewShowCoeff
));
441 case SCHATTR_STAT_INDICATE
:
443 uno::Reference
< beans::XPropertySet
> xErrorBarProp(
444 lcl_GetYErrorBar( GetPropertySet()));
445 bool bOldHasErrorBar
= xErrorBarProp
.is();
447 SvxChartIndicate eIndicate
=
448 static_cast< const SvxChartIndicateItem
& >(
449 rItemSet
.Get( nWhichId
)).GetValue();
451 bool bNewIndPos
= (eIndicate
== CHINDICATE_BOTH
|| eIndicate
== CHINDICATE_UP
);
452 bool bNewIndNeg
= (eIndicate
== CHINDICATE_BOTH
|| eIndicate
== CHINDICATE_DOWN
);
454 bool bShowPos
, bShowNeg
;
455 lcl_getErrorIndicatorValues( xErrorBarProp
, bShowPos
, bShowNeg
);
457 if( bOldHasErrorBar
&&
458 ( bShowPos
!= bNewIndPos
||
459 bShowNeg
!= bNewIndNeg
))
461 xErrorBarProp
->setPropertyValue( C2U( "ShowPositiveError" ), uno::makeAny( bNewIndPos
));
462 xErrorBarProp
->setPropertyValue( C2U( "ShowNegativeError" ), uno::makeAny( bNewIndNeg
));
468 case SCHATTR_STAT_RANGE_POS
:
469 case SCHATTR_STAT_RANGE_NEG
:
471 // @todo: also be able to deal with x-error bars
472 const bool bYError
= true;
473 uno::Reference
< chart2::data::XDataSource
> xErrorBarSource( lcl_GetYErrorBar( GetPropertySet()), uno::UNO_QUERY
);
474 uno::Reference
< chart2::XChartDocument
> xChartDoc( m_xModel
, uno::UNO_QUERY
);
475 uno::Reference
< chart2::data::XDataProvider
> xDataProvider
;
478 xDataProvider
.set( xChartDoc
->getDataProvider());
479 if( xErrorBarSource
.is() && xDataProvider
.is())
481 ::rtl::OUString
aNewRange( static_cast< const SfxStringItem
& >( rItemSet
.Get( nWhichId
)).GetValue());
482 bool bApplyNewRange
= false;
484 bool bIsPositiveValue( nWhichId
== SCHATTR_STAT_RANGE_POS
);
485 if( xChartDoc
->hasInternalDataProvider())
487 if( aNewRange
.getLength())
489 uno::Reference
< chart2::data::XDataSequence
> xSeq(
490 StatisticsHelper::getErrorDataSequenceFromDataSource(
491 xErrorBarSource
, bIsPositiveValue
, bYError
));
494 // no data range for error bars yet => create
495 uno::Reference
< chart2::XInternalDataProvider
> xIntDataProvider( xDataProvider
, uno::UNO_QUERY
);
496 OSL_ASSERT( xIntDataProvider
.is());
497 if( xIntDataProvider
.is())
499 xIntDataProvider
->appendSequence();
500 aNewRange
= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("last"));
501 bApplyNewRange
= true;
508 uno::Reference
< chart2::data::XDataSequence
> xSeq(
509 StatisticsHelper::getErrorDataSequenceFromDataSource(
510 xErrorBarSource
, bIsPositiveValue
, bYError
));
512 ! ( xSeq
.is() && aNewRange
.equals( xSeq
->getSourceRangeRepresentation()));
516 StatisticsHelper::setErrorDataSequence(
517 xErrorBarSource
, xDataProvider
, aNewRange
, bIsPositiveValue
, bYError
);
526 void StatisticsItemConverter::FillSpecialItem(
527 USHORT nWhichId
, SfxItemSet
& rOutItemSet
) const
528 throw( uno::Exception
)
532 case SCHATTR_STAT_AVERAGE
:
534 SfxBoolItem( nWhichId
,
535 RegressionCurveHelper::hasMeanValueLine(
536 uno::Reference
< chart2::XRegressionCurveContainer
>(
537 GetPropertySet(), uno::UNO_QUERY
))));
540 case SCHATTR_STAT_KIND_ERROR
:
542 SvxChartKindError eErrorKind
= CHERROR_NONE
;
543 uno::Reference
< beans::XPropertySet
> xErrorBarProp(
544 lcl_GetYErrorBar( GetPropertySet()));
545 if( xErrorBarProp
.is() )
547 sal_Int32 nStyle
= 0;
548 if( xErrorBarProp
->getPropertyValue( C2U( "ErrorBarStyle" )) >>= nStyle
)
552 case ::com::sun::star::chart::ErrorBarStyle::NONE
:
554 case ::com::sun::star::chart::ErrorBarStyle::VARIANCE
:
555 eErrorKind
= CHERROR_VARIANT
; break;
556 case ::com::sun::star::chart::ErrorBarStyle::STANDARD_DEVIATION
:
557 eErrorKind
= CHERROR_SIGMA
; break;
558 case ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE
:
559 eErrorKind
= CHERROR_CONST
; break;
560 case ::com::sun::star::chart::ErrorBarStyle::RELATIVE
:
561 eErrorKind
= CHERROR_PERCENT
; break;
562 case ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN
:
563 eErrorKind
= CHERROR_BIGERROR
; break;
564 case ::com::sun::star::chart::ErrorBarStyle::STANDARD_ERROR
:
565 eErrorKind
= CHERROR_STDERROR
; break;
566 case ::com::sun::star::chart::ErrorBarStyle::FROM_DATA
:
567 eErrorKind
= CHERROR_RANGE
; break;
571 rOutItemSet
.Put( SvxChartKindErrorItem( eErrorKind
, SCHATTR_STAT_KIND_ERROR
));
575 case SCHATTR_STAT_PERCENT
:
577 uno::Reference
< beans::XPropertySet
> xErrorBarProp( lcl_GetYErrorBar( GetPropertySet()));
578 if( xErrorBarProp
.is())
581 lcl_getErrorValues( xErrorBarProp
, fPos
, fNeg
);
582 rOutItemSet
.Put( SvxDoubleItem( ( fPos
+ fNeg
) / 2.0, nWhichId
));
587 case SCHATTR_STAT_BIGERROR
:
589 uno::Reference
< beans::XPropertySet
> xErrorBarProp( lcl_GetYErrorBar( GetPropertySet()));
590 if( xErrorBarProp
.is())
593 lcl_getErrorValues( xErrorBarProp
, fPos
, fNeg
);
594 rOutItemSet
.Put( SvxDoubleItem( ( fPos
+ fNeg
) / 2.0, nWhichId
));
599 case SCHATTR_STAT_CONSTPLUS
:
601 uno::Reference
< beans::XPropertySet
> xErrorBarProp( lcl_GetYErrorBar( GetPropertySet()));
602 if( xErrorBarProp
.is())
605 lcl_getErrorValues( xErrorBarProp
, fPos
, fNeg
);
606 rOutItemSet
.Put( SvxDoubleItem( fPos
, nWhichId
));
611 case SCHATTR_STAT_CONSTMINUS
:
613 uno::Reference
< beans::XPropertySet
> xErrorBarProp( lcl_GetYErrorBar( GetPropertySet()));
614 if( xErrorBarProp
.is())
617 lcl_getErrorValues( xErrorBarProp
, fPos
, fNeg
);
618 rOutItemSet
.Put( SvxDoubleItem( fNeg
, nWhichId
));
623 case SCHATTR_REGRESSION_TYPE
:
625 SvxChartRegress eRegress
= static_cast< SvxChartRegress
>(
626 static_cast< sal_Int32
>(
627 RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine(
628 uno::Reference
< chart2::XRegressionCurveContainer
>(
629 GetPropertySet(), uno::UNO_QUERY
) )));
630 rOutItemSet
.Put( SvxChartRegressItem( eRegress
, SCHATTR_REGRESSION_TYPE
));
634 case SCHATTR_REGRESSION_SHOW_EQUATION
:
636 bool bShowEq
= false;
637 uno::Reference
< beans::XPropertySet
> xEqProp( lcl_getEquationProperties( GetPropertySet(), 0 ));
639 xEqProp
->getPropertyValue( C2U("ShowEquation")) >>= bShowEq
;
640 rOutItemSet
.Put( SfxBoolItem( nWhichId
, bShowEq
));
644 case SCHATTR_REGRESSION_SHOW_COEFF
:
646 bool bShowCoeff
= false;
647 uno::Reference
< beans::XPropertySet
> xEqProp( lcl_getEquationProperties( GetPropertySet(), 0 ));
649 xEqProp
->getPropertyValue( C2U("ShowCorrelationCoefficient")) >>= bShowCoeff
;
650 rOutItemSet
.Put( SfxBoolItem( nWhichId
, bShowCoeff
));
654 case SCHATTR_STAT_INDICATE
:
656 uno::Reference
< beans::XPropertySet
> xErrorBarProp( lcl_GetYErrorBar( GetPropertySet()));
657 SvxChartIndicate eIndicate
= CHINDICATE_BOTH
;
658 if( xErrorBarProp
.is())
660 bool bShowPos
, bShowNeg
;
661 lcl_getErrorIndicatorValues( xErrorBarProp
, bShowPos
, bShowNeg
);
666 eIndicate
= CHINDICATE_BOTH
;
668 eIndicate
= CHINDICATE_UP
;
673 eIndicate
= CHINDICATE_DOWN
;
675 eIndicate
= CHINDICATE_NONE
;
678 rOutItemSet
.Put( SvxChartIndicateItem( eIndicate
, SCHATTR_STAT_INDICATE
));
682 case SCHATTR_STAT_RANGE_POS
:
683 case SCHATTR_STAT_RANGE_NEG
:
685 uno::Reference
< chart2::data::XDataSource
> xErrorBarSource( lcl_GetYErrorBar( GetPropertySet()), uno::UNO_QUERY
);
686 if( xErrorBarSource
.is())
688 uno::Reference
< chart2::data::XDataSequence
> xSeq(
689 StatisticsHelper::getErrorDataSequenceFromDataSource(
690 xErrorBarSource
, (nWhichId
== SCHATTR_STAT_RANGE_POS
) /*, true */ /* y */ ));
692 rOutItemSet
.Put( SfxStringItem( nWhichId
, String( xSeq
->getSourceRangeRepresentation())));
699 } // namespace wrapper