61#include <com/sun/star/chart2/XRegressionCurve.hpp>
62#include <com/sun/star/chart/ErrorBarStyle.hpp>
63#include <com/sun/star/beans/XPropertySet.hpp>
71using ::com::sun::star::uno::Reference;
72using ::com::sun::star::uno::Sequence;
114 std::unique_ptr< ReferenceSizeProvider > pRefSizeProvider(
118 , pRefSizeProvider.get() );
123 catch(
const uno::RuntimeException&)
157 catch(
const uno::RuntimeException&)
176 auto xDataTable = xDiagram->getDataTable();
177 aData.mbShow = xDataTable.is();
182 uno::Any aAny = xProperties->getPropertyValue(
"HBorder");
183 if (aAny.has<
bool>())
184 aData.mbHorizontalBorders = aAny.get<
bool>();
186 aAny = xProperties->getPropertyValue(
"VBorder");
187 if (aAny.has<
bool>())
188 aData.mbVerticalBorders = aAny.get<
bool>();
190 aAny = xProperties->getPropertyValue(
"Outline");
191 if (aAny.has<
bool>())
192 aData.mbOutline = aAny.get<
bool>();
194 aAny = xProperties->getPropertyValue(
"Keys");
195 if (aAny.has<
bool>())
196 aData.mbKeys = aAny.get<
bool>();
204 bool bChanged =
false;
207 auto xDataTable = xDiagram->getDataTable();
208 if (!rDialogData.mbShow && xDataTable.is())
213 else if (rDialogData.mbShow && !xDataTable.is())
216 if (xNewDataTable.is())
218 xDiagram->setDataTable(xNewDataTable);
224 xDataTable = xDiagram->getDataTable();
225 if (rDialogData.mbShow && xDataTable.is())
228 xProperties->setPropertyValue(
"HBorder" ,
uno::Any(rDialogData.mbHorizontalBorders));
229 xProperties->setPropertyValue(
"VBorder" ,
uno::Any(rDialogData.mbVerticalBorders));
230 xProperties->setPropertyValue(
"Outline" ,
uno::Any(rDialogData.mbOutline));
231 xProperties->setPropertyValue(
"Keys" ,
uno::Any(rDialogData.mbKeys));
248 auto xDataTable = xDiagram->getDataTable();
249 if (!xDataTable.is())
252 if (xNewDataTable.is())
254 xDiagram->setDataTable(xNewDataTable);
267 auto xDataTable = xDiagram->getDataTable();
301 catch(
const uno::RuntimeException&)
350 catch(
const uno::RuntimeException&)
406 bool bChanged = aItemConverter.
ApplyItemSet( aOutItemSet );
411 catch(
const uno::RuntimeException&)
440 lcl_InsertMeanValueLine( xSeries );
444 std::vector< rtl::Reference< DataSeries > > aSeries =
445 xDiagram->getDataSeries();
447 for(
const auto& xSrs : aSeries )
448 lcl_InsertMeanValueLine( xSrs );
471 if( !xRegressionCurveContainer.is() )
481 SvxChartRegress::Linear,
482 xRegressionCurveContainer );
504 &aViewElementListProvider,
534 SchResId( bYError ? STR_OBJECT_ERROR_BARS_Y : STR_OBJECT_ERROR_BARS_X )),
540 css::chart::ErrorBarStyle::STANDARD_DEVIATION,
561 &aViewElementListProvider,
613 bool bChanged = aItemConverter.
ApplyItemSet( aOutItemSet );
618 catch(
const uno::RuntimeException&)
629 if( !xRegCurve.is() )
645 xEqProp->setPropertyValue(
"ShowEquation",
uno::Any(
true ));
646 xEqProp->setPropertyValue(
"XName",
uno::Any( OUString(
"x") ));
647 xEqProp->setPropertyValue(
"YName",
uno::Any( OUString(
"f(x)") ));
648 xEqProp->setPropertyValue(
"ShowCorrelationCoefficient",
uno::Any( bInsertR2 ));
663 xEqProp->setPropertyValue(
"ShowCorrelationCoefficient",
uno::Any(
true ));
678 xEqProp->setPropertyValue(
"ShowCorrelationCoefficient",
uno::Any(
false ));
687 if( xRegCurveCnt.is())
702 if( xRegCurveCnt.is())
717 if( xRegCurveCnt.is())
732 if( xDataSeries.is())
796 xSeries->resetAllDataPoints();
808 xSeries->resetDataPoint( nPointIndex );
825 sal_Int32 nDimensionIndex = -1;
826 sal_Int32 nCooSysIndex = -1;
827 sal_Int32 nAxisIndex = -1;
831 if( nDimensionIndex==0 )
833 else if( nDimensionIndex==1 )
843 catch(
const uno::RuntimeException&)
865 catch(
const uno::RuntimeException&)
887 catch(
const uno::RuntimeException&)
909 catch(
const uno::RuntimeException&)
931 catch(
const uno::RuntimeException&)
949 std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
955 catch(
const uno::RuntimeException&)
973 std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
979 catch(
const uno::RuntimeException&)
constexpr TypedWhichId< SfxBoolItem > SCHATTR_STAT_ERRORBAR_TYPE(SCHATTR_STAT_START+9)
static OUString createDescription(ActionType eActionType, std::u16string_view rObjectName)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual short run() override
const SfxItemSet * GetOutputItemSet() const
static void makeAxisInvisible(const rtl::Reference< ::chart::Axis > &xAxis)
static void getAxisOrGridExistence(css::uno::Sequence< sal_Bool > &rExistenceList, const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAxis=true)
static void makeGridInvisible(const rtl::Reference< ::chart::GridProperties > &xGridProperties)
static void makeAxisVisible(const rtl::Reference< ::chart::Axis > &xAxis)
static bool getIndicesForAxis(const rtl::Reference< ::chart::Axis > &xAxis, const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSys, sal_Int32 &rOutDimensionIndex, sal_Int32 &rOutAxisIndex)
static void makeGridVisible(const rtl::Reference< ::chart::GridProperties > &xGridProperties)
static void getAxisOrGridPossibilities(css::uno::Sequence< sal_Bool > &rPossibilityList, const rtl::Reference< ::chart::Diagram > &xDiagram, bool bAxis=true)
static bool changeVisibilityOfGrids(const rtl::Reference< ::chart::Diagram > &xDiagram, const css::uno::Sequence< sal_Bool > &rOldExistenceList, const css::uno::Sequence< sal_Bool > &rNewExistenceList)
static bool changeVisibilityOfAxes(const rtl::Reference< ::chart::Diagram > &xDiagram, const css::uno::Sequence< sal_Bool > &rOldExistenceList, const css::uno::Sequence< sal_Bool > &rNewExistenceList, const css::uno::Reference< css::uno::XComponentContext > &xContext, ReferenceSizeProvider *pRefSizeProvider)
void executeDispatch_DeleteErrorBars(bool bYError)
rtl::Reference<::chart::ChartModel > getChartModel()
void executeDispatch_InsertMeanValue()
void executeDispatch_InsertDataLabel()
void executeDispatch_DeleteDataLabels()
void executeDispatch_OpenLegendDialog()
css::uno::Reference< css::document::XUndoManager > m_xUndoManager
void executeDispatch_DeleteLegend()
std::unique_ptr< ReferenceSizeProvider > impl_createReferenceSizeProvider()
void executeDispatch_InsertMajorGrid()
void executeDispatch_DeleteR2Value()
std::shared_ptr< DrawModelWrapper > m_pDrawModelWrapper
void executeDispatch_InsertTitles()
rtl::Reference<::chart::ChartView > m_xChartView
void executeDispatch_InsertAxes()
void executeDispatch_InsertMenu_Trendlines()
weld::Window * GetChartFrame()
bool executeDlg_ObjectProperties_withoutUndoGuard(const OUString &rObjectCID, bool bSuccessOnUnchanged)
void executeDispatch_OpenInsertDataTableDialog()
void executeDispatch_InsertMenu_DataLabels()
void executeDispatch_InsertTrendline()
void executeDispatch_InsertAxisTitle()
void executeDispatch_InsertMenu_MeanValues()
void executeDispatch_DeleteAxis()
void executeDispatch_DeleteMinorGrid()
void executeDispatch_ResetAllDataPoints()
void executeDispatch_DeleteDataLabel()
void executeDispatch_InsertLegend()
void executeDispatch_DeleteMeanValue()
void executeDispatch_DeleteDataTable()
Delete a data table from the chart.
void executeDispatch_DeleteMajorGrid()
void executeDispatch_ResetDataPoint()
rtl::Reference<::chart::Diagram > getFirstDiagram()
void executeDispatch_DeleteTrendline()
void executeDispatch_DeleteTrendlineEquation()
void executeDispatch_InsertR2Value()
void executeDispatch_InsertDataTable()
Create and insert a data table to the chart.
void executeDispatch_InsertAxis()
css::uno::Reference< css::uno::XComponentContext > m_xCC
void executeDispatch_InsertErrorBars(bool bYError)
void executeDispatch_InsertTrendlineEquation(bool bInsertR2=false)
void executeDispatch_InsertMinorGrid()
void executeDispatch_InsertGrid()
void executeDispatch_InsertDataLabels()
This guard calls lockControllers at the given Model in the CTOR and unlockControllers in the DTOR.
void FillItemSet(SfxItemSet &rOutAttrs)
Data table implementation.
The dialog to change the data table specific properties.
void init(DataTableDialogData const &rData)
Set the initial state of the data table properties.
DataTableDialogData & getDataTableDialogData()
Get the state of the data table properties from the dialog.
void SetAxisMinorStepWidthForErrorBarDecimals(double fMinorStepWidth)
void FillItemSet(SfxItemSet &rOutAttrs)
static double getAxisMinorStepWidthForErrorBarDecimals(const rtl::Reference<::chart::ChartModel > &xChartModel, const rtl::Reference<::chart::ChartView > &xChartView, std::u16string_view rSelectedObjectCID)
static rtl::Reference< ::chart::Legend > showLegend(ChartModel &rModel, const css::uno::Reference< css::uno::XComponentContext > &xContext)
static void hideLegend(ChartModel &rModel)
static OUString getSeriesParticleFromCID(std::u16string_view rCID)
static rtl::Reference< ::chart::DataSeries > getDataSeriesForCID(std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
static OUString getStringForType(ObjectType eObjectType)
static OUString createDataCurveCID(std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine)
static css::uno::Reference< css::beans::XPropertySet > getObjectPropertySet(std::u16string_view rObjectCID, const rtl::Reference< ::chart::ChartModel > &xChartDocument)
static OUString createClassifiedIdentifierForParticles(std::u16string_view rParentParticle, std::u16string_view rChildParticle, std::u16string_view rDragMethodServiceName=std::u16string_view(), std::u16string_view rDragParameterString=std::u16string_view())
static rtl::Reference< ::chart::Axis > getAxisForCID(std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
static sal_Int32 getIndexFromParticleOrCID(std::u16string_view rParticleOrCID)
static OUString createClassifiedIdentifierWithParent(enum ObjectType, std::u16string_view rParticleID, std::u16string_view rParentPartical, std::u16string_view rDragMethodServiceName=std::u16string_view(), std::u16string_view rDragParameterString=std::u16string_view())
static OUString getTitleNameByType(TitleHelper::eTitleType eType)
static OUString getName_ObjectForAllSeries(ObjectType eObjectType)
void init(const rtl::Reference<::chart::ChartModel > &xModel)
bool DialogWasClosedWithOK() const
void SetAxisMinorStepWidthForErrorBarDecimals(double fMinorStepWidth)
void getResult(InsertAxisOrGridDialogData &rOutput)
void writeToModel(const rtl::Reference<::chart::ChartModel > &xChartModel) const
void init(const rtl::Reference<::chart::ChartModel > &xChartModel)
void getResult(TitleDialogData &rOutput)
OUString const & getSelectedCID() const
static rtl::Reference< ::chart::Title > createTitle(eTitleType nTitleIndex, const OUString &rTitleText, const rtl::Reference< ::chart::ChartModel > &xModel, const css::uno::Reference< css::uno::XComponentContext > &xContext, ReferenceSizeProvider *pRefSizeProvider=nullptr)
A guard which does nothing, unless you explicitly call commitAction.
A guard which, in its destructor, restores the model state it found in the constructor.
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
SfxItemSet CreateEmptyItemSet() const
creates an empty item set using the given pool or a common pool if empty (see GetItemPool) and allowi...
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral aData
OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelToPoint(const css::uno::Reference< css::beans::XPropertySet > &xPointPropertySet)
OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelsToSeriesAndAllPoints(const rtl::Reference< ::chart::DataSeries > &xSeries)
OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromSeriesAndAllPoints(const rtl::Reference< ::chart::DataSeries > &xSeries)
OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromPoint(const css::uno::Reference< css::beans::XPropertySet > &xPointPropertySet)
OOO_DLLPUBLIC_CHARTTOOLS bool removeAllExceptMeanValueLine(rtl::Reference<::chart::DataSeries > const &xCurveContainer)
OOO_DLLPUBLIC_CHARTTOOLS rtl::Reference<::chart::RegressionCurveModel > getFirstCurveNotMeanValueLine(const css::uno::Reference< css::chart2::XRegressionCurveContainer > &xCurveContainer)
Returns the first regression curve found that is not of type mean-value line.
OOO_DLLPUBLIC_CHARTTOOLS void removeEquations(rtl::Reference<::chart::DataSeries > const &xCurveContainer)
OOO_DLLPUBLIC_CHARTTOOLS void removeMeanValueLine(css::uno::Reference< css::chart2::XRegressionCurveContainer > const &xRegCnt)
OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getRegressionCurveIndex(const rtl::Reference<::chart::DataSeries > &xContainer, const rtl::Reference<::chart::RegressionCurveModel > &xCurve)
OOO_DLLPUBLIC_CHARTTOOLS rtl::Reference<::chart::RegressionCurveModel > addRegressionCurve(SvxChartRegress eType, css::uno::Reference< css::chart2::XRegressionCurveContainer > const &xCurveContainer, const css::uno::Reference< css::beans::XPropertySet > &xPropertySource=css::uno::Reference< css::beans::XPropertySet >(), const css::uno::Reference< css::beans::XPropertySet > &xEquationProperties=css::uno::Reference< css::beans::XPropertySet >())
OOO_DLLPUBLIC_CHARTTOOLS void addMeanValueLine(css::uno::Reference< css::chart2::XRegressionCurveContainer > const &xRegCnt, const css::uno::Reference< css::beans::XPropertySet > &xSeriesProp)
creates a mean-value line and adds it to the container.
OOO_DLLPUBLIC_CHARTTOOLS void removeErrorBars(const rtl::Reference< ::chart::DataSeries > &xDataSeries, bool bYError=true)
OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::beans::XPropertySet > addErrorBars(const rtl::Reference< ::chart::DataSeries > &xDataSeries, sal_Int32 nStyle, bool bYError=true)
@ OBJECTTYPE_DATA_ERRORS_X
@ OBJECTTYPE_DATA_ERRORS_Y
OUString OOO_DLLPUBLIC_CHARTTOOLS SchResId(TranslateId aId)
The data table properties (data) used by the dialog.
css::uno::Sequence< sal_Bool > aExistenceList
css::uno::Sequence< sal_Bool > aPossibilityList
bool writeDifferenceToModel(const rtl::Reference<::chart::ChartModel > &xChartModel, const css::uno::Reference< css::uno::XComponentContext > &xContext, const TitleDialogData *pOldState=nullptr)
void readFromModel(const rtl::Reference<::chart::ChartModel > &xChartModel)