summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-10-15 11:48:57 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-11-19 13:47:36 +0100
commit0574f59c6ab46c5a5c077ce5c63a0e2dedf865f1 (patch)
tree35f526b5863e183ced0c769dce4646bdf72a6c7d /chart2
parent401f01caf5b357ac6c15b37a89c0a9aaeb46f4e4 (diff)
add methods to render whole data series at once
additionally we have now a method for timebased data series in the shape factory. The method contains the two points in time and the rendering backend should calculate intermitiate points for a good interpolation. Change-Id: Id30e2039ec90a6c36e947b7a7f9bca65ef0e8961
Diffstat (limited to 'chart2')
-rw-r--r--chart2/Library_chartcore.mk5
-rw-r--r--chart2/inc/DataSeriesState.hxx71
-rw-r--r--chart2/source/view/inc/AbstractShapeFactory.hxx12
-rw-r--r--chart2/source/view/inc/DummyShapeFactory.hxx9
-rw-r--r--chart2/source/view/inc/ShapeFactory.hxx9
-rw-r--r--chart2/source/view/main/DummyShapeFactory.cxx13
-rw-r--r--chart2/source/view/main/ShapeFactory.cxx18
7 files changed, 136 insertions, 1 deletions
diff --git a/chart2/Library_chartcore.mk b/chart2/Library_chartcore.mk
index 53fbd2ac5d89..1923261764c9 100644
--- a/chart2/Library_chartcore.mk
+++ b/chart2/Library_chartcore.mk
@@ -25,7 +25,10 @@ $(eval $(call gb_Library_add_defs,chartcore,\
$(eval $(call gb_Library_set_precompiled_header,chartcore,$(SRCDIR)/chart2/inc/pch/precompiled_chartcore))
-$(eval $(call gb_Library_use_external,chartcore,boost_headers))
+$(eval $(call gb_Library_use_externals,chartcore,\
+ boost_headers \
+ mdds_headers \
+))
$(eval $(call gb_Library_use_custom_headers,chartcore,\
officecfg/registry \
diff --git a/chart2/inc/DataSeriesState.hxx b/chart2/inc/DataSeriesState.hxx
new file mode 100644
index 000000000000..bfe14c98f809
--- /dev/null
+++ b/chart2/inc/DataSeriesState.hxx
@@ -0,0 +1,71 @@
+/* -*- 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/.
+ */
+
+#ifndef DATASERIES_HXX
+#define DATASERIES_HXX
+
+#include <rtl/ustring.hxx>
+#include <mdds/multi_type_vector.hpp>
+#include <mdds/multi_type_vector_trait.hpp>
+#include <vector>
+#include <map>
+
+#include <com/sun/star/uno/Any.h>
+
+namespace chart {
+
+class DataSeries
+{
+public:
+ typedef mdds::multi_type_vector<mdds::mtv::element_block_func> DataSeriesType;
+
+ DataSeriesType getDataSeries();
+
+ size_t size();
+ double getValue(size_t nIndex);
+
+private:
+ OUString maLabel;
+ DataSeriesType maDataSeries;
+
+};
+
+/**
+ * point properties overwrite series properties
+ */
+struct DataSeriesProperties
+{
+ typedef std::map< OUString, com::sun::star::uno::Any > PropertyMap;
+ PropertyMap aSeriesProps;
+ std::vector< PropertyMap > aPointProps;
+};
+
+struct Axis
+{
+ double nMin;
+ double nMax;
+ bool bLog;
+ bool bInverseDirection;
+};
+
+struct DataSeriesState
+{
+ DataSeries aXValue;
+ DataSeries aYValue;
+ DataSeriesProperties aProperties;
+ std::map<OUString, DataSeries> aMapProperties;
+ Axis aXAxis;
+ Axis aYAxis;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx
index 5f915f032151..6a25e9ec6573 100644
--- a/chart2/source/view/inc/AbstractShapeFactory.hxx
+++ b/chart2/source/view/inc/AbstractShapeFactory.hxx
@@ -29,6 +29,8 @@
#include <rtl/ustring.hxx>
+#include "DataSeriesState.hxx"
+
namespace chart {
@@ -225,6 +227,16 @@ public:
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage ) = 0;
+
+ virtual void createSeries( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rSeriesState ) = 0;
+
+ virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rOldSeriesState,
+ const DataSeriesState& rNewSeriesState ) = 0;
+
static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
diff --git a/chart2/source/view/inc/DummyShapeFactory.hxx b/chart2/source/view/inc/DummyShapeFactory.hxx
index e3731f8a2c96..aa8b38cea8f6 100644
--- a/chart2/source/view/inc/DummyShapeFactory.hxx
+++ b/chart2/source/view/inc/DummyShapeFactory.hxx
@@ -174,6 +174,15 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTarget );
+ virtual void createSeries( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rSeriesState );
+
+ virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rOldSeriesState,
+ const DataSeriesState& rNewSeriesState );
+
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 1cf87b417c5a..a88893c57063 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -189,6 +189,15 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XShapes >& xTarget );
+ virtual void createSeries( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rSeriesState );
+
+ virtual void pushNextSeriesState( const com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShapes> & xTarget,
+ const DataSeriesState& rOldSeriesState,
+ const DataSeriesState& rNewSeriesState );
+
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getOrCreateChartRootShape( const ::com::sun::star::uno::Reference<
::com::sun::star::drawing::XDrawPage>& xPage );
diff --git a/chart2/source/view/main/DummyShapeFactory.cxx b/chart2/source/view/main/DummyShapeFactory.cxx
index 4eb6283e774b..f0c8bdd7a025 100644
--- a/chart2/source/view/main/DummyShapeFactory.cxx
+++ b/chart2/source/view/main/DummyShapeFactory.cxx
@@ -280,6 +280,19 @@ uno::Reference< drawing::XShape >
return new DummyXShape();
}
+void DummyShapeFactory::createSeries( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& )
+{
+}
+
+void DummyShapeFactory::pushNextSeriesState( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& ,
+ const DataSeriesState& )
+{
+}
+
} //namespace dummy
} //namespace chart
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index a0abdafeb46f..9a7f59e2e7d2 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -2119,6 +2119,24 @@ uno::Reference< drawing::XShape >
return xShape;
}
+void ShapeFactory::createSeries( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& )
+{
+ // unsupported for now
+ throw uno::RuntimeException();
+}
+
+void ShapeFactory::pushNextSeriesState( const uno::Reference<
+ drawing::XShapes> & ,
+ const DataSeriesState& ,
+ const DataSeriesState& )
+{
+ // unsupported for now
+ // do we actually want to support this in the normal
+ // rendering code?
+ throw uno::RuntimeException();
+}
uno::Reference< drawing::XShape >
ShapeFactory::createText( const uno::Reference< drawing::XShapes >& xTarget,