summaryrefslogtreecommitdiffstats
path: root/chart2/source/view/inc
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/view/inc')
-rw-r--r--chart2/source/view/inc/ConfigAccess.hxx35
-rw-r--r--chart2/source/view/inc/DataTableView.hxx88
-rw-r--r--chart2/source/view/inc/LabelPositionHelper.hxx2
-rw-r--r--chart2/source/view/inc/LegendEntryProvider.hxx13
-rw-r--r--chart2/source/view/inc/PlottingPositionHelper.hxx6
-rw-r--r--chart2/source/view/inc/PropertyMapper.hxx5
-rw-r--r--chart2/source/view/inc/ShapeFactory.hxx15
-rw-r--r--chart2/source/view/inc/VCoordinateSystem.hxx35
-rw-r--r--chart2/source/view/inc/VDataSeries.hxx51
-rw-r--r--chart2/source/view/inc/VDiagram.hxx9
-rw-r--r--chart2/source/view/inc/VSeriesPlotter.hxx43
11 files changed, 188 insertions, 114 deletions
diff --git a/chart2/source/view/inc/ConfigAccess.hxx b/chart2/source/view/inc/ConfigAccess.hxx
deleted file mode 100644
index df59b16a3f75..000000000000
--- a/chart2/source/view/inc/ConfigAccess.hxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#pragma once
-
-namespace chart::ConfigAccess
-{
-/** @descr Retrieve the setting for showing errors in charts from the registry
- settings of the Calc application.
-
- If this setting is not found, it is set to false (the default setting).
-
- @return boolean UseErrorRectangle.
- */
-bool getUseErrorRectangle();
-
-} //namespace chart::ConfigAccess
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/DataTableView.hxx b/chart2/source/view/inc/DataTableView.hxx
new file mode 100644
index 000000000000..0bccaaddde31
--- /dev/null
+++ b/chart2/source/view/inc/DataTableView.hxx
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+#pragma once
+
+#include <svx/unoshape.hxx>
+#include <svx/unodraw/SvxTableShape.hxx>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/table/XTable.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <DataTable.hxx>
+#include "VLineProperties.hxx"
+
+namespace chart
+{
+class VSeriesPlotter;
+class ChartModel;
+class LegendEntryProvider;
+
+/**
+ * DataTableView is responsible to create the table object, set the cell
+ * properties accordingly to the model and fill it with the chart series
+ * data.
+ */
+class DataTableView final
+{
+private:
+ rtl::Reference<::chart::ChartModel> m_xChartModel;
+ // the target shape
+ rtl::Reference<SvxShapeGroupAnyD> m_xTarget;
+ // the data table shape
+ rtl::Reference<SvxTableShape> m_xTableShape;
+ // the data table model
+ rtl::Reference<DataTable> m_xDataTableModel;
+ css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
+ css::uno::Reference<css::table::XTable> m_xTable;
+ VLineProperties m_aLineProperties;
+ std::vector<VSeriesPlotter*> m_pSeriesPlotterList;
+
+ // data series names
+ std::vector<OUString> m_aDataSeriesNames;
+ // X axis names
+ std::vector<OUString> m_aXValues;
+ // list of data series values
+ std::vector<std::vector<OUString>> m_pDataSeriesValues;
+
+ // if the header vales should be aligned with the x-axis vales
+ bool m_bAlignAxisValuesWithColumns;
+
+ /** Set the char and paragraph properties for the input (value) cell */
+ void
+ setCellCharAndParagraphProperties(css::uno::Reference<css::beans::XPropertySet>& xPropertySet);
+
+ /** Set the common cell properties (for all cells in the data table,
+ * including headers)
+ */
+ void setCellProperties(css::uno::Reference<css::beans::XPropertySet>& xPropertySet, bool bLeft,
+ bool bTop, bool bRight, bool bBottom);
+
+public:
+ DataTableView(rtl::Reference<::chart::ChartModel> const& xChartDoc,
+ rtl::Reference<DataTable> const& rDataTableModel,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext,
+ bool bAlignAxisValuesWithColumns);
+
+ /** Initializes and prepares the target and data table shape */
+ void initializeShapes(const rtl::Reference<SvxShapeGroupAnyD>& xTarget);
+
+ /** Prepares the values of the chart, which will be shown it the data table */
+ void initializeValues(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList);
+
+ /** Creates the data table and fills the values */
+ void createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd,
+ sal_Int32 nAxisStepWidth);
+
+ /** Repositions the data table shape */
+ void changePosition(sal_Int32 x, sal_Int32 y);
+};
+
+} //namespace chart
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/LabelPositionHelper.hxx b/chart2/source/view/inc/LabelPositionHelper.hxx
index 63125d621731..4f2f3ba2797a 100644
--- a/chart2/source/view/inc/LabelPositionHelper.hxx
+++ b/chart2/source/view/inc/LabelPositionHelper.hxx
@@ -39,7 +39,7 @@ public:
LabelPositionHelper() = delete;
LabelPositionHelper(
sal_Int32 nDimensionCount
- , const rtl::Reference<SvxShapeGroupAnyD>& xLogicTarget );
+ , rtl::Reference<SvxShapeGroupAnyD> xLogicTarget );
virtual ~LabelPositionHelper();
css::awt::Point transformSceneToScreenPosition(
diff --git a/chart2/source/view/inc/LegendEntryProvider.hxx b/chart2/source/view/inc/LegendEntryProvider.hxx
index e0133771cd27..ce7722b0edfd 100644
--- a/chart2/source/view/inc/LegendEntryProvider.hxx
+++ b/chart2/source/view/inc/LegendEntryProvider.hxx
@@ -36,6 +36,7 @@ namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class FormattedString;
enum class LegendSymbolStyle
{
@@ -62,8 +63,16 @@ struct ViewLegendEntry
/** The descriptive text for a legend entry.
*/
- css::uno::Sequence<
- css::uno::Reference< css::chart2::XFormattedString2 > > aLabel;
+ rtl::Reference< ::chart::FormattedString > xLabel;
+};
+
+
+struct ViewLegendSymbol
+{
+ /** The legend symbol that represents a data series or other
+ information contained in the legend
+ */
+ rtl::Reference<SvxShapeGroup> xSymbol;
};
class LegendEntryProvider
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx
index c0480a4e3b2c..916668dd6c14 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -400,11 +400,7 @@ inline bool PlottingPositionHelper::clipYRange( double& rMin, double& rMax ) con
{
//returns true if something remains
if( rMin > rMax )
- {
- double fHelp = rMin;
- rMin = rMax;
- rMax = fHelp;
- }
+ std::swap( rMin, rMax );
if( rMin > getLogicMaxY() )
return false;
if( rMax < getLogicMinY() )
diff --git a/chart2/source/view/inc/PropertyMapper.hxx b/chart2/source/view/inc/PropertyMapper.hxx
index 652a6a05131c..c4d9a1fa2577 100644
--- a/chart2/source/view/inc/PropertyMapper.hxx
+++ b/chart2/source/view/inc/PropertyMapper.hxx
@@ -20,7 +20,6 @@
#include <sal/config.h>
-#include <optional>
#include <unordered_map>
#include <com/sun/star/uno/Sequence.h>
@@ -28,7 +27,6 @@
namespace com::sun::star::beans { class XPropertySet; }
class SvxShape;
-class SdrPathObj;
namespace chart
{
@@ -102,9 +100,6 @@ public:
static const tPropertyNameMap& getPropertyNameMapForTextShapeProperties();
static const tPropertyNameMap& getPropertyNameMapForFilledSeriesProperties();
- static void setPropertyNameMapForFilledSeriesProperties(SdrPathObj* pShape,
- const css::uno::Reference< css::beans::XPropertySet >& xSource,
- std::optional<sal_Int32> xFillColor = {});
static const tPropertyNameMap& getPropertyNameMapForLineSeriesProperties();
static const tPropertyNameMap& getPropertyNameMapForTextLabelProperties();
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index c9e7aab8384a..b44612e74a4f 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -27,6 +27,7 @@
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <svx/unoshape.hxx>
+#include <svx/unodraw/SvxTableShape.hxx>
#include <svx/unopage.hxx>
namespace chart { struct VLineProperties; }
@@ -40,7 +41,6 @@ namespace com::sun::star::drawing { struct Position3D; }
namespace com::sun::star::graphic { class XGraphic; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
namespace com::sun::star::drawing { struct Direction3D; }
-class SdrPathObj;
namespace chart
{
@@ -148,10 +148,9 @@ public:
, const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon
, double fDepth);
- static SdrPathObj*
+ static rtl::Reference<SvxShapePolyPolygon>
createArea2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget
- , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon
- , bool bSetZOrderToZero = true);
+ , const std::vector<std::vector<css::drawing::Position3D>>& rPolyPolygon);
static rtl::Reference<SvxShapePolyPolygon>
createSymbol2D( const rtl::Reference<SvxShapeGroupAnyD>& xTarget
@@ -205,7 +204,7 @@ public:
static rtl::Reference<SvxShapeText>
createText(const rtl::Reference<SvxShapeGroupAnyD>& xTarget
- , css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString
+ , const css::uno::Sequence< css::uno::Reference< css::chart2::XFormattedString > >& xFormattedString
, const tNameSequence& rPropNames
, const tAnySequence& rPropValues
, const css::uno::Any& rATransformation);
@@ -218,6 +217,8 @@ public:
const css::uno::Reference< css::beans::XPropertySet > & xTextProperties,
double nRotation, const OUString& aName, sal_Int32 nTextMaxWidth );
+ static rtl::Reference<SvxTableShape> createTable(rtl::Reference<SvxShapeGroupAnyD> const& xTarget, OUString const& rName = OUString());
+
static rtl::Reference<SvxShapeRect>
createInvisibleRectangle(
const rtl::Reference<SvxShapeGroupAnyD>& xTarget
@@ -249,8 +250,6 @@ public:
static void setShapeName( const rtl::Reference< SvxShape >& xShape
, const OUString& rName );
- static void setShapeName( SdrPathObj* pPath
- , const OUString& rName );
static OUString getShapeName( const css::uno::Reference< css::drawing::XShape >& xShape );
@@ -259,7 +258,7 @@ public:
static OUString getStackedString( const OUString& rString, bool bStacked );
static bool hasPolygonAnyLines( const std::vector<std::vector<css::drawing::Position3D>>& rPoly );
- static bool isPolygonEmptyOrSinglePoint( css::drawing::PolyPolygonShape3D& rPoly );
+ static bool isPolygonEmptyOrSinglePoint( const css::drawing::PolyPolygonShape3D& rPoly );
static bool isPolygonEmptyOrSinglePoint( const std::vector<std::vector<css::drawing::Position3D>>& rPoly );
static void closePolygon( css::drawing::PolyPolygonShape3D& rPoly );
static void closePolygon( std::vector<std::vector<css::drawing::Position3D>>& rPoly );
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx
index 2beac4a05631..61dda842d02b 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -20,6 +20,7 @@
#include "MinimumAndMaximumSupplier.hxx"
#include <ThreeDHelper.hxx>
+#include "VSeriesPlotter.hxx"
#include <chartview/ExplicitScaleValues.hxx>
#include <com/sun/star/drawing/HomogenMatrix.hpp>
#include <com/sun/star/uno/Sequence.h>
@@ -30,8 +31,6 @@
#include <memory>
#include <vector>
-namespace chart { class ExplicitCategoriesProvider; }
-namespace chart { class ScaleAutomatism; }
namespace com::sun::star::awt { struct Rectangle; }
namespace com::sun::star::awt { struct Size; }
namespace com::sun::star::beans { class XPropertySet; }
@@ -40,12 +39,16 @@ namespace com::sun::star::chart2 { class XChartDocument; }
namespace com::sun::star::chart2 { class XCoordinateSystem; }
namespace com::sun::star::drawing { class XShapes; }
namespace com::sun::star::lang { class XMultiServiceFactory; }
-
+namespace com::sun::star::uno { class XComponentContext; }
namespace chart
{
+class ExplicitCategoriesProvider;
+class ScaleAutomatism;
+class ChartModel;
+class Axis;
class BaseCoordinateSystem;
-
+class GridProperties;
class VAxisBase;
class VCoordinateSystem
@@ -115,10 +118,12 @@ public:
* Create "view" axis objects 'VAxis' from the coordinate system model.
*/
virtual void createVAxisList(
- const css::uno::Reference< css::chart2::XChartDocument> & xChartDoc
- , const css::awt::Size& rFontReferenceSize
- , const css::awt::Rectangle& rMaximumSpaceForLabels
- , bool bLimitSpaceForLabels );
+ const rtl::Reference<::chart::ChartModel> & xChartDoc,
+ const css::awt::Size& rFontReferenceSize,
+ const css::awt::Rectangle& rMaximumSpaceForLabels,
+ bool bLimitSpaceForLabels,
+ std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList,
+ css::uno::Reference<css::uno::XComponentContext> const& rComponentContext);
virtual void initVAxisInList();
virtual void updateScalesAndIncrementsOnAxes();
@@ -138,22 +143,20 @@ public:
void setSeriesNamesForAxis( const css::uno::Sequence< OUString >& rSeriesNames );
protected: //methods
- VCoordinateSystem( const rtl::Reference< ::chart::BaseCoordinateSystem >& xCooSys );
+ VCoordinateSystem( rtl::Reference< ::chart::BaseCoordinateSystem > xCooSys );
- css::uno::Reference< css::chart2::XAxis >
+ rtl::Reference< ::chart::Axis >
getAxisByDimension( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex ) const;
- static css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet > >
- getGridListFromAxis( const css::uno::Reference< css::chart2::XAxis >& xAxis );
+ static std::vector< rtl::Reference< ::chart::GridProperties > >
+ getGridListFromAxis( const rtl::Reference< ::chart::Axis >& xAxis );
VAxisBase* getVAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
OUString createCIDForAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
OUString createCIDForGrid( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
- sal_Int32 getNumberFormatKeyForAxis( const css::uno::Reference<
- css::chart2::XAxis >& xAxis
- , const css::uno::Reference<
- css::chart2::XChartDocument>& xChartDoc);
+ sal_Int32 getNumberFormatKeyForAxis( const rtl::Reference< ::chart::Axis >& xAxis
+ , const rtl::Reference<::chart::ChartModel>& xChartDoc);
private: //methods
static void impl_adjustDimension( sal_Int32& rDimensionIndex );
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index 11d916510961..dd5054d26bd8 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -20,11 +20,13 @@
#include "PropertyMapper.hxx"
+#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/chart2/StackingDirection.hpp>
-#include <com/sun/star/drawing/PolyPolygonShape3D.hpp>
+#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
+#include <com/sun/star/chart2/PieChartSubType.hpp>
#include <rtl/ref.hxx>
#include <svx/unoshape.hxx>
@@ -35,12 +37,12 @@ namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::chart2 { class XChartType; }
namespace com::sun::star::chart2 { class XDataSeries; }
namespace com::sun::star::chart2::data { class XDataSequence; }
-namespace com::sun::star::chart2 { struct DataPointLabel; }
-namespace com::sun::star::chart2 { struct Symbol; }
namespace com::sun::star::drawing { class XShapes; }
namespace chart
{
+class ChartType;
+class DataSeries;
class VDataSequence
{
@@ -52,22 +54,21 @@ public:
sal_Int32 detectNumberFormatKey( sal_Int32 index ) const;
sal_Int32 getLength() const;
- css::uno::Reference<css::chart2::data::XDataSequence> Model;
-
- mutable css::uno::Sequence<double> Doubles;
+ css::uno::Reference<css::chart2::data::XDataSequence> m_xModel;
+ mutable css::uno::Sequence<double> m_aValues;
};
class VDataSeries final
{
public:
- VDataSeries( const css::uno::Reference<css::chart2::XDataSeries>& xDataSeries );
+ VDataSeries( const rtl::Reference<::chart::DataSeries>& xDataSeries );
~VDataSeries();
VDataSeries(const VDataSeries&) = delete;
const VDataSeries& operator=(const VDataSeries&) = delete;
- const css::uno::Reference<css::chart2::XDataSeries>& getModel() const;
+ const rtl::Reference<::chart::DataSeries>& getModel() const;
void setCategoryXAxis();
void setXValues( const css::uno::Reference<css::chart2::data::XDataSequence>& xValues );
@@ -107,15 +108,16 @@ public:
sal_Int32 detectNumberFormatKey( sal_Int32 nPointIndex ) const;
sal_Int32 getLabelPlacement(
- sal_Int32 nPointIndex, const css::uno::Reference<css::chart2::XChartType>& xChartType,
+ sal_Int32 nPointIndex, const rtl::Reference<::chart::ChartType>& xChartType,
bool bSwapXAndY ) const;
css::awt::Point getLabelPosition( css::awt::Point aTextShapePos, sal_Int32 nPointIndex ) const;
bool isLabelCustomPos( sal_Int32 nPointIndex ) const;
+ css::awt::Size getLabelCustomSize(sal_Int32 nPointIndex) const;
css::uno::Reference<css::beans::XPropertySet> getPropertiesOfPoint( sal_Int32 index ) const;
- css::uno::Reference<css::beans::XPropertySet> getPropertiesOfSeries() const;
+ const css::uno::Reference<css::beans::XPropertySet> & getPropertiesOfSeries() const;
css::chart2::Symbol* getSymbolProperties( sal_Int32 index ) const;
@@ -194,7 +196,7 @@ public: //member
rtl::Reference<SvxShapeGroupAnyD> m_xBackSubGroupShape;
private: //member
- css::uno::Reference<css::chart2::XDataSeries> m_xDataSeries;
+ rtl::Reference<::chart::DataSeries> m_xDataSeries;
css::uno::Reference<css::beans::XPropertySet> m_xDataSeriesProps; // cached
//all points given by the model data (here are not only the visible points meant)
@@ -238,20 +240,19 @@ private: //member
sal_Int32 m_nGlobalSeriesIndex;
//some cached values for data labels as they are very expensive
- mutable std::unique_ptr<css::chart2::DataPointLabel>
- m_apLabel_Series;
- mutable std::unique_ptr<tNameSequence> m_apLabelPropNames_Series;
- mutable std::unique_ptr<tAnySequence> m_apLabelPropValues_Series;
- mutable std::unique_ptr<css::chart2::Symbol> m_apSymbolProperties_Series;
-
- mutable std::unique_ptr<css::chart2::DataPointLabel>
- m_apLabel_AttributedPoint;
- mutable std::unique_ptr<tNameSequence> m_apLabelPropNames_AttributedPoint;
- mutable std::unique_ptr<tAnySequence> m_apLabelPropValues_AttributedPoint;
- mutable std::unique_ptr<css::chart2::Symbol> m_apSymbolProperties_AttributedPoint;
- mutable std::unique_ptr<css::chart2::Symbol>
- m_apSymbolProperties_InvisibleSymbolForSelection;
- mutable sal_Int32 m_nCurrentAttributedPoint;
+ mutable std::optional<css::chart2::DataPointLabel>
+ m_oLabel_Series;
+ mutable std::optional<tNameSequence> m_oLabelPropNames_Series;
+ mutable std::optional<tAnySequence> m_oLabelPropValues_Series;
+ mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_Series;
+
+ mutable std::optional<css::chart2::DataPointLabel>
+ m_oLabel_AttributedPoint;
+ mutable std::optional<tNameSequence> m_oLabelPropNames_AttributedPoint;
+ mutable std::optional<tAnySequence> m_oLabelPropValues_AttributedPoint;
+ mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_AttributedPoint;
+ mutable std::optional<css::chart2::Symbol> m_oSymbolProperties_InvisibleSymbolForSelection;
+ mutable sal_Int32 m_nCurrentAttributedPoint;
css::awt::Size m_aReferenceSize;
sal_Int32 m_nMissingValueTreatment;
diff --git a/chart2/source/view/inc/VDiagram.hxx b/chart2/source/view/inc/VDiagram.hxx
index 7d8dd3069479..ab391f7bc0d3 100644
--- a/chart2/source/view/inc/VDiagram.hxx
+++ b/chart2/source/view/inc/VDiagram.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/awt/Point.hpp>
#include <svx/unoshape.hxx>
+#include <rtl/ref.hxx>
namespace com::sun::star::beans { class XPropertySet; }
namespace com::sun::star::chart2 { class XDiagram; }
@@ -32,7 +33,7 @@ namespace com::sun::star::drawing { class XShape; }
namespace chart
{
-
+class Diagram;
class ShapeFactory;
/** The VDiagram is responsible to generate the visible parts of the Diagram
@@ -44,7 +45,7 @@ diagram.
class VDiagram final
{
public: //methods
- VDiagram( const css::uno::Reference<css::chart2::XDiagram>& xDiagram,
+ VDiagram( const rtl::Reference<::chart::Diagram>& xDiagram,
const css::drawing::Direction3D& rPreferredAspectRatio,
sal_Int32 nDimension );
~VDiagram();
@@ -92,8 +93,8 @@ private: //members
rtl::Reference<SvxShapeGroupAnyD> m_xCoordinateRegionShape;
rtl::Reference<SvxShapeRect> m_xWall2D;
- sal_Int32 m_nDimensionCount;
- css::uno::Reference< css::chart2::XDiagram > m_xDiagram;
+ sal_Int32 m_nDimensionCount;
+ rtl::Reference< ::chart::Diagram > m_xDiagram;
css::drawing::Direction3D m_aPreferredAspectRatio;
css::uno::Reference< css::beans::XPropertySet > m_xAspectRatio3D;
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index 83d97bc8b671..45676830b538 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -49,6 +49,7 @@ namespace com::sun::star {
namespace chart {
+class ChartType;
class NumberFormatterWrapper;
class AxesNumberFormats
@@ -215,10 +216,22 @@ public:
const css::uno::Reference< css::uno::XComponentContext >& xContext
);
- std::vector< VDataSeries* > getAllSeries();
+ std::vector<ViewLegendSymbol> createSymbols(
+ const css::awt::Size& rEntryKeyAspectRatio
+ , const rtl::Reference<SvxShapeGroupAnyD>& xTarget
+ , const css::uno::Reference<css::uno::XComponentContext>& xContext);
+
+ std::vector<ViewLegendSymbol> createSymbolsForSeries(
+ const css::awt::Size& rEntryKeyAspectRatio
+ , const VDataSeries& rSeries
+ , const rtl::Reference<SvxShapeGroupAnyD>& xTarget
+ , const css::uno::Reference<css::uno::XComponentContext>& xContext);
+
+ std::vector<VDataSeries*> getAllSeries();
+ std::vector<VDataSeries const*> getAllSeries() const;
// This method creates a series plotter of the requested type; e.g. : return new PieChart...
- static VSeriesPlotter* createSeriesPlotter( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ static VSeriesPlotter* createSeriesPlotter( const rtl::Reference< ::chart::ChartType >& xChartTypeModel
, sal_Int32 nDimensionCount
, bool bExcludingPositioning /*for pie and donut charts labels and exploded segments are excluded from the given size*/);
@@ -232,8 +245,13 @@ public:
void setExplicitCategoriesProvider( ExplicitCategoriesProvider* pExplicitCategoriesProvider );
+ ExplicitCategoriesProvider* getExplicitCategoriesProvider() { return m_pExplicitCategoriesProvider; }
+
//get series names for the z axis labels
- css::uno::Sequence< OUString > getSeriesNames() const;
+ css::uno::Sequence<OUString> getSeriesNames() const;
+
+ //get all series names
+ css::uno::Sequence<OUString> getAllSeriesNames() const;
void setPageReferenceSize( const css::awt::Size & rPageRefSize );
//better performance for big data
@@ -252,9 +270,16 @@ public:
bool WantToPlotInFrontOfAxisLine();
virtual bool shouldSnapRectToUsedArea();
+ /// This method returns a text string representation of the passed numeric
+ /// value by exploiting a NumberFormatterWrapper object.
+ OUString getLabelTextForValue(VDataSeries const & rDataSeries, sal_Int32 nPointIndex,
+ double fValue, bool bAsPercentage);
+
+ sal_Int32 getRenderOrder() const;
+
protected:
- VSeriesPlotter( const css::uno::Reference< css::chart2::XChartType >& xChartTypeModel
+ VSeriesPlotter( rtl::Reference< ::chart::ChartType > xChartTypeModel
, sal_Int32 nDimensionCount
, bool bCategoryXAxis=true );
@@ -320,13 +345,6 @@ protected:
, sal_Int32 nOffset=0
, sal_Int32 nTextWidth = 0 );
- /// This method returns a text string representation of the passed numeric
- /// value by exploiting a NumberFormatterWrapper object.
- OUString getLabelTextForValue( VDataSeries const & rDataSeries
- , sal_Int32 nPointIndex
- , double fValue
- , bool bAsPercentage );
-
/** creates two T-shaped error bars in both directions (up/down or
left/right depending on the bVertical parameter)
@@ -398,8 +416,7 @@ protected:
protected:
PlottingPositionHelper* m_pMainPosHelper;
- css::uno::Reference< css::chart2::XChartType > m_xChartTypeModel;
- css::uno::Reference< css::beans::XPropertySet > m_xChartTypeModelProps;
+ rtl::Reference< ::chart::ChartType > m_xChartTypeModel;
std::vector< std::vector< VDataSeriesGroup > > m_aZSlots;