1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "WrappedStatisticProperties.hxx"
21 #include "WrappedSeriesOrDiagramProperty.hxx"
22 #include <FastPropertyIdRanges.hxx>
23 #include <RegressionCurveHelper.hxx>
24 #include <ErrorBar.hxx>
25 #include <StatisticsHelper.hxx>
26 #include <unonames.hxx>
28 #include <com/sun/star/beans/PropertyAttribute.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/chart/ChartErrorCategory.hpp>
31 #include <com/sun/star/chart/ErrorBarStyle.hpp>
32 #include <com/sun/star/chart/ChartErrorIndicatorType.hpp>
33 #include <com/sun/star/chart/ChartRegressionCurveType.hpp>
34 #include <com/sun/star/chart2/XChartDocument.hpp>
35 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
36 #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
39 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ namespace data
{ class XDataProvider
; } } } } }
41 using namespace ::com::sun::star
;
42 using ::com::sun::star::uno::Any
;
43 using ::com::sun::star::uno::Reference
;
44 using ::com::sun::star::beans::Property
;
54 Any
lcl_getRegressionDefault()
57 aRet
<<= css::chart::ChartRegressionCurveType_NONE
;
61 css::chart::ChartRegressionCurveType
lcl_getRegressionCurveType(SvxChartRegress eRegressionType
)
63 css::chart::ChartRegressionCurveType eRet
= css::chart::ChartRegressionCurveType_NONE
;
64 switch(eRegressionType
)
66 case SvxChartRegress::Linear
:
67 eRet
= css::chart::ChartRegressionCurveType_LINEAR
;
69 case SvxChartRegress::Log
:
70 eRet
= css::chart::ChartRegressionCurveType_LOGARITHM
;
72 case SvxChartRegress::Exp
:
73 eRet
= css::chart::ChartRegressionCurveType_EXPONENTIAL
;
75 case SvxChartRegress::Power
:
76 eRet
= css::chart::ChartRegressionCurveType_POWER
;
78 case SvxChartRegress::Polynomial
:
79 eRet
= css::chart::ChartRegressionCurveType_POLYNOMIAL
;
81 /*case SvxChartRegress::MovingAverage:
82 eRet = css::chart::ChartRegressionCurveType_MOVING_AVERAGE;
85 eRet
= css::chart::ChartRegressionCurveType_NONE
;
91 SvxChartRegress
lcl_getRegressionType( css::chart::ChartRegressionCurveType eRegressionCurveType
)
94 switch (eRegressionCurveType
)
96 case css::chart::ChartRegressionCurveType_LINEAR
:
97 eRet
= SvxChartRegress::Linear
;
99 case css::chart::ChartRegressionCurveType_LOGARITHM
:
100 eRet
= SvxChartRegress::Log
;
102 case css::chart::ChartRegressionCurveType_EXPONENTIAL
:
103 eRet
= SvxChartRegress::Exp
;
105 case css::chart::ChartRegressionCurveType_POLYNOMIAL
:
106 //case css::chart::ChartRegressionCurveType_MOVING_AVERAGE:
107 case css::chart::ChartRegressionCurveType_POWER
:
108 eRet
= SvxChartRegress::Power
;
111 eRet
= SvxChartRegress::NONE
;
117 sal_Int32
lcl_getErrorBarStyle( const uno::Reference
< beans::XPropertySet
>& xErrorBarProperties
)
119 sal_Int32 nStyle
= css::chart::ErrorBarStyle::NONE
;
120 if(xErrorBarProperties
.is())
121 xErrorBarProperties
->getPropertyValue( "ErrorBarStyle" ) >>= nStyle
;
125 uno::Reference
< chart2::data::XDataProvider
> lcl_getDataProviderFromContact(
126 const std::shared_ptr
< Chart2ModelContact
>& spChart2ModelContact
)
128 uno::Reference
< chart2::data::XDataProvider
> xResult
;
129 if( spChart2ModelContact
.get())
131 uno::Reference
< chart2::XChartDocument
> xChartDoc(
132 spChart2ModelContact
->getChart2Document());
134 xResult
.set( xChartDoc
->getDataProvider());
139 void lcl_ConvertRangeFromXML(
140 OUString
& rInOutRange
,
141 const std::shared_ptr
< Chart2ModelContact
>& spChart2ModelContact
)
143 if( !rInOutRange
.isEmpty())
145 uno::Reference
< chart2::data::XRangeXMLConversion
> xConverter(
146 lcl_getDataProviderFromContact( spChart2ModelContact
), uno::UNO_QUERY
);
149 OUString aResult
= xConverter
->convertRangeFromXML( rInOutRange
);
150 rInOutRange
= aResult
;
155 void lcl_ConvertRangeToXML(
156 OUString
& rInOutRange
,
157 const std::shared_ptr
< Chart2ModelContact
>& spChart2ModelContact
)
159 if( !rInOutRange
.isEmpty())
161 uno::Reference
< chart2::data::XRangeXMLConversion
> xConverter(
162 lcl_getDataProviderFromContact( spChart2ModelContact
), uno::UNO_QUERY
);
165 OUString aResult
= xConverter
->convertRangeToXML( rInOutRange
);
166 rInOutRange
= aResult
;
171 }//anonymous namespace
173 template< typename PROPERTYTYPE
>
174 class WrappedStatisticProperty
: public WrappedSeriesOrDiagramProperty
< PROPERTYTYPE
>
177 explicit WrappedStatisticProperty(
178 const OUString
& rName
, const Any
& rDefaulValue
,
179 const std::shared_ptr
<Chart2ModelContact
>& spChart2ModelContact
,
180 tSeriesOrDiagramPropertyType ePropertyType
)
181 : WrappedSeriesOrDiagramProperty
<PROPERTYTYPE
>(rName
, rDefaulValue
, spChart2ModelContact
,
186 static uno::Reference
< beans::XPropertySet
> getOrCreateErrorBarProperties( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
)
188 if(!xSeriesPropertySet
.is())
190 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
191 xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
;
192 if( !xErrorBarProperties
.is() )
194 xErrorBarProperties
= new ::chart::ErrorBar
;
195 //default in new and old api are different
196 xErrorBarProperties
->setPropertyValue( "ShowPositiveError" , uno::Any(false) );
197 xErrorBarProperties
->setPropertyValue( "ShowNegativeError" , uno::Any(false) );
198 xErrorBarProperties
->setPropertyValue( "ErrorBarStyle" , uno::Any(css::chart::ErrorBarStyle::NONE
) );
199 xSeriesPropertySet
->setPropertyValue( CHART_UNONAME_ERRORBAR_Y
, uno::Any( xErrorBarProperties
) );
201 return xErrorBarProperties
;
206 //PROP_CHART_STATISTIC_CONST_ERROR_LOW
207 class WrappedConstantErrorLowProperty
: public WrappedStatisticProperty
< double >
210 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
211 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const override
;
213 explicit WrappedConstantErrorLowProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
214 tSeriesOrDiagramPropertyType ePropertyType
);
217 mutable Any m_aOuterValue
;
220 WrappedConstantErrorLowProperty::WrappedConstantErrorLowProperty(
221 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
222 tSeriesOrDiagramPropertyType ePropertyType
)
223 : WrappedStatisticProperty
< double >( "ConstantErrorLow"
224 , uno::Any( 0.0 ), std::move(spChart2ModelContact
), ePropertyType
)
228 double WrappedConstantErrorLowProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
231 m_aDefaultValue
>>= aRet
;
232 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
233 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
235 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::ABSOLUTE
)
236 xErrorBarProperties
->getPropertyValue( "NegativeError" ) >>= aRet
;
238 m_aOuterValue
>>= aRet
;
243 void WrappedConstantErrorLowProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
245 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
246 if( xErrorBarProperties
.is() )
248 m_aOuterValue
<<= aNewValue
;
249 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::ABSOLUTE
)
251 xErrorBarProperties
->setPropertyValue( "NegativeError", m_aOuterValue
);
256 //PROP_CHART_STATISTIC_CONST_ERROR_HIGH
257 class WrappedConstantErrorHighProperty
: public WrappedStatisticProperty
< double >
260 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
261 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const override
;
263 explicit WrappedConstantErrorHighProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
264 tSeriesOrDiagramPropertyType ePropertyType
);
267 mutable Any m_aOuterValue
;
270 WrappedConstantErrorHighProperty::WrappedConstantErrorHighProperty(
271 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
272 tSeriesOrDiagramPropertyType ePropertyType
)
273 : WrappedStatisticProperty
< double >( "ConstantErrorHigh"
274 , uno::Any( 0.0 ), std::move(spChart2ModelContact
), ePropertyType
)
278 double WrappedConstantErrorHighProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
281 m_aDefaultValue
>>= aRet
;
282 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
283 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
285 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::ABSOLUTE
)
286 xErrorBarProperties
->getPropertyValue( "PositiveError" ) >>= aRet
;
288 m_aOuterValue
>>= aRet
;
293 void WrappedConstantErrorHighProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
295 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
296 if( xErrorBarProperties
.is() )
298 m_aOuterValue
<<= aNewValue
;
299 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::ABSOLUTE
)
301 xErrorBarProperties
->setPropertyValue( "PositiveError" , m_aOuterValue
);
306 //PROP_CHART_STATISTIC_MEAN_VALUE
307 class WrappedMeanValueProperty
: public WrappedStatisticProperty
< bool >
310 virtual bool getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
311 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const bool& aNewValue
) const override
;
313 explicit WrappedMeanValueProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
314 tSeriesOrDiagramPropertyType ePropertyType
);
317 WrappedMeanValueProperty::WrappedMeanValueProperty(
318 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
319 tSeriesOrDiagramPropertyType ePropertyType
)
320 : WrappedStatisticProperty
< bool >( "MeanValue", uno::Any( false ), std::move(spChart2ModelContact
), ePropertyType
)
324 bool WrappedMeanValueProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
327 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
329 bRet
= RegressionCurveHelper::hasMeanValueLine( xRegCnt
);
333 void WrappedMeanValueProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const bool& aNewValue
) const
335 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
339 RegressionCurveHelper::addMeanValueLine( xRegCnt
, nullptr );
341 RegressionCurveHelper::removeMeanValueLine( xRegCnt
);
345 //PROP_CHART_STATISTIC_ERROR_CATEGORY
346 // deprecated, replaced by ErrorBarStyle
347 class WrappedErrorCategoryProperty
: public WrappedStatisticProperty
< css::chart::ChartErrorCategory
>
350 virtual css::chart::ChartErrorCategory
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
351 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const css::chart::ChartErrorCategory
& aNewValue
) const override
;
353 explicit WrappedErrorCategoryProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
354 tSeriesOrDiagramPropertyType ePropertyType
);
357 WrappedErrorCategoryProperty::WrappedErrorCategoryProperty(
358 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
359 tSeriesOrDiagramPropertyType ePropertyType
)
360 : WrappedStatisticProperty
< css::chart::ChartErrorCategory
>( "ErrorCategory"
361 , uno::Any( css::chart::ChartErrorCategory_NONE
), std::move(spChart2ModelContact
), ePropertyType
)
365 css::chart::ChartErrorCategory
WrappedErrorCategoryProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
367 css::chart::ChartErrorCategory aRet
= css::chart::ChartErrorCategory_NONE
;
368 m_aDefaultValue
>>= aRet
;
369 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
370 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
372 sal_Int32 nStyle
= css::chart::ErrorBarStyle::NONE
;
373 xErrorBarProperties
->getPropertyValue( "ErrorBarStyle" ) >>= nStyle
;
376 case css::chart::ErrorBarStyle::NONE
:
377 aRet
= css::chart::ChartErrorCategory_NONE
;
379 case css::chart::ErrorBarStyle::VARIANCE
:
380 aRet
= css::chart::ChartErrorCategory_VARIANCE
;
382 case css::chart::ErrorBarStyle::STANDARD_DEVIATION
:
383 aRet
= css::chart::ChartErrorCategory_STANDARD_DEVIATION
;
385 case css::chart::ErrorBarStyle::ABSOLUTE
:
386 aRet
= css::chart::ChartErrorCategory_CONSTANT_VALUE
;
388 case css::chart::ErrorBarStyle::RELATIVE
:
389 aRet
= css::chart::ChartErrorCategory_PERCENT
;
391 case css::chart::ErrorBarStyle::ERROR_MARGIN
:
392 aRet
= css::chart::ChartErrorCategory_ERROR_MARGIN
;
394 case css::chart::ErrorBarStyle::STANDARD_ERROR
:
396 case css::chart::ErrorBarStyle::FROM_DATA
:
404 void WrappedErrorCategoryProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const css::chart::ChartErrorCategory
& aNewValue
) const
406 if( !xSeriesPropertySet
.is() )
409 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
410 if( xErrorBarProperties
.is() )
412 sal_Int32 nNewStyle
= css::chart::ErrorBarStyle::NONE
;
415 case css::chart::ChartErrorCategory_NONE
:
416 nNewStyle
= css::chart::ErrorBarStyle::NONE
;
418 case css::chart::ChartErrorCategory_VARIANCE
:
419 nNewStyle
= css::chart::ErrorBarStyle::VARIANCE
;
421 case css::chart::ChartErrorCategory_STANDARD_DEVIATION
:
422 nNewStyle
= css::chart::ErrorBarStyle::STANDARD_DEVIATION
;
424 case css::chart::ChartErrorCategory_CONSTANT_VALUE
:
425 nNewStyle
= css::chart::ErrorBarStyle::ABSOLUTE
;
427 case css::chart::ChartErrorCategory_PERCENT
:
428 nNewStyle
= css::chart::ErrorBarStyle::RELATIVE
;
430 case css::chart::ChartErrorCategory_ERROR_MARGIN
:
431 nNewStyle
= css::chart::ErrorBarStyle::ERROR_MARGIN
;
436 xErrorBarProperties
->setPropertyValue( "ErrorBarStyle" , uno::Any(nNewStyle
) );
440 //PROP_CHART_STATISTIC_PERCENT_ERROR
441 class WrappedPercentageErrorProperty
: public WrappedStatisticProperty
< double >
444 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
445 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const override
;
447 explicit WrappedPercentageErrorProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
448 tSeriesOrDiagramPropertyType ePropertyType
);
451 mutable Any m_aOuterValue
;
454 WrappedPercentageErrorProperty::WrappedPercentageErrorProperty(
455 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
456 tSeriesOrDiagramPropertyType ePropertyType
)
457 : WrappedStatisticProperty
< double >( "PercentageError"
458 , uno::Any( 0.0 ), std::move(spChart2ModelContact
), ePropertyType
)
462 double WrappedPercentageErrorProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
465 m_aDefaultValue
>>= aRet
;
466 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
467 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
469 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::RELATIVE
)
470 xErrorBarProperties
->getPropertyValue( "PositiveError" ) >>= aRet
;
472 m_aOuterValue
>>= aRet
;
476 void WrappedPercentageErrorProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
478 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
479 if( xErrorBarProperties
.is() )
481 m_aOuterValue
<<= aNewValue
;
482 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::RELATIVE
)
484 xErrorBarProperties
->setPropertyValue( "PositiveError" , m_aOuterValue
);
485 xErrorBarProperties
->setPropertyValue( "NegativeError" , m_aOuterValue
);
490 //PROP_CHART_STATISTIC_ERROR_MARGIN
491 class WrappedErrorMarginProperty
: public WrappedStatisticProperty
< double >
494 virtual double getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
495 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const override
;
497 explicit WrappedErrorMarginProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
498 tSeriesOrDiagramPropertyType ePropertyType
);
501 mutable Any m_aOuterValue
;
504 WrappedErrorMarginProperty::WrappedErrorMarginProperty(
505 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
506 tSeriesOrDiagramPropertyType ePropertyType
)
507 : WrappedStatisticProperty
< double >( "ErrorMargin"
508 , uno::Any( 0.0 ), std::move(spChart2ModelContact
), ePropertyType
)
512 double WrappedErrorMarginProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
515 m_aDefaultValue
>>= aRet
;
516 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
517 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
519 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::ERROR_MARGIN
)
520 xErrorBarProperties
->getPropertyValue( "PositiveError" ) >>= aRet
;
522 m_aOuterValue
>>= aRet
;
526 void WrappedErrorMarginProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const double& aNewValue
) const
528 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
529 if( xErrorBarProperties
.is() )
531 m_aOuterValue
<<= aNewValue
;
532 if( lcl_getErrorBarStyle( xErrorBarProperties
) == css::chart::ErrorBarStyle::ERROR_MARGIN
)
534 xErrorBarProperties
->setPropertyValue( "PositiveError" , m_aOuterValue
);
535 xErrorBarProperties
->setPropertyValue( "NegativeError" , m_aOuterValue
);
540 //PROP_CHART_STATISTIC_ERROR_INDICATOR
541 class WrappedErrorIndicatorProperty
: public WrappedStatisticProperty
< css::chart::ChartErrorIndicatorType
>
544 virtual css::chart::ChartErrorIndicatorType
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
545 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const css::chart::ChartErrorIndicatorType
& aNewValue
) const override
;
547 explicit WrappedErrorIndicatorProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
548 tSeriesOrDiagramPropertyType ePropertyType
);
551 WrappedErrorIndicatorProperty::WrappedErrorIndicatorProperty(
552 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
553 tSeriesOrDiagramPropertyType ePropertyType
)
554 : WrappedStatisticProperty
< css::chart::ChartErrorIndicatorType
>( "ErrorIndicator"
555 , uno::Any( css::chart::ChartErrorIndicatorType_NONE
), std::move(spChart2ModelContact
), ePropertyType
)
559 css::chart::ChartErrorIndicatorType
WrappedErrorIndicatorProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
561 css::chart::ChartErrorIndicatorType aRet
= css::chart::ChartErrorIndicatorType_NONE
;
562 m_aDefaultValue
>>= aRet
;
563 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
564 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
566 bool bPositive
= false;
567 bool bNegative
= false;
568 xErrorBarProperties
->getPropertyValue( "ShowPositiveError" ) >>= bPositive
;
569 xErrorBarProperties
->getPropertyValue( "ShowNegativeError" ) >>= bNegative
;
571 if( bPositive
&& bNegative
)
572 aRet
= css::chart::ChartErrorIndicatorType_TOP_AND_BOTTOM
;
573 else if( bPositive
&& !bNegative
)
574 aRet
= css::chart::ChartErrorIndicatorType_UPPER
;
575 else if( !bPositive
&& bNegative
)
576 aRet
= css::chart::ChartErrorIndicatorType_LOWER
;
580 void WrappedErrorIndicatorProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const css::chart::ChartErrorIndicatorType
& aNewValue
) const
582 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
583 if( xErrorBarProperties
.is() )
585 bool bPositive
= false;
586 bool bNegative
= false;
589 case css::chart::ChartErrorIndicatorType_TOP_AND_BOTTOM
:
593 case css::chart::ChartErrorIndicatorType_UPPER
:
596 case css::chart::ChartErrorIndicatorType_LOWER
:
603 xErrorBarProperties
->setPropertyValue( "ShowPositiveError" , uno::Any(bPositive
) );
604 xErrorBarProperties
->setPropertyValue( "ShowNegativeError" , uno::Any(bNegative
) );
608 //PROP_CHART_STATISTIC_ERROR_BAR_STYLE
609 // this is the new constant group that replaces the deprecated enum ChartErrorCategory
610 class WrappedErrorBarStyleProperty
: public WrappedStatisticProperty
< sal_Int32
>
613 virtual sal_Int32
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
614 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const sal_Int32
& nNewValue
) const override
;
616 explicit WrappedErrorBarStyleProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact1
,
617 tSeriesOrDiagramPropertyType ePropertyType
);
620 WrappedErrorBarStyleProperty::WrappedErrorBarStyleProperty(
621 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
622 tSeriesOrDiagramPropertyType ePropertyType
)
623 : WrappedStatisticProperty
< sal_Int32
>( "ErrorBarStyle"
624 , uno::Any( css::chart::ErrorBarStyle::NONE
), std::move(spChart2ModelContact
), ePropertyType
)
628 sal_Int32
WrappedErrorBarStyleProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
630 sal_Int32 nRet
= css::chart::ErrorBarStyle::NONE
;
631 m_aDefaultValue
>>= nRet
;
632 uno::Reference
< beans::XPropertySet
> xErrorBarProperties
;
633 if( xSeriesPropertySet
.is() && ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarProperties
) && xErrorBarProperties
.is())
635 xErrorBarProperties
->getPropertyValue( "ErrorBarStyle" ) >>= nRet
;
639 void WrappedErrorBarStyleProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const sal_Int32
& nNewValue
) const
641 if( !xSeriesPropertySet
.is() )
644 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
645 if( xErrorBarProperties
.is() )
647 xErrorBarProperties
->setPropertyValue( "ErrorBarStyle" , uno::Any( nNewValue
));
651 //PROP_CHART_STATISTIC_ERROR_RANGE_POSITIVE
652 class WrappedErrorBarRangePositiveProperty
: public WrappedStatisticProperty
< OUString
>
655 virtual OUString
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
656 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const override
;
658 explicit WrappedErrorBarRangePositiveProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
659 tSeriesOrDiagramPropertyType ePropertyType
);
662 WrappedErrorBarRangePositiveProperty::WrappedErrorBarRangePositiveProperty(
663 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
664 tSeriesOrDiagramPropertyType ePropertyType
)
665 : WrappedStatisticProperty
< OUString
>( "ErrorBarRangePositive"
666 , uno::Any( OUString() ), std::move(spChart2ModelContact
), ePropertyType
)
670 OUString
WrappedErrorBarRangePositiveProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
673 m_aDefaultValue
>>= aRet
;
674 uno::Reference
< chart2::data::XDataSource
> xErrorBarDataSource
;
675 if( xSeriesPropertySet
.is() &&
676 ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarDataSource
) &&
677 xErrorBarDataSource
.is())
679 uno::Reference
< chart2::data::XDataSequence
> xSeq(
680 StatisticsHelper::getErrorDataSequenceFromDataSource(
681 xErrorBarDataSource
, true /* positive */ ));
683 aRet
= xSeq
->getSourceRangeRepresentation();
685 m_aOuterValue
>>= aRet
;
687 lcl_ConvertRangeToXML( aRet
, m_spChart2ModelContact
);
691 void WrappedErrorBarRangePositiveProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const
693 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
694 if( xErrorBarProperties
.is() )
696 uno::Reference
< chart2::data::XDataProvider
> xDataProvider(
697 lcl_getDataProviderFromContact( m_spChart2ModelContact
));
698 uno::Reference
< chart2::data::XDataSource
> xDataSource( xErrorBarProperties
, uno::UNO_QUERY
);
699 if( xDataSource
.is() && xDataProvider
.is())
701 OUString
aTmp( aNewValue
);
702 OUString
aXMLRange( aNewValue
);
703 lcl_ConvertRangeFromXML( aTmp
, m_spChart2ModelContact
);
704 StatisticsHelper::setErrorDataSequence(
705 xDataSource
, xDataProvider
, aTmp
, true /* positive */, true /* y-error */, &aXMLRange
);
706 m_aOuterValue
<<= aTmp
;
711 //PROP_CHART_STATISTIC_ERROR_RANGE_NEGATIVE
712 class WrappedErrorBarRangeNegativeProperty
: public WrappedStatisticProperty
< OUString
>
715 virtual OUString
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
716 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const override
;
718 explicit WrappedErrorBarRangeNegativeProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
719 tSeriesOrDiagramPropertyType ePropertyType
);
722 WrappedErrorBarRangeNegativeProperty::WrappedErrorBarRangeNegativeProperty(
723 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
724 tSeriesOrDiagramPropertyType ePropertyType
)
725 : WrappedStatisticProperty
< OUString
>( "ErrorBarRangeNegative"
726 , uno::Any( OUString() ), std::move(spChart2ModelContact
), ePropertyType
)
730 OUString
WrappedErrorBarRangeNegativeProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
733 m_aDefaultValue
>>= aRet
;
734 uno::Reference
< chart2::data::XDataSource
> xErrorBarDataSource
;
735 if( xSeriesPropertySet
.is() &&
736 ( xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xErrorBarDataSource
) &&
737 xErrorBarDataSource
.is())
739 uno::Reference
< chart2::data::XDataSequence
> xSeq(
740 StatisticsHelper::getErrorDataSequenceFromDataSource(
741 xErrorBarDataSource
, false /* positive */ ));
743 aRet
= xSeq
->getSourceRangeRepresentation();
745 m_aOuterValue
>>= aRet
;
747 lcl_ConvertRangeToXML( aRet
, m_spChart2ModelContact
);
751 void WrappedErrorBarRangeNegativeProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const OUString
& aNewValue
) const
753 uno::Reference
< beans::XPropertySet
> xErrorBarProperties( getOrCreateErrorBarProperties(xSeriesPropertySet
) );
754 if( xErrorBarProperties
.is() )
756 uno::Reference
< chart2::data::XDataProvider
> xDataProvider(
757 lcl_getDataProviderFromContact( m_spChart2ModelContact
));
758 uno::Reference
< chart2::data::XDataSource
> xDataSource( xErrorBarProperties
, uno::UNO_QUERY
);
759 if( xDataSource
.is() && xDataProvider
.is())
761 OUString
aTmp( aNewValue
);
762 OUString
aXMLRange( aNewValue
);
763 lcl_ConvertRangeFromXML( aTmp
, m_spChart2ModelContact
);
764 StatisticsHelper::setErrorDataSequence(
765 xDataSource
, xDataProvider
, aTmp
, false /* positive */, true /* y-error */, &aXMLRange
);
766 m_aOuterValue
<<= aTmp
;
771 //PROP_CHART_STATISTIC_REGRESSION_CURVES
772 class WrappedRegressionCurvesProperty
: public WrappedStatisticProperty
< css::chart::ChartRegressionCurveType
>
775 virtual css::chart::ChartRegressionCurveType
getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
776 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const css::chart::ChartRegressionCurveType
& aNewValue
) const override
;
778 explicit WrappedRegressionCurvesProperty( std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
779 tSeriesOrDiagramPropertyType ePropertyType
);
782 WrappedRegressionCurvesProperty::WrappedRegressionCurvesProperty(
783 std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
784 tSeriesOrDiagramPropertyType ePropertyType
)
785 : WrappedStatisticProperty
< css::chart::ChartRegressionCurveType
>( "RegressionCurves"
786 , lcl_getRegressionDefault(), std::move(spChart2ModelContact
), ePropertyType
)
790 css::chart::ChartRegressionCurveType
WrappedRegressionCurvesProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
792 css::chart::ChartRegressionCurveType aRet
;
793 m_aDefaultValue
>>= aRet
;
794 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
797 aRet
= lcl_getRegressionCurveType(
798 RegressionCurveHelper::getFirstRegressTypeNotMeanValueLine( xRegCnt
) );
802 void WrappedRegressionCurvesProperty::setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const css::chart::ChartRegressionCurveType
& aNewValue
) const
804 uno::Reference
< chart2::XRegressionCurveContainer
> xRegressionCurveContainer( xSeriesPropertySet
, uno::UNO_QUERY
);
805 uno::Reference
< chart2::XRegressionCurve
> xRegressionCurve( xSeriesPropertySet
, uno::UNO_QUERY
);
807 if( xRegressionCurveContainer
.is() && xRegressionCurve
.is() )
809 SvxChartRegress eNewRegressionType
= lcl_getRegressionType( aNewValue
);
811 RegressionCurveHelper::changeRegressionCurveType(
813 xRegressionCurveContainer
,
818 //PROP_CHART_STATISTIC_REGRESSION_PROPERTIES
819 //PROP_CHART_STATISTIC_ERROR_PROPERTIES
820 //PROP_CHART_STATISTIC_MEAN_VALUE_PROPERTIES
821 class WrappedStatisticPropertySetProperty
: public WrappedStatisticProperty
< Reference
< beans::XPropertySet
> >
824 virtual Reference
< beans::XPropertySet
> getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const override
;
825 // properties are read-only, so this method should never be called
826 virtual void setValueToSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
, const Reference
< beans::XPropertySet
> & xNewValue
) const override
;
830 PROPERTY_SET_TYPE_REGRESSION
,
831 PROPERTY_SET_TYPE_ERROR_BAR
,
832 PROPERTY_SET_TYPE_MEAN_VALUE
835 explicit WrappedStatisticPropertySetProperty(
836 PropertySetType ePropertySetType
, std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
,
837 tSeriesOrDiagramPropertyType ePropertyType
);
840 PropertySetType m_eType
;
843 WrappedStatisticPropertySetProperty::WrappedStatisticPropertySetProperty(
844 PropertySetType ePropertySetType
845 , std::shared_ptr
< Chart2ModelContact
> spChart2ModelContact
846 , tSeriesOrDiagramPropertyType ePropertyType
)
847 : WrappedStatisticProperty
< Reference
< beans::XPropertySet
> >(
848 (ePropertySetType
== PROPERTY_SET_TYPE_REGRESSION
)
849 ? OUString("DataRegressionProperties")
850 : (ePropertySetType
== PROPERTY_SET_TYPE_ERROR_BAR
)
851 ? OUString("DataErrorProperties")
852 : OUString("DataMeanValueProperties")
853 , uno::Any(), std::move(spChart2ModelContact
), ePropertyType
)
854 , m_eType( ePropertySetType
)
858 Reference
< beans::XPropertySet
> WrappedStatisticPropertySetProperty::getValueFromSeries( const Reference
< beans::XPropertySet
>& xSeriesPropertySet
) const
860 Reference
< beans::XPropertySet
> xResult
;
861 uno::Reference
< chart2::XRegressionCurveContainer
> xRegCnt( xSeriesPropertySet
, uno::UNO_QUERY
);
865 case PROPERTY_SET_TYPE_REGRESSION
:
867 xResult
.set( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCnt
), uno::UNO_QUERY
);
869 case PROPERTY_SET_TYPE_ERROR_BAR
:
870 if( xSeriesPropertySet
.is())
871 xSeriesPropertySet
->getPropertyValue( CHART_UNONAME_ERRORBAR_Y
) >>= xResult
;
873 case PROPERTY_SET_TYPE_MEAN_VALUE
:
875 xResult
.set( RegressionCurveHelper::getMeanValueLine( xRegCnt
), uno::UNO_QUERY
);
882 void WrappedStatisticPropertySetProperty::setValueToSeries(
883 const Reference
< beans::XPropertySet
>& /* xSeriesPropertySet */
884 , const Reference
< beans::XPropertySet
>& /* xNewValue */ ) const
892 //statistic properties
893 PROP_CHART_STATISTIC_CONST_ERROR_LOW
= FAST_PROPERTY_ID_START_CHART_STATISTIC_PROP
,
894 PROP_CHART_STATISTIC_CONST_ERROR_HIGH
,
895 PROP_CHART_STATISTIC_MEAN_VALUE
,
896 PROP_CHART_STATISTIC_ERROR_CATEGORY
,
897 PROP_CHART_STATISTIC_ERROR_BAR_STYLE
,
898 PROP_CHART_STATISTIC_PERCENT_ERROR
,
899 PROP_CHART_STATISTIC_ERROR_MARGIN
,
900 PROP_CHART_STATISTIC_ERROR_INDICATOR
,
901 PROP_CHART_STATISTIC_ERROR_RANGE_POSITIVE
,
902 PROP_CHART_STATISTIC_ERROR_RANGE_NEGATIVE
,
903 PROP_CHART_STATISTIC_REGRESSION_CURVES
,
904 PROP_CHART_STATISTIC_REGRESSION_PROPERTIES
,
905 PROP_CHART_STATISTIC_ERROR_PROPERTIES
,
906 PROP_CHART_STATISTIC_MEAN_VALUE_PROPERTIES
909 /** @parameter bDataSeriesProperty if true, this property is for a single data
910 series, if false, it is for the whole diagram, i.e. for all
913 void lcl_addWrappedProperties( std::vector
< std::unique_ptr
<WrappedProperty
> >& rList
914 , const std::shared_ptr
< Chart2ModelContact
>& spChart2ModelContact
915 , tSeriesOrDiagramPropertyType ePropertyType
)
917 rList
.emplace_back( new WrappedConstantErrorLowProperty( spChart2ModelContact
, ePropertyType
) );
918 rList
.emplace_back( new WrappedConstantErrorHighProperty( spChart2ModelContact
, ePropertyType
) );
919 rList
.emplace_back( new WrappedMeanValueProperty( spChart2ModelContact
, ePropertyType
) );
920 rList
.emplace_back( new WrappedErrorCategoryProperty( spChart2ModelContact
, ePropertyType
) );
921 rList
.emplace_back( new WrappedErrorBarStyleProperty( spChart2ModelContact
, ePropertyType
) );
922 rList
.emplace_back( new WrappedPercentageErrorProperty( spChart2ModelContact
, ePropertyType
) );
923 rList
.emplace_back( new WrappedErrorMarginProperty( spChart2ModelContact
, ePropertyType
) );
924 rList
.emplace_back( new WrappedErrorIndicatorProperty( spChart2ModelContact
, ePropertyType
) );
925 rList
.emplace_back( new WrappedErrorBarRangePositiveProperty( spChart2ModelContact
, ePropertyType
) );
926 rList
.emplace_back( new WrappedErrorBarRangeNegativeProperty( spChart2ModelContact
, ePropertyType
) );
927 rList
.emplace_back( new WrappedRegressionCurvesProperty( spChart2ModelContact
, ePropertyType
) );
928 rList
.emplace_back( new WrappedStatisticPropertySetProperty(
929 WrappedStatisticPropertySetProperty::PROPERTY_SET_TYPE_REGRESSION
, spChart2ModelContact
, ePropertyType
) );
930 rList
.emplace_back( new WrappedStatisticPropertySetProperty(
931 WrappedStatisticPropertySetProperty::PROPERTY_SET_TYPE_ERROR_BAR
, spChart2ModelContact
, ePropertyType
) );
932 rList
.emplace_back( new WrappedStatisticPropertySetProperty(
933 WrappedStatisticPropertySetProperty::PROPERTY_SET_TYPE_MEAN_VALUE
, spChart2ModelContact
, ePropertyType
) );
936 }//anonymous namespace
938 void WrappedStatisticProperties::addProperties( std::vector
< Property
> & rOutProperties
)
940 rOutProperties
.emplace_back( "ConstantErrorLow",
941 PROP_CHART_STATISTIC_CONST_ERROR_LOW
,
942 cppu::UnoType
<double>::get(),
943 beans::PropertyAttribute::BOUND
944 | beans::PropertyAttribute::MAYBEDEFAULT
);
945 rOutProperties
.emplace_back( "ConstantErrorHigh",
946 PROP_CHART_STATISTIC_CONST_ERROR_HIGH
,
947 cppu::UnoType
<double>::get(),
948 beans::PropertyAttribute::BOUND
949 | beans::PropertyAttribute::MAYBEDEFAULT
);
950 rOutProperties
.emplace_back( "MeanValue",
951 PROP_CHART_STATISTIC_MEAN_VALUE
,
952 cppu::UnoType
<bool>::get(),
953 beans::PropertyAttribute::BOUND
954 | beans::PropertyAttribute::MAYBEDEFAULT
);
955 rOutProperties
.emplace_back( "ErrorCategory",
956 PROP_CHART_STATISTIC_ERROR_CATEGORY
,
957 cppu::UnoType
<css::chart::ChartErrorCategory
>::get(),
958 beans::PropertyAttribute::BOUND
959 | beans::PropertyAttribute::MAYBEDEFAULT
);
960 rOutProperties
.emplace_back( "ErrorBarStyle",
961 PROP_CHART_STATISTIC_ERROR_BAR_STYLE
,
962 cppu::UnoType
<sal_Int32
>::get(),
963 beans::PropertyAttribute::BOUND
964 | beans::PropertyAttribute::MAYBEDEFAULT
);
965 rOutProperties
.emplace_back( "PercentageError",
966 PROP_CHART_STATISTIC_PERCENT_ERROR
,
967 cppu::UnoType
<double>::get(),
968 beans::PropertyAttribute::BOUND
969 | beans::PropertyAttribute::MAYBEDEFAULT
);
970 rOutProperties
.emplace_back( "ErrorMargin",
971 PROP_CHART_STATISTIC_ERROR_MARGIN
,
972 cppu::UnoType
<double>::get(),
973 beans::PropertyAttribute::BOUND
974 | beans::PropertyAttribute::MAYBEDEFAULT
);
975 rOutProperties
.emplace_back( "ErrorIndicator",
976 PROP_CHART_STATISTIC_ERROR_INDICATOR
,
977 cppu::UnoType
<css::chart::ChartErrorIndicatorType
>::get(),
978 beans::PropertyAttribute::BOUND
979 | beans::PropertyAttribute::MAYBEDEFAULT
);
980 rOutProperties
.emplace_back( "ErrorBarRangePositive",
981 PROP_CHART_STATISTIC_ERROR_RANGE_POSITIVE
,
982 cppu::UnoType
<OUString
>::get(),
983 beans::PropertyAttribute::BOUND
984 | beans::PropertyAttribute::MAYBEDEFAULT
);
985 rOutProperties
.emplace_back( "ErrorBarRangeNegative",
986 PROP_CHART_STATISTIC_ERROR_RANGE_NEGATIVE
,
987 cppu::UnoType
<OUString
>::get(),
988 beans::PropertyAttribute::BOUND
989 | beans::PropertyAttribute::MAYBEDEFAULT
);
990 rOutProperties
.emplace_back( "RegressionCurves",
991 PROP_CHART_STATISTIC_REGRESSION_CURVES
,
992 cppu::UnoType
<css::chart::ChartRegressionCurveType
>::get(),
993 beans::PropertyAttribute::BOUND
994 | beans::PropertyAttribute::MAYBEDEFAULT
);
996 rOutProperties
.emplace_back( "DataRegressionProperties",
997 PROP_CHART_STATISTIC_REGRESSION_PROPERTIES
,
998 cppu::UnoType
<beans::XPropertySet
>::get(),
999 beans::PropertyAttribute::BOUND
1000 | beans::PropertyAttribute::READONLY
1001 | beans::PropertyAttribute::MAYBEVOID
);
1002 rOutProperties
.emplace_back( "DataErrorProperties",
1003 PROP_CHART_STATISTIC_ERROR_PROPERTIES
,
1004 cppu::UnoType
<beans::XPropertySet
>::get(),
1005 beans::PropertyAttribute::BOUND
1006 | beans::PropertyAttribute::READONLY
1007 | beans::PropertyAttribute::MAYBEVOID
);
1008 rOutProperties
.emplace_back( "DataMeanValueProperties",
1009 PROP_CHART_STATISTIC_MEAN_VALUE_PROPERTIES
,
1010 cppu::UnoType
<beans::XPropertySet
>::get(),
1011 beans::PropertyAttribute::BOUND
1012 | beans::PropertyAttribute::READONLY
1013 | beans::PropertyAttribute::MAYBEVOID
);
1016 void WrappedStatisticProperties::addWrappedPropertiesForSeries( std::vector
< std::unique_ptr
<WrappedProperty
> >& rList
1017 , const std::shared_ptr
< Chart2ModelContact
>& spChart2ModelContact
)
1019 lcl_addWrappedProperties( rList
, spChart2ModelContact
, DATA_SERIES
);
1022 void WrappedStatisticProperties::addWrappedPropertiesForDiagram( std::vector
< std::unique_ptr
<WrappedProperty
> >& rList
1023 , const std::shared_ptr
< Chart2ModelContact
>& spChart2ModelContact
)
1025 lcl_addWrappedProperties( rList
, spChart2ModelContact
, DIAGRAM
);
1028 } //namespace wrapper
1031 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */