diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-07-18 08:12:19 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-16 08:15:00 +0200 |
commit | 9d6ffcc0572cc7917651489c69ca4b3452e89a89 (patch) | |
tree | 3ff18216d78d614d51d680aa9846892bab02e646 /chart2/source/view/inc | |
parent | 777f1dbb96fc4499e682f2f67969410408f53b50 (diff) |
chart2: Data table rendering of keys (legend symbols)
Change-Id: Iff13b188df18fe8f9919274869774f53f2ea323b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138299
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/source/view/inc')
-rw-r--r-- | chart2/source/view/inc/DataTableView.hxx | 16 | ||||
-rw-r--r-- | chart2/source/view/inc/LegendEntryProvider.hxx | 9 | ||||
-rw-r--r-- | chart2/source/view/inc/VCoordinateSystem.hxx | 4 | ||||
-rw-r--r-- | chart2/source/view/inc/VSeriesPlotter.hxx | 11 |
4 files changed, 36 insertions, 4 deletions
diff --git a/chart2/source/view/inc/DataTableView.hxx b/chart2/source/view/inc/DataTableView.hxx index 8a0f11bed772..3d00a9644ba3 100644 --- a/chart2/source/view/inc/DataTableView.hxx +++ b/chart2/source/view/inc/DataTableView.hxx @@ -12,6 +12,9 @@ #include <svx/unoshape.hxx> #include <svx/unodraw/SvxTableShape.hxx> #include <com/sun/star/awt/Rectangle.hpp> +#include <com/sun/star/text/XTextRange.hpp> +#include <com/sun/star/text/XText.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <DataTable.hxx> #include "VLineProperties.hxx" @@ -19,6 +22,7 @@ namespace chart { class VSeriesPlotter; class ChartModel; +class LegendEntryProvider; class DataTableView final { @@ -27,18 +31,24 @@ private: rtl::Reference<SvxShapeGroupAnyD> m_xTarget; rtl::Reference<SvxTableShape> m_xTableShape; rtl::Reference<DataTable> m_xDataTableModel; + css::uno::Reference<css::uno::XComponentContext> m_xComponentContext; VLineProperties m_aLineProperties; + std::vector<VSeriesPlotter*> m_pSeriesPlotterList; std::vector<OUString> m_aDataSeriesNames; std::vector<OUString> m_aXValues; std::vector<std::vector<OUString>> m_pDataSeriesValues; - void setCellDefaults(css::uno::Reference<css::beans::XPropertySet>& xPropertySet, bool bLeft, - bool bTop, bool bRight, bool bBottom); + void + setCellCharAndParagraphProperties(css::uno::Reference<css::beans::XPropertySet>& xPropertySet); + + 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); + rtl::Reference<DataTable> const& rDataTableModel, + css::uno::Reference<css::uno::XComponentContext> const& rComponentContext); void initializeShapes(const rtl::Reference<SvxShapeGroupAnyD>& xTarget); void initializeValues(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList); void createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd, diff --git a/chart2/source/view/inc/LegendEntryProvider.hxx b/chart2/source/view/inc/LegendEntryProvider.hxx index e0133771cd27..d89447f38429 100644 --- a/chart2/source/view/inc/LegendEntryProvider.hxx +++ b/chart2/source/view/inc/LegendEntryProvider.hxx @@ -66,6 +66,15 @@ struct ViewLegendEntry css::uno::Reference< css::chart2::XFormattedString2 > > aLabel; }; + +struct ViewLegendSymbol +{ + /** The legend symbol that represents a data series or other + information contained in the legend + */ + rtl::Reference<SvxShapeGroup> xSymbol; +}; + class LegendEntryProvider { public: diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx b/chart2/source/view/inc/VCoordinateSystem.hxx index 50d1cd9b2c4f..a9643bf967ad 100644 --- a/chart2/source/view/inc/VCoordinateSystem.hxx +++ b/chart2/source/view/inc/VCoordinateSystem.hxx @@ -39,6 +39,7 @@ 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 { @@ -120,7 +121,8 @@ public: const css::awt::Size& rFontReferenceSize, const css::awt::Rectangle& rMaximumSpaceForLabels, bool bLimitSpaceForLabels, - std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList); + std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList, + css::uno::Reference<css::uno::XComponentContext> const& rComponentContext); virtual void initVAxisInList(); virtual void updateScalesAndIncrementsOnAxes(); diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx index 50901bf64a5a..eaf27495d0ed 100644 --- a/chart2/source/view/inc/VSeriesPlotter.hxx +++ b/chart2/source/view/inc/VSeriesPlotter.hxx @@ -216,6 +216,17 @@ public: const css::uno::Reference< css::uno::XComponentContext >& xContext ); + 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; |