LibreOffice Module chart2 (master) 1
DataTableView.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 */
9
10#include <DataTableView.hxx>
11#include <VSeriesPlotter.hxx>
12#include <ShapeFactory.hxx>
14#include <ChartModel.hxx>
15#include <ObjectIdentifier.hxx>
16
17#include <svx/svdotable.hxx>
18
19#include <com/sun/star/table/BorderLine.hpp>
20#include <com/sun/star/table/BorderLine2.hpp>
21#include <com/sun/star/table/TableBorder.hpp>
22#include <com/sun/star/table/BorderLineStyle.hpp>
23#include <com/sun/star/text/XTextRange.hpp>
24#include <com/sun/star/text/XText.hpp>
25#include <com/sun/star/style/ParagraphAdjust.hpp>
26#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
27#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
28#include <com/sun/star/drawing/LineDash.hpp>
29#include <com/sun/star/drawing/LineStyle.hpp>
30#include <com/sun/star/drawing/FillStyle.hpp>
31#include <com/sun/star/util/XBroadcaster.hpp>
32#include <com/sun/star/container/XNameContainer.hpp>
33#include <com/sun/star/uno/XComponentContext.hpp>
34
36
37using namespace css;
38
39namespace chart
40{
41namespace
42{
43void setTopCell(uno::Reference<beans::XPropertySet>& xPropertySet)
44{
45 xPropertySet->setPropertyValue("FillColor", uno::Any(Color(0xFFFFFF)));
46 xPropertySet->setPropertyValue("TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_TOP));
47 xPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_CENTER));
48
49 table::BorderLine2 aBorderLine;
50 aBorderLine.LineWidth = 0;
51 aBorderLine.Color = 0x000000;
52
53 xPropertySet->setPropertyValue("TopBorder", uno::Any(aBorderLine));
54 xPropertySet->setPropertyValue("LeftBorder", uno::Any(aBorderLine));
55}
56
57void copyProperty(uno::Reference<beans::XPropertySet>& xOut,
58 uno::Reference<beans::XPropertySet>& xIn, OUString const& sPropertyName)
59{
60 xOut->setPropertyValue(sPropertyName, xIn->getPropertyValue(sPropertyName));
61}
62
63uno::Reference<text::XTextRange> getFirstParagraph(uno::Reference<text::XText> const& xText)
64{
65 uno::Reference<text::XTextRange> xParagraph;
66 uno::Reference<container::XEnumerationAccess> xEnumAccess(xText, uno::UNO_QUERY);
67 if (!xEnumAccess.is())
68 return xParagraph;
69 uno::Reference<container::XEnumeration> xEnumeration(xEnumAccess->createEnumeration());
70 xParagraph.set(xEnumeration->nextElement(), uno::UNO_QUERY);
71 return xParagraph;
72}
73
74uno::Reference<beans::XPropertySet>
75getFirstParagraphProperties(uno::Reference<text::XText> const& xText)
76{
77 uno::Reference<beans::XPropertySet> xPropertySet;
78 auto xParagraph = getFirstParagraph(xText);
79 if (!xParagraph.is())
80 return xPropertySet;
81 xPropertySet.set(xParagraph, uno::UNO_QUERY);
82 return xPropertySet;
83}
84
85} // end anonymous namespace
86
88 rtl::Reference<::chart::ChartModel> const& xChartModel,
89 rtl::Reference<DataTable> const& rDataTableModel,
90 css::uno::Reference<css::uno::XComponentContext> const& rComponentContext,
91 bool bAlignAxisValuesWithColumns)
92 : m_xChartModel(xChartModel)
93 , m_xDataTableModel(rDataTableModel)
94 , m_xComponentContext(rComponentContext)
95 , m_bAlignAxisValuesWithColumns(bAlignAxisValuesWithColumns)
96{
99}
100
103{
105
106 copyProperty(xPropertySet, xDataTableProperties, "CharColor");
107 copyProperty(xPropertySet, xDataTableProperties, "CharFontFamily");
108 copyProperty(xPropertySet, xDataTableProperties, "CharFontFamilyAsian");
109 copyProperty(xPropertySet, xDataTableProperties, "CharFontFamilyComplex");
110 copyProperty(xPropertySet, xDataTableProperties, "CharFontCharSet");
111 copyProperty(xPropertySet, xDataTableProperties, "CharFontCharSetAsian");
112 copyProperty(xPropertySet, xDataTableProperties, "CharFontCharSetComplex");
113 copyProperty(xPropertySet, xDataTableProperties, "CharFontName");
114 copyProperty(xPropertySet, xDataTableProperties, "CharFontNameAsian");
115 copyProperty(xPropertySet, xDataTableProperties, "CharFontNameComplex");
116 copyProperty(xPropertySet, xDataTableProperties, "CharFontPitch");
117 copyProperty(xPropertySet, xDataTableProperties, "CharFontPitchAsian");
118 copyProperty(xPropertySet, xDataTableProperties, "CharFontPitchComplex");
119 copyProperty(xPropertySet, xDataTableProperties, "CharFontStyleName");
120 copyProperty(xPropertySet, xDataTableProperties, "CharFontStyleNameAsian");
121 copyProperty(xPropertySet, xDataTableProperties, "CharFontStyleNameComplex");
122
123 copyProperty(xPropertySet, xDataTableProperties, "CharHeight");
124 copyProperty(xPropertySet, xDataTableProperties, "CharHeightAsian");
125 copyProperty(xPropertySet, xDataTableProperties, "CharHeightComplex");
126 copyProperty(xPropertySet, xDataTableProperties, "CharKerning");
127 copyProperty(xPropertySet, xDataTableProperties, "CharLocale");
128 copyProperty(xPropertySet, xDataTableProperties, "CharLocaleAsian");
129 copyProperty(xPropertySet, xDataTableProperties, "CharLocaleComplex");
130 copyProperty(xPropertySet, xDataTableProperties, "CharPosture");
131 copyProperty(xPropertySet, xDataTableProperties, "CharPostureAsian");
132 copyProperty(xPropertySet, xDataTableProperties, "CharPostureComplex");
133 copyProperty(xPropertySet, xDataTableProperties, "CharRelief");
134 copyProperty(xPropertySet, xDataTableProperties, "CharShadowed");
135 copyProperty(xPropertySet, xDataTableProperties, "CharStrikeout");
136 copyProperty(xPropertySet, xDataTableProperties, "CharUnderline");
137 copyProperty(xPropertySet, xDataTableProperties, "CharUnderlineColor");
138 copyProperty(xPropertySet, xDataTableProperties, "CharUnderlineHasColor");
139 copyProperty(xPropertySet, xDataTableProperties, "CharOverline");
140 copyProperty(xPropertySet, xDataTableProperties, "CharOverlineColor");
141 copyProperty(xPropertySet, xDataTableProperties, "CharOverlineHasColor");
142 copyProperty(xPropertySet, xDataTableProperties, "CharWeight");
143 copyProperty(xPropertySet, xDataTableProperties, "CharWeightAsian");
144 copyProperty(xPropertySet, xDataTableProperties, "CharWeightComplex");
145 copyProperty(xPropertySet, xDataTableProperties, "CharWordMode");
146
147 drawing::FillStyle eFillStyle = drawing::FillStyle_NONE;
148 xDataTableProperties->getPropertyValue("FillStyle") >>= eFillStyle;
149 if (eFillStyle == drawing::FillStyle_SOLID)
150 {
151 sal_Int32 aColor = 0;
152 if (xDataTableProperties->getPropertyValue("FillColor") >>= aColor)
153 xPropertySet->setPropertyValue("CharBackColor", uno::Any(aColor));
154 }
155
156 xPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_CENTER));
157}
158
159void DataTableView::setCellProperties(css::uno::Reference<beans::XPropertySet>& xPropertySet,
160 bool bLeft, bool bTop, bool bRight, bool bBottom)
161{
162 xPropertySet->setPropertyValue("FillColor", uno::Any(Color(0xFFFFFF)));
163
165 float fFontHeight = 0.0;
166 xDataTableProperties->getPropertyValue("CharHeight") >>= fFontHeight;
167 fFontHeight = o3tl::convert(fFontHeight, o3tl::Length::pt, o3tl::Length::mm100);
168 sal_Int32 nXDistance = std::round(fFontHeight * 0.18f);
169 sal_Int32 nYDistance = std::round(fFontHeight * 0.30f);
170
171 xPropertySet->setPropertyValue("TextLeftDistance", uno::Any(nXDistance));
172 xPropertySet->setPropertyValue("TextRightDistance", uno::Any(nXDistance));
173 xPropertySet->setPropertyValue("TextUpperDistance", uno::Any(nYDistance));
174 xPropertySet->setPropertyValue("TextLowerDistance", uno::Any(nYDistance));
175
176 xPropertySet->setPropertyValue("TextVerticalAdjust", uno::Any(drawing::TextVerticalAdjust_TOP));
177
178 drawing::LineStyle eStyle = drawing::LineStyle_NONE;
179 m_aLineProperties.LineStyle >>= eStyle;
180
181 if (eStyle != drawing::LineStyle_NONE)
182 {
183 table::BorderLine2 aBorderLine;
184
185 sal_Int32 nWidth = 0;
186 m_aLineProperties.Width >>= nWidth;
187 aBorderLine.LineWidth = o3tl::convert(nWidth, o3tl::Length::mm100, o3tl::Length::twip);
188
189 sal_Int32 nColor = 0;
190 m_aLineProperties.Color >>= nColor;
191 aBorderLine.Color = nColor;
192
193 aBorderLine.LineStyle = table::BorderLineStyle::SOLID;
194
195 if (eStyle == drawing::LineStyle_DASH)
196 {
197 OUString aDashName;
198 m_aLineProperties.DashName >>= aDashName;
199 if (!aDashName.isEmpty() && m_xChartModel.is())
200 {
202 m_xChartModel->createInstance("com.sun.star.drawing.DashTable"),
203 uno::UNO_QUERY);
204 if (xDashTable.is() && xDashTable->hasByName(aDashName))
205 {
206 drawing::LineDash aLineDash;
207 xDashTable->getByName(aDashName) >>= aLineDash;
208
209 if (aLineDash.Dots == 0 && aLineDash.Dashes == 0)
210 aBorderLine.LineStyle = table::BorderLineStyle::SOLID;
211 else if (aLineDash.Dots == 1 && aLineDash.Dashes == 0)
212 aBorderLine.LineStyle = table::BorderLineStyle::DOTTED;
213 else if (aLineDash.Dots == 0 && aLineDash.Dashes == 1)
214 aBorderLine.LineStyle = table::BorderLineStyle::DASHED;
215 else if (aLineDash.Dots == 1 && aLineDash.Dashes == 1)
216 aBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT;
217 else if (aLineDash.Dots == 2 && aLineDash.Dashes == 1)
218 aBorderLine.LineStyle = table::BorderLineStyle::DASH_DOT_DOT;
219 else
220 aBorderLine.LineStyle = table::BorderLineStyle::DASHED;
221 }
222 }
223 }
224
225 if (bLeft)
226 xPropertySet->setPropertyValue("LeftBorder", uno::Any(aBorderLine));
227 if (bTop)
228 xPropertySet->setPropertyValue("TopBorder", uno::Any(aBorderLine));
229 if (bRight)
230 xPropertySet->setPropertyValue("RightBorder", uno::Any(aBorderLine));
231 if (bBottom)
232 xPropertySet->setPropertyValue("BottomBorder", uno::Any(aBorderLine));
233 }
234}
235
237 sal_Int32 nAxisStepWidth)
238{
239 if (!m_xTarget.is())
240 return;
241
242 // Remove shapes first before we add the new ones
247
248 // calculate the table size
249 auto rDelta = rEnd - rStart;
250 sal_Int32 nTableSize = basegfx::fround(rDelta.getX());
251 m_xTableShape->setSize({ nTableSize, 0 });
252
253 try
254 {
255 m_xTableShape->getPropertyValue("Model") >>= m_xTable;
256 }
257 catch (const uno::Exception&)
258 {
259 return;
260 }
261
262 if (!m_xTable.is())
263 return;
264
265 uno::Reference<util::XBroadcaster> xBroadcaster(m_xTable, uno::UNO_QUERY);
266
267 if (!xBroadcaster.is())
268 return;
269
270 xBroadcaster->lockBroadcasts();
271
272 auto* pTableObject = static_cast<sdr::table::SdrTableObj*>(m_xTableShape->GetSdrObject());
273
274 // get the data table properties from the model
275 bool bHBorder = false;
276 bool bVBorder = false;
277 bool bOutline = false;
278 bool bKeys = false;
279
280 std::vector<ViewLegendSymbol> aSymbols;
281
282 m_xDataTableModel->getPropertyValue("HBorder") >>= bHBorder;
283 m_xDataTableModel->getPropertyValue("VBorder") >>= bVBorder;
284 m_xDataTableModel->getPropertyValue("Outline") >>= bOutline;
285 m_xDataTableModel->getPropertyValue("Keys") >>= bKeys;
286
287 // set the data table row and column size
288 sal_Int32 nColumnCount = m_aXValues.size();
289 uno::Reference<table::XTableColumns> xTableColumns = m_xTable->getColumns();
290 xTableColumns->insertByIndex(0, nColumnCount);
291
292 sal_Int32 nRowCount = m_aDataSeriesNames.size();
293 uno::Reference<table::XTableRows> xTableRows = m_xTable->getRows();
294 xTableRows->insertByIndex(0, nRowCount);
295
296 sal_Int32 nColumnWidth = 0.0;
297
298 // If we don't align, we have to calculate the column width ourselves,
299 // otherwise the column width is taken from the x-axis width
301 nColumnWidth = nAxisStepWidth;
302 else
303 nColumnWidth = double(nTableSize) / nColumnCount;
304
305 // Setup empty top-left cell
306 {
307 uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(0, 0);
308 uno::Reference<beans::XPropertySet> xPropertySet(xCell, uno::UNO_QUERY);
309 if (xPropertySet.is())
310 {
311 setTopCell(xPropertySet);
312 }
313 }
314
315 sal_Int32 nColumn;
316 sal_Int32 nRow;
317
318 // COLUMN HEADER
319
320 nColumn = 1;
321 for (auto const& rString : m_aXValues)
322 {
323 uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(nColumn, 0);
324 uno::Reference<beans::XPropertySet> xPropertySet(xCell, uno::UNO_QUERY);
325 uno::Reference<text::XTextRange> xCellTextRange(xCell, uno::UNO_QUERY);
326 if (xCellTextRange.is())
327 {
328 auto xText = xCellTextRange->getText();
329 xText->insertString(xText->getStart(), rString, false);
330 auto xTextPropertySet = getFirstParagraphProperties(xText);
331 if (!xTextPropertySet.is())
332 continue;
333
334 bool bLeft
335 = (bOutline && nColumn == 1) || (bVBorder && nColumn > 1 && nColumn < nColumnCount);
336 bool bRight = (bOutline && nColumn == nColumnCount)
337 || (bVBorder && nColumn > 1 && nColumn < nColumnCount);
338 setCellCharAndParagraphProperties(xTextPropertySet);
339 setCellProperties(xPropertySet, bLeft, bOutline, bRight, bOutline);
340 }
341 nColumn++;
342 }
343
344 // ROW HEADER
345 // Prepare keys (symbols)
346 sal_Int32 nMaxSymbolWidth = 0;
347 constexpr const sal_Int32 constSymbolMargin = 100; // 1mm
348 if (bKeys)
349 {
351 float fFontHeight = 0.0;
352 xDataTableProperties->getPropertyValue("CharHeight") >>= fFontHeight;
353 fFontHeight = o3tl::convert(fFontHeight, o3tl::Length::pt, o3tl::Length::mm100);
354
355 sal_Int32 nSymbolHeight = sal_Int32(fFontHeight * 0.6);
356 sal_Int32 nSymbolWidth = nSymbolHeight;
357
358 for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList)
359 {
360 if (pSeriesPlotter)
361 {
362 awt::Size aCurrentRatio = pSeriesPlotter->getPreferredLegendKeyAspectRatio();
363 sal_Int32 nCurrentWidth = aCurrentRatio.Width;
364 if (aCurrentRatio.Height > 0)
365 nCurrentWidth = nSymbolHeight * aCurrentRatio.Width / aCurrentRatio.Height;
366 nSymbolWidth = std::max(nSymbolWidth, nCurrentWidth);
367 }
368 }
369 nMaxSymbolWidth = nSymbolWidth;
370
371 for (VSeriesPlotter* pSeriesPlotter : m_pSeriesPlotterList)
372 {
373 if (pSeriesPlotter)
374 {
375 awt::Size aSize(nSymbolWidth, nSymbolHeight);
376 std::vector<ViewLegendSymbol> aNewEntries
377 = pSeriesPlotter->createSymbols(aSize, m_xTarget, m_xComponentContext);
378
379 for (auto const& rSymbol : aNewEntries)
380 aSymbols.push_back(rSymbol);
381 }
382 }
383 }
384
385 nRow = 1;
386 for (auto const& rSeriesName : m_aDataSeriesNames)
387 {
388 uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(0, nRow);
389 uno::Reference<beans::XPropertySet> xCellPropertySet(xCell, uno::UNO_QUERY);
390 uno::Reference<text::XTextRange> xCellTextRange(xCell, uno::UNO_QUERY);
391 if (xCellTextRange.is())
392 {
393 bool bTop = (bOutline && nRow == 1) || (bHBorder && nRow > 1 && nRow < nRowCount);
394 bool bBottom
395 = (bOutline && nRow == nRowCount) || (bHBorder && nRow > 1 && nRow < nRowCount);
396
397 auto xText = xCellTextRange->getText();
398 xText->insertString(xText->getStart(), rSeriesName, false);
399 auto xTextPropertySet = getFirstParagraphProperties(xText);
400 if (!xTextPropertySet.is())
401 continue;
402 setCellCharAndParagraphProperties(xTextPropertySet);
403 setCellProperties(xCellPropertySet, bOutline, bTop, bOutline, bBottom);
404
405 xCellPropertySet->setPropertyValue("ParaAdjust", uno::Any(style::ParagraphAdjust_LEFT));
406 if (bKeys)
407 {
408 xCellPropertySet->setPropertyValue(
409 "ParaLeftMargin", uno::Any(nMaxSymbolWidth + sal_Int32(2 * constSymbolMargin)));
410 }
411 }
412 nRow++;
413 }
414
415 // TABLE
416 nRow = 1;
417 for (auto const& rSeries : m_pDataSeriesValues)
418 {
419 nColumn = 1;
420 for (auto const& rValue : rSeries)
421 {
422 uno::Reference<table::XCell> xCell = m_xTable->getCellByPosition(nColumn, nRow);
423 uno::Reference<beans::XPropertySet> xCellPropertySet(xCell, uno::UNO_QUERY);
424 uno::Reference<text::XTextRange> xCellTextRange(xCell, uno::UNO_QUERY);
425 if (xCellTextRange.is())
426 {
427 auto xText = xCellTextRange->getText();
428 xText->insertString(xText->getStart(), rValue, false);
429 auto xTextPropertySet = getFirstParagraphProperties(xText);
430 if (!xTextPropertySet.is())
431 continue;
432
433 bool bLeft = false;
434 bool bTop = false;
435 bool bRight = false;
436 bool bBottom = false;
437
438 if (nColumn > 1 && bVBorder)
439 bLeft = true;
440
441 if (nRow > 1 && bHBorder)
442 bTop = true;
443
444 if (nRow == nRowCount && bOutline)
445 bBottom = true;
446
447 if (nColumn == nColumnCount && bOutline)
448 bRight = true;
449
450 setCellCharAndParagraphProperties(xTextPropertySet);
451 setCellProperties(xCellPropertySet, bLeft, bTop, bRight, bBottom);
452 }
453 nColumn++;
454 }
455 nRow++;
456 }
457
458 xBroadcaster->unlockBroadcasts();
459
460 // force recalculation of all cells in the table shape
461 pTableObject->DistributeColumns(0, nColumnCount, true, true);
462 pTableObject->DistributeRows(0, nRowCount, true, true);
463
464 xBroadcaster->lockBroadcasts();
465
466 // reposition the data table
468
469 sal_Int32 nTableX = m_xTableShape->getPosition().X;
470 sal_Int32 nTableY = m_xTableShape->getPosition().Y;
471
472 uno::Reference<beans::XPropertySet> xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY);
473
474 for (sal_Int32 i = 1; i < xTableColumns->getCount(); ++i)
475 {
476 xPropertySet.set(xTableColumns->getByIndex(i), uno::UNO_QUERY);
477 xPropertySet->setPropertyValue("Width", uno::Any(nColumnWidth));
478 }
479
480 if (bKeys)
481 {
482 sal_Int32 nTotalHeight = 0;
483 for (sal_Int32 i = 0; i < xTableRows->getCount(); i++)
484 {
485 sal_Int32 nSymbolIndex = i - 1;
486 if (nSymbolIndex < sal_Int32(aSymbols.size()))
487 {
488 xPropertySet.set(xTableRows->getByIndex(i), uno::UNO_QUERY);
489 sal_Int32 nHeight = 0;
490 xPropertySet->getPropertyValue("Height") >>= nHeight;
491 if (i > 0)
492 {
493 auto& rSymbol = aSymbols[nSymbolIndex].xSymbol;
494 sal_Int32 nSymbolHeight = rSymbol->getSize().Height;
495 sal_Int32 nSymbolY
496 = basegfx::fround(double(nHeight) / 2.0 - double(nSymbolHeight) / 2.0);
497 rSymbol->setPosition(
498 { nTableX + constSymbolMargin, nTableY + nTotalHeight + nSymbolY });
499 }
500 nTotalHeight += nHeight;
501 }
502 }
503 }
504 xBroadcaster->unlockBroadcasts();
505}
506
507void DataTableView::changePosition(sal_Int32 x, sal_Int32 y)
508{
509 if (!m_xTable.is())
510 return;
511
512 uno::Reference<table::XTableColumns> xTableColumns = m_xTable->getColumns();
513 uno::Reference<beans::XPropertySet> xPropertySet(xTableColumns->getByIndex(0), uno::UNO_QUERY);
514
515 sal_Int32 nWidth = 0;
516 xPropertySet->getPropertyValue("Width") >>= nWidth;
517
518 m_xTarget->setPosition({ x - nWidth, y });
519}
520
522{
524}
525
527 std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList)
528{
529 for (auto& rSeriesPlotter : rSeriesPlotterList)
530 {
531 m_pSeriesPlotterList.push_back(rSeriesPlotter.get());
532
533 for (auto const& rCategory :
534 rSeriesPlotter->getExplicitCategoriesProvider()->getSimpleCategories())
535 {
536 m_aXValues.push_back(rCategory);
537 }
538
539 for (auto const& rString : rSeriesPlotter->getAllSeriesNames())
540 {
541 m_aDataSeriesNames.push_back(rString);
542 }
543
544 for (VDataSeries* pSeries : rSeriesPlotter->getAllSeries())
545 {
546 auto& rValues = m_pDataSeriesValues.emplace_back();
547 for (int i = 0; i < pSeries->getTotalPointCount(); i++)
548 {
549 double nValue = pSeries->getYValue(i);
550 rValues.push_back(rSeriesPlotter->getLabelTextForValue(*pSeries, i, nValue, false));
551 }
552 }
553 }
554}
555
556} //namespace chart
557
558/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TYPE getX() const
TYPE getY() const
rtl::Reference< DataTable > m_xDataTableModel
void setCellProperties(css::uno::Reference< css::beans::XPropertySet > &xPropertySet, bool bLeft, bool bTop, bool bRight, bool bBottom)
Set the common cell properties (for all cells in the data table, including headers)
rtl::Reference< SvxTableShape > m_xTableShape
void initializeShapes(const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
Initializes and prepares the target and data table shape.
void changePosition(sal_Int32 x, sal_Int32 y)
Repositions the data table shape.
std::vector< VSeriesPlotter * > m_pSeriesPlotterList
VLineProperties m_aLineProperties
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
rtl::Reference< SvxShapeGroupAnyD > m_xTarget
void setCellCharAndParagraphProperties(css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
Set the char and paragraph properties for the input (value) cell.
rtl::Reference<::chart::ChartModel > m_xChartModel
DataTableView(rtl::Reference<::chart::ChartModel > const &xChartDoc, rtl::Reference< DataTable > const &rDataTableModel, css::uno::Reference< css::uno::XComponentContext > const &rComponentContext, bool bAlignAxisValuesWithColumns)
std::vector< OUString > m_aXValues
css::uno::Reference< css::table::XTable > m_xTable
void createShapes(basegfx::B2DVector const &rStart, basegfx::B2DVector const &rEnd, sal_Int32 nAxisStepWidth)
Creates the data table and fills the values.
std::vector< OUString > m_aDataSeriesNames
void initializeValues(std::vector< std::unique_ptr< VSeriesPlotter > > &rSeriesPlotterList)
Prepares the values of the chart, which will be shown it the data table.
std::vector< std::vector< OUString > > m_pDataSeriesValues
static OUString createClassifiedIdentifierForParticle(std::u16string_view rParticle)
static OUString createParticleForDataTable(const rtl::Reference<::chart::ChartModel > &xChartModel)
Creates an identifier for the data table.
static rtl::Reference< SvxTableShape > createTable(rtl::Reference< SvxShapeGroupAnyD > const &xTarget, OUString const &rName=OUString())
static void removeSubShapes(const rtl::Reference< SvxShapeGroupAnyD > &xShapes)
Reference< XComponentContext > const m_xComponentContext
float y
float x
Reference< XInterface > xTarget
sal_Int16 nValue
B2IRange fround(const B2DRange &rRange)
int i
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
void initFromPropertySet(const css::uno::Reference< css::beans::XPropertySet > &xProp)