20#include <oox/token/namespaces.hxx>
21#include <oox/token/properties.hxx>
22#include <oox/token/tokens.hxx>
33#include <com/sun/star/awt/Gradient2.hpp>
34#include <com/sun/star/chart/XChartDocument.hpp>
35#include <com/sun/star/chart/ChartLegendPosition.hpp>
36#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
37#include <com/sun/star/chart/XTwoAxisYSupplier.hpp>
38#include <com/sun/star/chart/XAxisZSupplier.hpp>
39#include <com/sun/star/chart/ChartDataRowSource.hpp>
40#include <com/sun/star/chart/X3DDisplay.hpp>
41#include <com/sun/star/chart/XStatisticDisplay.hpp>
42#include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
43#include <com/sun/star/chart/ChartSymbolType.hpp>
44#include <com/sun/star/chart/ChartAxisMarks.hpp>
45#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
46#include <com/sun/star/chart/ChartAxisPosition.hpp>
47#include <com/sun/star/chart/ChartSolidType.hpp>
48#include <com/sun/star/chart/DataLabelPlacement.hpp>
49#include <com/sun/star/chart/ErrorBarStyle.hpp>
50#include <com/sun/star/chart/MissingValueTreatment.hpp>
51#include <com/sun/star/chart/XDiagramPositioning.hpp>
52#include <com/sun/star/chart/TimeIncrement.hpp>
53#include <com/sun/star/chart/TimeInterval.hpp>
54#include <com/sun/star/chart/TimeUnit.hpp>
56#include <com/sun/star/chart2/RelativePosition.hpp>
57#include <com/sun/star/chart2/RelativeSize.hpp>
58#include <com/sun/star/chart2/XChartDocument.hpp>
59#include <com/sun/star/chart2/XDiagram.hpp>
60#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
61#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
62#include <com/sun/star/chart2/XChartTypeContainer.hpp>
63#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
64#include <com/sun/star/chart2/DataPointLabel.hpp>
65#include <com/sun/star/chart2/XDataPointCustomLabelField.hpp>
66#include <com/sun/star/chart2/DataPointCustomLabelFieldType.hpp>
67#include <com/sun/star/chart2/Symbol.hpp>
68#include <com/sun/star/chart2/data/XDataSource.hpp>
69#include <com/sun/star/chart2/data/XDataProvider.hpp>
70#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
71#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
72#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
73#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
74#include <com/sun/star/chart2/AxisType.hpp>
76#include <com/sun/star/beans/XPropertySet.hpp>
77#include <com/sun/star/container/XNameAccess.hpp>
78#include <com/sun/star/drawing/XShape.hpp>
79#include <com/sun/star/drawing/XShapes.hpp>
80#include <com/sun/star/drawing/FillStyle.hpp>
81#include <com/sun/star/drawing/LineStyle.hpp>
82#include <com/sun/star/awt/XBitmap.hpp>
83#include <com/sun/star/lang/XMultiServiceFactory.hpp>
84#include <com/sun/star/lang/XServiceName.hpp>
86#include <com/sun/star/table/CellAddress.hpp>
87#include <com/sun/star/sheet/XFormulaParser.hpp>
88#include <com/sun/star/sheet/FormulaToken.hpp>
89#include <com/sun/star/sheet/AddressConvention.hpp>
91#include <com/sun/star/container/XNamed.hpp>
92#include <com/sun/star/embed/XVisualObject.hpp>
93#include <com/sun/star/embed/Aspects.hpp>
107#include <unordered_set>
113using namespace css::uno;
114using namespace css::drawing;
116using css::beans::PropertyValue;
117using css::beans::XPropertySet;
118using css::container::XNamed;
119using css::table::CellAddress;
120using css::sheet::XFormulaParser;
121using ::oox::core::XmlFilterBase;
122using ::sax_fastparser::FSHelperPtr;
124namespace cssc = css::chart;
130bool isPrimaryAxes(sal_Int32 nIndex)
132 assert(nIndex == 0 || nIndex == 1);
139 explicit lcl_MatchesRole( OUString aRole ) :
143 bool operator () (
const Reference< chart2::data::XLabeledDataSequence > & xSeq )
const
147 Reference< beans::XPropertySet > xProp( xSeq->getValues(), uno::UNO_QUERY );
150 return ( xProp.is() &&
151 (xProp->getPropertyValue(
"Role" ) >>= aRole ) &&
163 bHasDateCategories =
false;
168 xDiagram, uno::UNO_QUERY_THROW );
170 xCooSysCnt->getCoordinateSystems());
171 for(
const auto& xCooSys : aCooSysSeq )
173 OSL_ASSERT( xCooSys.is());
174 for( sal_Int32 nN = xCooSys->getDimension(); nN--; )
176 const sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(nN);
177 for(sal_Int32 nI=0; nI<=nMaxAxisIndex; ++nI)
180 OSL_ASSERT( xAxis.is());
183 chart2::ScaleData aScaleData = xAxis->getScaleData();
184 if( aScaleData.Categories.is())
186 bHasDateCategories = aScaleData.AxisType == chart2::AxisType::DATE;
187 xResult.set( aScaleData.Categories );
195 catch(
const uno::Exception & )
203static Reference< chart2::data::XLabeledDataSequence >
206 const OUString & rRole )
213 ::std::find_if( pBegin, pEnd, lcl_MatchesRole( rRole ));
225 bool bDateCategories;
227 return xCategories.is();
232 bool bCategoryPositionShifted =
false;
236 xDiagram, uno::UNO_QUERY_THROW);
238 xCooSysCnt->getCoordinateSystems());
239 for (
const auto& xCooSys : aCooSysSeq)
241 OSL_ASSERT(xCooSys.is());
242 if( 0 < xCooSys->getDimension() && 0 <= xCooSys->getMaximumAxisIndexByDimension(0) )
245 OSL_ASSERT(xAxis.is());
248 chart2::ScaleData aScaleData = xAxis->getScaleData();
249 bCategoryPositionShifted = aScaleData.ShiftedCategoryPosition;
255 catch (
const uno::Exception&)
260 return bCategoryPositionShifted;
265 sal_Int32 nAxisType = -1;
269 xDiagram, uno::UNO_QUERY_THROW);
271 xCooSysCnt->getCoordinateSystems());
272 for(
const auto& xCooSys : aCooSysSeq )
274 OSL_ASSERT(xCooSys.is());
275 if( nDimensionIndex < xCooSys->getDimension() && nAxisIndex <= xCooSys->getMaximumAxisIndexByDimension(nDimensionIndex) )
278 OSL_ASSERT(xAxis.is());
281 chart2::ScaleData aScaleData = xAxis->getScaleData();
282 nAxisType = aScaleData.AxisType;
288 catch (
const uno::Exception&)
300 case cssc::TimeUnit::DAY:
return "days";
301 case cssc::TimeUnit::MONTH:
return "months";
302 case cssc::TimeUnit::YEAR:
return "years";
303 default: OSL_ENSURE(
false,
"lclGetTimeUnitToken - unexpected time unit");
310 cssc::TimeIncrement aTimeIncrement;
314 xDiagram, uno::UNO_QUERY_THROW);
316 xCooSysCnt->getCoordinateSystems());
317 for(
const auto& xCooSys : aCooSysSeq )
319 OSL_ASSERT(xCooSys.is());
320 if( 0 < xCooSys->getDimension() && nAxisIndex <= xCooSys->getMaximumAxisIndexByDimension(0) )
323 OSL_ASSERT(xAxis.is());
326 chart2::ScaleData aScaleData = xAxis->getScaleData();
327 aTimeIncrement = aScaleData.TimeIncrement;
333 catch (
const uno::Exception&)
338 return aTimeIncrement;
348 sal_Int32 nAxisIndex = 0;
350 xProp->getPropertyValue(
"AttachedAxisIndex") >>= nAxisIndex;
351 bResult = (0==nAxisIndex);
353 catch(
const uno::Exception & )
363 OUStringBuffer aResult;
364 bool bPrecedeWithSpace =
false;
365 for(
const auto& rString : rSequence )
367 if( !rString.isEmpty())
369 if( bPrecedeWithSpace )
370 aResult.append(
' ' );
371 aResult.append( rString );
372 bPrecedeWithSpace =
true;
375 return aResult.makeStringAndClear();
382 uno::Reference< chart2::data::XTextualDataSequence > xTextualDataSequence( xLabelSeq, uno::UNO_QUERY );
383 if( xTextualDataSequence.is())
385 aLabels = xTextualDataSequence->getTextualData();
387 else if( xLabelSeq.is())
390 aLabels.realloc( aAnies.getLength());
391 auto pLabels = aLabels.getArray();
392 for( sal_Int32
i=0;
i<aAnies.getLength(); ++
i )
401 ::std::vector< OUString > & rOutCategories )
403 OSL_ASSERT( xCategories.is());
404 if( !xCategories.is())
407 if( xTextualDataSequence.is())
409 rOutCategories.clear();
411 rOutCategories.insert( rOutCategories.end(), aTextData.begin(), aTextData.end() );
416 rOutCategories.resize( aAnies.getLength());
417 for( sal_Int32
i=0;
i<aAnies.getLength(); ++
i )
418 aAnies[
i] >>= rOutCategories[
i];
424 ::std::vector< double > aResult;
430 aResult.insert( aResult.end(), aValues.begin(), aValues.end() );
435 aResult.resize( aAnies.getLength(), std::numeric_limits<double>::quiet_NaN() );
436 for( sal_Int32
i=0;
i<aAnies.getLength(); ++
i )
437 aAnies[
i] >>= aResult[
i];
445 if( sChartType ==
u"com.sun.star.chart.BarDiagram"
446 || sChartType ==
u"com.sun.star.chart2.ColumnChartType" )
448 else if( sChartType ==
u"com.sun.star.chart.AreaDiagram"
449 || sChartType ==
u"com.sun.star.chart2.AreaChartType" )
451 else if( sChartType ==
u"com.sun.star.chart.LineDiagram"
452 || sChartType ==
u"com.sun.star.chart2.LineChartType" )
454 else if( sChartType ==
u"com.sun.star.chart.PieDiagram"
455 || sChartType ==
u"com.sun.star.chart2.PieChartType" )
457 else if( sChartType ==
u"com.sun.star.chart.DonutDiagram"
458 || sChartType ==
u"com.sun.star.chart2.DonutChartType" )
460 else if( sChartType ==
u"com.sun.star.chart.XYDiagram"
461 || sChartType ==
u"com.sun.star.chart2.ScatterChartType" )
463 else if( sChartType ==
u"com.sun.star.chart.NetDiagram"
464 || sChartType ==
u"com.sun.star.chart2.NetChartType" )
466 else if( sChartType ==
u"com.sun.star.chart.FilledNetDiagram"
467 || sChartType ==
u"com.sun.star.chart2.FilledNetChartType" )
469 else if( sChartType ==
u"com.sun.star.chart.StockDiagram"
470 || sChartType ==
u"com.sun.star.chart2.CandleStickChartType" )
472 else if( sChartType ==
u"com.sun.star.chart.BubbleDiagram"
473 || sChartType ==
u"com.sun.star.chart2.BubbleChartType" )
526 , mnXmlNamespace( nXmlNamespace )
530 , mbHasCategoryLabels( false )
531 , mbHasZAxis( false )
532 , mbIs3DChart( false )
535 , mbHasDateCategories(false)
546 OUString sChartType =
mxDiagram->getDiagramType();
552uno::Sequence< beans::PropertyValue > createArguments(
553 const OUString & rRangeRepresentation,
bool bUseColumns)
555 css::chart::ChartDataRowSource eRowSource = css::chart::ChartDataRowSource_ROWS;
557 eRowSource = css::chart::ChartDataRowSource_COLUMNS;
559 uno::Sequence<beans::PropertyValue>
aArguments{
560 {
"DataRowSource", -1,
uno::Any(eRowSource), beans::PropertyState_DIRECT_VALUE },
561 {
"FirstCellAsLabel", -1,
uno::Any(
false), beans::PropertyState_DIRECT_VALUE },
562 {
"HasCategories", -1,
uno::Any(
false), beans::PropertyState_DIRECT_VALUE },
563 {
"CellRangeRepresentation", -1,
uno::Any(rRangeRepresentation),
564 beans::PropertyState_DIRECT_VALUE }
570Reference<chart2::XDataSeries> getPrimaryDataSeries(
const Reference<chart2::XChartType>& xChartType)
572 Reference< chart2::XDataSeriesContainer > xDSCnt(xChartType, uno::UNO_QUERY_THROW);
575 const Sequence< Reference< chart2::XDataSeries > > aSeriesSeq(xDSCnt->getDataSeries());
576 for (
const auto& rSeries : aSeriesSeq)
578 Reference<chart2::XDataSeries> xSource(rSeries, uno::UNO_QUERY);
583 return Reference<chart2::XDataSeries>();
591 OSL_ASSERT(xChartDoc.is());
595 OSL_ENSURE(xDataProvider.is(),
"No DataProvider");
596 if (xDataProvider.is())
599 bool bSeriesUsesColumns =
true;
605 for (
const auto& rCooSys : aCooSysSeq)
609 for (
const auto& rChartType : aChartTypeSeq)
612 if (xDataSeries.is())
614 uno::Reference< chart2::data::XDataSource > xSeriesSource(xDataSeries, uno::UNO_QUERY);
615 const uno::Sequence< beans::PropertyValue > rArguments = xDataProvider->detectArguments(xSeriesSource);
616 for (
const beans::PropertyValue& rProperty : rArguments)
618 if (rProperty.Name ==
"DataRowSource")
620 css::chart::ChartDataRowSource eRowSource;
621 if (rProperty.Value >>= eRowSource)
623 bSeriesUsesColumns = (eRowSource == css::chart::ChartDataRowSource_COLUMNS);
632 catch (
const uno::Exception &)
637 if (xChartDoc->hasInternalDataProvider() && rRange ==
"categories")
641 css::uno::Reference< css::chart2::XAnyDescriptionAccess > xDataAccess(xChartDoc->getDataProvider(), uno::UNO_QUERY);
642 const Sequence< Sequence< uno::Any > >aAnyCategories(bSeriesUsesColumns ? xDataAccess->getAnyRowDescriptions() : xDataAccess->getAnyColumnDescriptions());
643 auto pMax = std::max_element(aAnyCategories.begin(), aAnyCategories.end(),
645 return a.getLength() < b.getLength(); });
648 if (pMax != aAnyCategories.end() && pMax->getLength() > 1)
650 sal_Int32 nLevelCount = pMax->getLength();
654 auto pFinalSplitSource = aFinalSplitSource.getArray();
655 for (sal_Int32
i = 0;
i < nLevelCount;
i++)
657 sal_Int32 nElemLabel = 0;
658 pFinalSplitSource[nLevelCount -
i - 1].realloc(aAnyCategories.getLength());
659 auto pSeq = pFinalSplitSource[nLevelCount -
i - 1].getArray();
660 for (
auto const& elemLabel : aAnyCategories)
663 if (elemLabel.getLength() >
i)
665 pSeq[nElemLabel] = elemLabel[
i].get<OUString>();
670 return aFinalSplitSource;
673 catch (
const uno::Exception &)
682 uno::Reference< chart2::data::XDataSource > xCategoriesSource(xDataProvider->createDataSource(
683 createArguments(rRange, bSeriesUsesColumns)));
685 if (xCategoriesSource.is())
688 if (aCategories.getLength() > 1)
693 std::transform(aCategories.begin(), aCategories.end(),
694 std::reverse_iterator(asNonConstRange(aFinalSplitSource).
end()),
697 return aFinalSplitSource;
701 catch (
const uno::Exception &)
721 xParser.set( xSF->createInstance(
"com.sun.star.sheet.FormulaParser"), UNO_QUERY );
728 SAL_WARN_IF(!xParser.is(),
"oox",
"creating formula parser failed");
743 uno::Sequence<sheet::FormulaToken> aTokens = xParser->parseFormula( rRange, CellAddress( 0, 0, 0 ) );
744 if( xParserProps.is() )
746 xParserProps->setPropertyValue(
"FormulaConvention",
uno::Any(css::sheet::AddressConvention::XL_OOX) );
748 xParserProps->setPropertyValue(
"RefConventionChartOOXML",
uno::Any(
true) );
750 aResult = xParser->printFormula( aTokens, CellAddress( 0, 0, 0 ) );
755 OUString aRange( rRange );
756 if( aRange.startsWith(
"$") )
757 aRange = aRange.copy(1);
758 aRange = aRange.replaceAll(
".$",
"!$" );
776 OUString
sName =
"Object 1";
779 sName = xNamed->getName();
782 XML_id, OString::number(nID),
788 if( !sURL.isEmpty() )
795 mpFS->singleElementNS(XML_a, XML_hlinkClick,
FSNS(XML_r, XML_id), sRelId);
809 pFS->startElement(
FSNS(XML_a, XML_graphic));
810 pFS->startElement(
FSNS( XML_a, XML_graphicData ),
811 XML_uri,
"http://schemas.openxmlformats.org/drawingml/2006/chart" );
813 const char* sFullPath =
nullptr;
814 const char* sRelativePath =
nullptr;
819 sFullPath =
"word/charts/chart";
820 sRelativePath =
"charts/chart";
825 sFullPath =
"ppt/charts/chart";
826 sRelativePath =
"../charts/chart";
831 sFullPath =
"xl/charts/chart";
832 sRelativePath =
"../charts/chart";
837 sFullPath =
"charts/chart";
838 sRelativePath =
"charts/chart";
842 OUString sFullStream = OUStringBuffer()
843 .appendAscii(sFullPath)
844 .append(OUString::number(nChartCount) +
".xml")
845 .makeStringAndClear();
846 OUString sRelativeStream = OUStringBuffer()
847 .appendAscii(sRelativePath)
848 .append(OUString::number(nChartCount) +
".xml" )
849 .makeStringAndClear();
853 pFS->getOutputStream(),
854 "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
859 pFS->singleElement(
FSNS( XML_c, XML_chart ),
864 pFS->endElement(
FSNS( XML_a, XML_graphicData ) );
865 pFS->endElement(
FSNS( XML_a, XML_graphic ) );
871 pChart->endDocument();
882 OSL_ENSURE( xDataProvider.is(),
"No DataProvider" );
883 if( xDataProvider.is())
888 catch(
const uno::Exception & )
897 OSL_ASSERT( xChartDoc.is() );
898 if( !xChartDoc.is() )
911 bool bIncludeTable =
true;
920 if( ! (xDPServiceInfo.is() && xDPServiceInfo->getImplementationName() ==
"com.sun.star.comp.chart.InternalDataProvider" ))
922 bIncludeTable =
false;
929 OSL_FAIL(
"Couldn't export chart due to wrong XModel" );
938 pFS->startElement(
FSNS( XML_c, XML_chartSpace ),
943 pFS->singleElement(
FSNS(XML_c, XML_lang), XML_val,
"en-US");
945 pFS->singleElement(
FSNS(XML_c, XML_roundedCorners), XML_val,
"0");
968 pFS->endElement(
FSNS( XML_c, XML_chartSpace ) );
978 OUString externalDataPath;
980 if( xDocPropSet.is())
984 Any aAny( xDocPropSet->getPropertyValue(
"ExternalData" ));
985 aAny >>= externalDataPath;
987 catch( beans::UnknownPropertyException & )
989 SAL_WARN(
"oox",
"Required property not found in ChartDocument");
992 if(externalDataPath.isEmpty())
996 OUString relationPath = externalDataPath;
998 if( externalDataPath[ 0 ] !=
'.' && externalDataPath[ 1 ] !=
'.')
1000 sal_Int32 nSepPos = externalDataPath.indexOf(
'/', 0 );
1003 relationPath = relationPath.copy( nSepPos, ::std::max< sal_Int32 >( externalDataPath.getLength(), 0 ) - nSepPos );
1004 relationPath =
".." + relationPath;
1009 if (relationPath.endsWith(
".bin"))
1015 pFS->singleElementNS(XML_c, XML_externalData,
FSNS(XML_r, XML_id), sRelId);
1021 if (!xDocPropSet.is())
1024 css::uno::Reference< css::drawing::XShapes > mxAdditionalShapes;
1028 Any aShapesAny = xDocPropSet->getPropertyValue(
"AdditionalShapes");
1029 if( (aShapesAny >>= mxAdditionalShapes) && mxAdditionalShapes.is() )
1032 const char* sFullPath =
nullptr;
1033 const char* sRelativePath =
nullptr;
1040 sFullPath =
"word/drawings/drawing";
1041 sRelativePath =
"../drawings/drawing";
1046 sFullPath =
"ppt/drawings/drawing";
1047 sRelativePath =
"../drawings/drawing";
1052 sFullPath =
"xl/drawings/drawing";
1053 sRelativePath =
"../drawings/drawing";
1058 sFullPath =
"drawings/drawing";
1059 sRelativePath =
"drawings/drawing";
1063 OUString sFullStream = OUStringBuffer()
1064 .appendAscii(sFullPath)
1065 .append(OUString::number(nDrawing) +
".xml")
1066 .makeStringAndClear();
1067 OUString sRelativeStream = OUStringBuffer()
1068 .appendAscii(sRelativePath)
1069 .append(OUString::number(nDrawing) +
".xml")
1070 .makeStringAndClear();
1076 "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml",
1080 GetFS()->singleElementNS(XML_c, XML_userShapes,
FSNS(XML_r, XML_id),
sId);
1083 pDrawing->startElement(
FSNS(XML_c, XML_userShapes),
1089 const sal_Int32 nShapeCount(mxAdditionalShapes->getCount());
1090 for (sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++)
1093 mxAdditionalShapes->getByIndex(nShapeId) >>= xShape;
1094 SAL_WARN_IF(!xShape.is(),
"xmloff.chart",
"Shape without an XShape?");
1099 pDrawing->startElement(
FSNS(XML_cdr, XML_relSizeAnchor));
1100 uno::Reference< beans::XPropertySet > xShapeProperties(xShape, uno::UNO_QUERY);
1101 if( xShapeProperties.is() )
1104 awt::Size aPageSize = xVisObject->getVisualAreaSize(embed::Aspects::MSOLE_CONTENT);
1110 pDrawing->endElement(
FSNS(XML_cdr, XML_relSizeAnchor));
1112 pDrawing->endElement(
FSNS(XML_c, XML_userShapes));
1113 pDrawing->endDocument();
1116 catch (
const uno::Exception&)
1125 mxDiagram.set( xChartDoc->getDiagram() );
1130 bool bHasMainTitle =
false;
1132 bool bHasLegend =
false;
1134 if( xDocPropSet.is())
1138 Any aAny( xDocPropSet->getPropertyValue(
"HasMainTitle"));
1139 aAny >>= bHasMainTitle;
1140 aAny = xDocPropSet->getPropertyValue(
"HasLegend");
1141 aAny >>= bHasLegend;
1143 catch( beans::UnknownPropertyException & )
1145 SAL_WARN(
"oox",
"Required property not found in ChartDocument");
1150 if( xPropSubTitle.is())
1154 xPropSubTitle->getPropertyValue(
"String") >>= aSubTitle;
1156 catch( beans::UnknownPropertyException & )
1163 pFS->startElement(
FSNS(XML_c, XML_chart));
1168 exportTitle( xChartDoc->getTitle(), !aSubTitle.isEmpty() ? &aSubTitle :
nullptr );
1169 pFS->singleElement(
FSNS(XML_c, XML_autoTitleDeleted), XML_val,
"0");
1171 else if( !aSubTitle.isEmpty() )
1174 pFS->singleElement(
FSNS(XML_c, XML_autoTitleDeleted), XML_val,
"0");
1178 pFS->singleElement(
FSNS(XML_c, XML_autoTitleDeleted), XML_val,
"1");
1190 pFS->startElement(
FSNS(XML_c, XML_floor));
1192 pFS->endElement(
FSNS( XML_c, XML_floor ) );
1201 pFS->startElement(
FSNS(XML_c, XML_sideWall));
1203 pFS->endElement(
FSNS( XML_c, XML_sideWall ) );
1206 pFS->startElement(
FSNS(XML_c, XML_backWall));
1208 pFS->endElement(
FSNS( XML_c, XML_backWall ) );
1218 uno::Reference<beans::XPropertySet> xDiagramPropSet(xChartDoc->getDiagram(), uno::UNO_QUERY);
1219 uno::Any aPlotVisOnly = xDiagramPropSet->getPropertyValue(
"IncludeHiddenCells");
1220 bool bIncludeHiddenCells =
false;
1221 aPlotVisOnly >>= bIncludeHiddenCells;
1222 pFS->singleElement(
FSNS(XML_c, XML_plotVisOnly), XML_val,
ToPsz10(!bIncludeHiddenCells));
1226 pFS->endElement(
FSNS( XML_c, XML_chart ) );
1235 uno::Any aAny = xPropSet->getPropertyValue(
"MissingValueTreatment");
1236 if (!(aAny >>= nVal))
1239 const char* pVal =
nullptr;
1242 case cssc::MissingValueTreatment::LEAVE_GAP:
1245 case cssc::MissingValueTreatment::USE_ZERO:
1248 case cssc::MissingValueTreatment::CONTINUE:
1252 SAL_WARN(
"oox",
"unknown MissingValueTreatment value");
1257 pFS->singleElement(
FSNS(XML_c, XML_dispBlanksAs), XML_val, pVal);
1263 pFS->startElement(
FSNS(XML_c, XML_legend));
1269 css::chart::ChartLegendPosition aLegendPos = css::chart::ChartLegendPosition_NONE;
1272 Any aAny( xProp->getPropertyValue(
"Alignment" ));
1273 aAny >>= aLegendPos;
1275 catch( beans::UnknownPropertyException & )
1277 SAL_WARN(
"oox",
"Property Align not found in ChartLegend");
1280 const char* strPos =
nullptr;
1281 switch( aLegendPos )
1283 case css::chart::ChartLegendPosition_LEFT:
1286 case css::chart::ChartLegendPosition_RIGHT:
1289 case css::chart::ChartLegendPosition_TOP:
1292 case css::chart::ChartLegendPosition_BOTTOM:
1295 case css::chart::ChartLegendPosition_NONE:
1296 case css::chart::ChartLegendPosition::ChartLegendPosition_MAKE_FIXED_SIZE:
1301 if( strPos !=
nullptr )
1303 pFS->singleElement(
FSNS(XML_c, XML_legendPos), XML_val, strPos);
1311 bool bShowLegendEntry;
1312 for (
const auto& rCooSys : xCooSysSequence)
1319 if (!xChartTypeSequence.hasElements())
1322 for (
const auto& rCT : xChartTypeSequence)
1328 OUString aChartType(rCT->getChartType());
1337 nIndex += aDataSeriesSeq.getLength() - 1;
1338 for (
const auto& rDataSeries : aDataSeriesSeq)
1341 bool bVaryColorsByPoint = aSeriesProp.
getBoolProperty(PROP_VaryColorsByPoint);
1342 if (bVaryColorsByPoint || bIsPie)
1345 aSeriesProp.
getProperty(deletedLegendEntriesSeq, PROP_DeletedLegendEntries);
1346 for (
const auto& deletedLegendEntry : std::as_const(deletedLegendEntriesSeq))
1348 pFS->startElement(
FSNS(XML_c, XML_legendEntry));
1349 pFS->singleElement(
FSNS(XML_c, XML_idx), XML_val,
1350 OString::number(
nIndex + deletedLegendEntry));
1351 pFS->singleElement(
FSNS(XML_c, XML_delete), XML_val,
"1");
1352 pFS->endElement(
FSNS(XML_c, XML_legendEntry));
1359 for (
const auto& rDataSeq : aDataSeqs)
1365 sal_Int32 nDataSeqSize = xValues->getData().getLength();
1372 if (!bShowLegendEntry)
1374 pFS->startElement(
FSNS(XML_c, XML_legendEntry));
1375 pFS->singleElement(
FSNS(XML_c, XML_idx), XML_val,
1376 OString::number(
nIndex));
1377 pFS->singleElement(
FSNS(XML_c, XML_delete), XML_val,
"1");
1378 pFS->endElement(
FSNS(XML_c, XML_legendEntry));
1384 nIndex += aDataSeriesSeq.getLength() + 1;
1388 uno::Any aRelativePos = xProp->getPropertyValue(
"RelativePosition");
1391 pFS->startElement(
FSNS(XML_c, XML_layout));
1392 pFS->startElement(
FSNS(XML_c, XML_manualLayout));
1394 pFS->singleElement(
FSNS(XML_c, XML_xMode), XML_val,
"edge");
1395 pFS->singleElement(
FSNS(XML_c, XML_yMode), XML_val,
"edge");
1396 chart2::RelativePosition aPos = aRelativePos.get<chart2::RelativePosition>();
1398 const double x = aPos.Primary;
1399 const double y = aPos.Secondary;
1401 pFS->singleElement(
FSNS(XML_c, XML_x), XML_val, OString::number(
x));
1402 pFS->singleElement(
FSNS(XML_c, XML_y), XML_val, OString::number(
y));
1404 uno::Any aRelativeSize = xProp->getPropertyValue(
"RelativeSize");
1407 chart2::RelativeSize aSize = aRelativeSize.get<chart2::RelativeSize>();
1409 const double w = aSize.Primary;
1410 const double h = aSize.Secondary;
1412 pFS->singleElement(
FSNS(XML_c, XML_w), XML_val, OString::number(
w));
1414 pFS->singleElement(
FSNS(XML_c, XML_h), XML_val, OString::number(
h));
1417 SAL_WARN_IF(aPos.Anchor != css::drawing::Alignment_TOP_LEFT,
"oox",
"unsupported anchor position");
1419 pFS->endElement(
FSNS(XML_c, XML_manualLayout));
1420 pFS->endElement(
FSNS(XML_c, XML_layout));
1423 if (strPos !=
nullptr)
1425 uno::Any aOverlay = xProp->getPropertyValue(
"Overlay");
1426 if(aOverlay.get<
bool>())
1427 pFS->singleElement(
FSNS(XML_c, XML_overlay), XML_val,
"1");
1429 pFS->singleElement(
FSNS(XML_c, XML_overlay), XML_val,
"0");
1439 pFS->endElement(
FSNS( XML_c, XML_legend ) );
1448 xPropSet->getPropertyValue(
"String") >>= sText;
1453 sText = sText.isEmpty() ? *pSubText : sText +
"\n" + *pSubText;
1455 if( sText.isEmpty() )
1459 pFS->startElement(
FSNS(XML_c, XML_title));
1461 pFS->startElement(
FSNS(XML_c, XML_tx));
1462 pFS->startElement(
FSNS(XML_c, XML_rich));
1465 const char* sWritingMode =
nullptr;
1466 bool bVertical =
false;
1467 xPropSet->getPropertyValue(
"StackedText") >>= bVertical;
1469 sWritingMode =
"wordArtVert";
1471 sal_Int32 nRotation = 0;
1472 xPropSet->getPropertyValue(
"TextRotation") >>= nRotation;
1474 pFS->singleElement(
FSNS( XML_a, XML_bodyPr ),
1475 XML_vert, sWritingMode,
1478 pFS->singleElement(
FSNS(XML_a, XML_lstStyle));
1480 pFS->startElement(
FSNS(XML_a, XML_p));
1482 pFS->startElement(
FSNS(XML_a, XML_pPr));
1484 bool bDummy =
false;
1488 pFS->endElement(
FSNS( XML_a, XML_pPr ) );
1490 pFS->startElement(
FSNS(XML_a, XML_r));
1493 pFS->startElement(
FSNS(XML_a, XML_t));
1494 pFS->writeEscaped( sText );
1495 pFS->endElement(
FSNS( XML_a, XML_t ) );
1496 pFS->endElement(
FSNS( XML_a, XML_r ) );
1498 pFS->endElement(
FSNS( XML_a, XML_p ) );
1500 pFS->endElement(
FSNS( XML_c, XML_rich ) );
1501 pFS->endElement(
FSNS( XML_c, XML_tx ) );
1503 uno::Any aManualLayout = xPropSet->getPropertyValue(
"RelativePosition");
1506 pFS->startElement(
FSNS(XML_c, XML_layout));
1507 pFS->startElement(
FSNS(XML_c, XML_manualLayout));
1508 pFS->singleElement(
FSNS(XML_c, XML_xMode), XML_val,
"edge");
1509 pFS->singleElement(
FSNS(XML_c, XML_yMode), XML_val,
"edge");
1512 awt::Size aPageSize = xVisObject->getVisualAreaSize(embed::Aspects::MSOLE_CONTENT);
1514 awt::Size aSize = xShape->getSize();
1515 awt::Point aPos2 = xShape->getPosition();
1517 double fSin = fabs(sin(basegfx::deg2rad<100>(nRotation)));
1519 if( nRotation*0.01 > 180.0 )
1520 aPos2.X -=
static_cast<sal_Int32
>(fSin * aSize.Height + 0.5);
1522 else if( nRotation*0.01 > 0.0 )
1523 aPos2.Y -=
static_cast<sal_Int32
>(fSin * aSize.Width + 0.5);
1525 double x =
static_cast<double>(aPos2.X) /
static_cast<double>(aPageSize.Width);
1526 double y =
static_cast<double>(aPos2.Y) /
static_cast<double>(aPageSize.Height);
1531 pFS->singleElement(
FSNS(XML_c, XML_x), XML_val, OString::number(
x));
1532 pFS->singleElement(
FSNS(XML_c, XML_y), XML_val, OString::number(
y));
1537 pFS->endElement(
FSNS(XML_c, XML_manualLayout));
1538 pFS->endElement(
FSNS(XML_c, XML_layout));
1541 pFS->singleElement(
FSNS(XML_c, XML_overlay), XML_val,
"0");
1549 pFS->endElement(
FSNS( XML_c, XML_title ) );
1556 std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitSeries;
1557 std::map<sal_Int32, size_t> aMapAxisToIndex;
1562 sal_Int32 nAxisIndexOfFirstSeries = -1;
1564 for (
const uno::Reference<chart2::XDataSeries>& xSeries : aSeriesSeq)
1570 sal_Int32 nAxisIndex = -1;
1571 uno::Any aAny = xPropSet->getPropertyValue(
"AttachedAxisIndex");
1572 aAny >>= nAxisIndex;
1573 size_t nVectorPos = 0;
1574 if (nAxisIndexOfFirstSeries == -1)
1576 nAxisIndexOfFirstSeries = nAxisIndex;
1579 auto it = aMapAxisToIndex.find(nAxisIndex);
1580 if (it == aMapAxisToIndex.end())
1582 aSplitSeries.emplace_back();
1583 nVectorPos = aSplitSeries.size() - 1;
1584 aMapAxisToIndex.insert(std::pair<sal_Int32, size_t>(nAxisIndex, nVectorPos));
1588 nVectorPos = it->second;
1591 uno::Sequence<Reference<chart2::XDataSeries> >& rAxisSeriesSeq = aSplitSeries[nVectorPos];
1592 sal_Int32
nLength = rAxisSeriesSeq.getLength();
1593 rAxisSeriesSeq.realloc(nLength + 1);
1594 rAxisSeriesSeq.getArray()[
nLength] = xSeries;
1598 if (aSplitSeries.size() > 1 && nAxisIndexOfFirstSeries == 1)
1600 std::swap(aSplitSeries[0], aSplitSeries[1]);
1604 return aSplitSeries;
1612 if( ! xBCooSysCnt.is())
1618 pFS->startElement(
FSNS(XML_c, XML_plotArea));
1623 uno::Any aAny = xWall->getPropertyValue(
"RelativePosition");
1626 chart2::RelativePosition aPos = aAny.get<chart2::RelativePosition>();
1627 aAny = xWall->getPropertyValue(
"RelativeSize");
1628 chart2::RelativeSize aSize = aAny.get<chart2::RelativeSize>();
1629 uno::Reference< css::chart::XDiagramPositioning > xDiagramPositioning( xChartDoc->getDiagram(), uno::UNO_QUERY );
1630 exportManualLayout(aPos, aSize, xDiagramPositioning->isExcludingDiagramPositioning() );
1636 aCooSysSeq( xBCooSysCnt->getCoordinateSystems());
1639 if (!aCooSysSeq.hasElements())
1641 pFS->startElement(
FSNS(XML_c, XML_barChart));
1642 pFS->singleElement(
FSNS(XML_c, XML_barDir), XML_val,
"col");
1643 pFS->singleElement(
FSNS(XML_c, XML_grouping), XML_val,
"clustered");
1644 pFS->singleElement(
FSNS(XML_c, XML_varyColors), XML_val,
"0");
1646 pFS->endElement(
FSNS(XML_c, XML_barChart));
1649 for(
const auto& rCS : aCooSysSeq )
1656 for(
const auto& rCT : aCTSeq )
1662 if( ! xChartType.is())
1665 OUString aChartType( xChartType->getChartType());
1667 switch( eChartType )
1722 SAL_WARN(
"oox",
"ChartExport::exportPlotArea -- not support chart type");
1748 if( xWallPropSet.is() )
1750 uno::Any aAny = xWallPropSet->getPropertyValue(
"LineStyle");
1756 if ( noSupportWallProp && (aAny != drawing::LineStyle_NONE) )
1758 xWallPropSet->setPropertyValue(
"LineStyle",
uno::Any(drawing::LineStyle_NONE) );
1764 pFS->endElement(
FSNS( XML_c, XML_plotArea ) );
1769 const css::chart2::RelativeSize& rSize,
1770 const bool bIsExcludingDiagramPositioning)
1773 pFS->startElement(
FSNS(XML_c, XML_layout));
1774 pFS->startElement(
FSNS(XML_c, XML_manualLayout));
1777 if ( bIsExcludingDiagramPositioning )
1779 pFS->singleElement(
FSNS(XML_c, XML_layoutTarget), XML_val,
"inner");
1781 pFS->singleElement(
FSNS(XML_c, XML_xMode), XML_val,
"edge");
1782 pFS->singleElement(
FSNS(XML_c, XML_yMode), XML_val,
"edge");
1784 double x = rPos.Primary;
1785 double y = rPos.Secondary;
1786 const double w = rSize.Primary;
1787 const double h = rSize.Secondary;
1788 switch (rPos.Anchor)
1790 case drawing::Alignment_LEFT:
1793 case drawing::Alignment_TOP_LEFT:
1795 case drawing::Alignment_BOTTOM_LEFT:
1798 case drawing::Alignment_TOP:
1801 case drawing::Alignment_CENTER:
1805 case drawing::Alignment_BOTTOM:
1809 case drawing::Alignment_TOP_RIGHT:
1812 case drawing::Alignment_BOTTOM_RIGHT:
1816 case drawing::Alignment_RIGHT:
1821 SAL_WARN(
"oox",
"unhandled alignment case for manual layout export " <<
static_cast<sal_uInt16
>(rPos.Anchor));
1824 pFS->singleElement(
FSNS(XML_c, XML_x), XML_val, OString::number(
x));
1826 pFS->singleElement(
FSNS(XML_c, XML_y), XML_val, OString::number(
y));
1828 pFS->singleElement(
FSNS(XML_c, XML_w), XML_val, OString::number(
w));
1830 pFS->singleElement(
FSNS(XML_c, XML_h), XML_val, OString::number(
h));
1832 pFS->endElement(
FSNS(XML_c, XML_manualLayout));
1833 pFS->endElement(
FSNS(XML_c, XML_layout));
1842 mAny >>= aFillStyle;
1845 if (aFillStyle == FillStyle_SOLID &&
GetProperty( xPropSet,
"FillTransparence" ))
1850 aFillStyle = FillStyle_NONE;
1852 OUString sFillTransparenceGradientName;
1853 if (aFillStyle == FillStyle_SOLID
1854 &&
GetProperty(xPropSet,
"FillTransparenceGradientName") && (
mAny >>= sFillTransparenceGradientName)
1855 && !sFillTransparenceGradientName.isEmpty())
1857 awt::Gradient aTransparenceGradient;
1858 uno::Reference< lang::XMultiServiceFactory > xFact(
getModel(), uno::UNO_QUERY );
1859 uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance(
"com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY);
1860 uno::Any rTransparenceValue = xTransparenceGradient->getByName(sFillTransparenceGradientName);
1861 rTransparenceValue >>= aTransparenceGradient;
1862 if (aTransparenceGradient.StartColor == 0xffffff && aTransparenceGradient.EndColor == 0xffffff)
1863 aFillStyle = FillStyle_NONE;
1865 switch( aFillStyle )
1867 case FillStyle_SOLID:
1870 case FillStyle_GRADIENT :
1873 case FillStyle_BITMAP :
1876 case FillStyle_HATCH:
1879 case FillStyle_NONE:
1880 mpFS->singleElementNS(XML_a, XML_noFill);
1892 sal_uInt32 nFillColor = 0;
1899 sal_Int32 nTransparency = 0;
1900 mAny >>= nTransparency;
1907 bool bNeedGradientFill(
false);
1908 OUString sFillTransparenceGradientName;
1910 if (
GetProperty(xPropSet,
"FillTransparenceGradientName")
1911 && (
mAny >>= sFillTransparenceGradientName)
1912 && !sFillTransparenceGradientName.isEmpty())
1914 uno::Reference< lang::XMultiServiceFactory > xFact(
getModel(), uno::UNO_QUERY );
1915 uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance(
"com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY);
1916 const uno::Any rTransparenceValue = xTransparenceGradient->getByName(sFillTransparenceGradientName);
1922 if (!bNeedGradientFill)
1932 if (bNeedGradientFill)
1936 mpFS->startElementNS(XML_a, XML_gradFill, XML_rotWithShape,
"0");
1938 mpFS->endElementNS(XML_a, XML_gradFill);
1951 OUString aHatchName;
1952 mAny >>= aHatchName;
1953 uno::Reference< lang::XMultiServiceFactory > xFact(
getModel(), uno::UNO_QUERY );
1954 uno::Reference< container::XNameAccess > xHatchTable( xFact->createInstance(
"com.sun.star.drawing.HatchTable"), uno::UNO_QUERY );
1955 uno::Any rValue = xHatchTable->getByName(aHatchName);
1956 css::drawing::Hatch aHatch;
1965 if( !xPropSet.is() )
1968 OUString sFillBitmapName;
1969 xPropSet->getPropertyValue(
"FillBitmapName") >>= sFillBitmapName;
1971 uno::Reference< lang::XMultiServiceFactory > xFact(
getModel(), uno::UNO_QUERY );
1974 uno::Reference< container::XNameAccess > xBitmapTable( xFact->createInstance(
"com.sun.star.drawing.BitmapTable"), uno::UNO_QUERY );
1975 uno::Any rValue = xBitmapTable->getByName( sFillBitmapName );
1976 if (rValue.has<uno::Reference<awt::XBitmap>>())
1978 uno::Reference<awt::XBitmap> xBitmap = rValue.get<uno::Reference<awt::XBitmap>>();
1979 uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
1986 catch (
const uno::Exception &)
1994 if( !xPropSet.is() )
1997 OUString sFillGradientName;
1998 xPropSet->getPropertyValue(
"FillGradientName") >>= sFillGradientName;
2000 uno::Reference< lang::XMultiServiceFactory > xFact(
getModel(), uno::UNO_QUERY );
2003 uno::Reference< container::XNameAccess > xGradient( xFact->createInstance(
"com.sun.star.drawing.GradientTable"), uno::UNO_QUERY );
2004 const uno::Any rGradientValue(xGradient->getByName( sFillGradientName ));
2011 mpFS->startElementNS(XML_a, XML_gradFill);
2012 OUString sFillTransparenceGradientName;
2014 if( (xPropSet->getPropertyValue(
"FillTransparenceGradientName") >>= sFillTransparenceGradientName) && !sFillTransparenceGradientName.isEmpty())
2016 uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance(
"com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY);
2017 const uno::Any rTransparenceValue(xTransparenceGradient->getByName(sFillTransparenceGradientName));
2023 else if (
GetProperty(xPropSet,
"FillTransparence") )
2027 sal_Int32 nTransparency = 0;
2028 mAny >>= nTransparency;
2037 mpFS->endElementNS(XML_a, XML_gradFill);
2040 catch (
const uno::Exception &)
2049 if (!xDataTable.is())
2053 uno::Reference<beans::XPropertySet> aPropSet(xDataTable, uno::UNO_QUERY);
2055 bool bShowVBorder =
false;
2056 bool bShowHBorder =
false;
2057 bool bShowOutline =
false;
2058 bool bShowKeys =
false;
2061 mAny >>= bShowHBorder;
2063 mAny >>= bShowVBorder;
2065 mAny >>= bShowOutline;
2069 pFS->startElement(
FSNS(XML_c, XML_dTable));
2072 pFS->singleElement(
FSNS(XML_c, XML_showHorzBorder), XML_val,
"1" );
2074 pFS->singleElement(
FSNS(XML_c, XML_showVertBorder), XML_val,
"1");
2076 pFS->singleElement(
FSNS(XML_c, XML_showOutline), XML_val,
"1");
2078 pFS->singleElement(
FSNS(XML_c, XML_showKeys), XML_val,
"1");
2083 pFS->endElement(
FSNS(XML_c, XML_dTable));
2089 const std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
2090 for (
const auto& splitDataSeries : aSplitDataSeries)
2092 if (!splitDataSeries.hasElements())
2095 sal_Int32 nTypeId = XML_areaChart;
2097 nTypeId = XML_area3DChart;
2098 pFS->startElement(
FSNS(XML_c, nTypeId));
2101 bool bPrimaryAxes =
true;
2102 exportSeries(xChartType, splitDataSeries, bPrimaryAxes);
2105 pFS->endElement(
FSNS(XML_c, nTypeId));
2111 sal_Int32 nTypeId = XML_barChart;
2113 nTypeId = XML_bar3DChart;
2116 const std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
2117 for (
const auto& splitDataSeries : aSplitDataSeries)
2119 if (!splitDataSeries.hasElements())
2122 pFS->startElement(
FSNS(XML_c, nTypeId));
2124 bool bVertical =
false;
2129 const char* bardir = bVertical ?
"bar" :
"col";
2130 pFS->singleElement(
FSNS(XML_c, XML_barDir), XML_val, bardir);
2136 bool bPrimaryAxes =
true;
2137 exportSeries(xChartType, splitDataSeries, bPrimaryAxes);
2141 if (xTypeProp.is() &&
GetProperty(xTypeProp,
"GapwidthSequence"))
2143 uno::Sequence< sal_Int32 > aBarPositionSequence;
2144 mAny >>= aBarPositionSequence;
2145 if (aBarPositionSequence.hasElements())
2147 sal_Int32 nGapWidth = aBarPositionSequence[0];
2148 pFS->singleElement(
FSNS(XML_c, XML_gapWidth), XML_val, OString::number(nGapWidth));
2155 namespace cssc = css::chart;
2156 sal_Int32 nGeom3d = cssc::ChartSolidType::RECTANGULAR_SOLID;
2157 if (xPropSet.is() &&
GetProperty(xPropSet,
"SolidType"))
2159 const char* sShapeType =
nullptr;
2162 case cssc::ChartSolidType::RECTANGULAR_SOLID:
2165 case cssc::ChartSolidType::CONE:
2166 sShapeType =
"cone";
2168 case cssc::ChartSolidType::CYLINDER:
2169 sShapeType =
"cylinder";
2171 case cssc::ChartSolidType::PYRAMID:
2172 sShapeType =
"pyramid";
2175 pFS->singleElement(
FSNS(XML_c, XML_shape), XML_val, sShapeType);
2181 uno::Sequence< sal_Int32 > aBarPositionSequence;
2182 mAny >>= aBarPositionSequence;
2183 if (aBarPositionSequence.hasElements())
2185 sal_Int32 nOverlap = aBarPositionSequence[0];
2194 pFS->singleElement(
FSNS(XML_c, XML_overlap), XML_val, OString::number(nOverlap));
2198 pFS->singleElement(
FSNS(XML_c, XML_overlap), XML_val, OString::number(nOverlap));
2205 pFS->endElement(
FSNS(XML_c, nTypeId));
2212 const std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
2213 for (
const auto& splitDataSeries : aSplitDataSeries)
2215 if (!splitDataSeries.hasElements())
2218 pFS->startElement(
FSNS(XML_c, XML_bubbleChart));
2222 bool bPrimaryAxes =
true;
2223 exportSeries(xChartType, splitDataSeries, bPrimaryAxes);
2227 pFS->endElement(
FSNS(XML_c, XML_bubbleChart));
2234 pFS->startElement(
FSNS(XML_c, XML_doughnutChart));
2238 bool bPrimaryAxes =
true;
2243 pFS->singleElement(
FSNS(XML_c, XML_holeSize), XML_val, OString::number(50));
2245 pFS->endElement(
FSNS( XML_c, XML_doughnutChart ) );
2252 if (rDLblsRange.
empty())
2255 pFS->startElement(
FSNS(XML_c, XML_extLst));
2256 pFS->startElement(
FSNS(XML_c, XML_ext), XML_uri,
"{02D57815-91ED-43cb-92C2-25804820EDAC}",
FSNS(XML_xmlns, XML_c15), pFB->
getNamespaceURL(OOX_NS(c15)));
2257 pFS->startElement(
FSNS(XML_c15, XML_datalabelsRange));
2260 pFS->startElement(
FSNS(XML_c15, XML_f));
2261 pFS->writeEscaped(rDLblsRange.
getRange());
2262 pFS->endElement(
FSNS(XML_c15, XML_f));
2265 pFS->startElement(
FSNS(XML_c15, XML_dlblRangeCache));
2266 pFS->singleElement(
FSNS(XML_c, XML_ptCount), XML_val, OString::number(rDLblsRange.
count()));
2267 for (
const auto& rLabelKV: rDLblsRange)
2269 pFS->startElement(
FSNS(XML_c, XML_pt), XML_idx, OString::number(rLabelKV.first));
2270 pFS->startElement(
FSNS(XML_c, XML_v));
2271 pFS->writeEscaped(rLabelKV.second);
2272 pFS->endElement(
FSNS( XML_c, XML_v ));
2273 pFS->endElement(
FSNS(XML_c, XML_pt));
2276 pFS->endElement(
FSNS(XML_c15, XML_dlblRangeCache));
2278 pFS->endElement(
FSNS(XML_c15, XML_datalabelsRange));
2279 pFS->endElement(
FSNS(XML_c, XML_ext));
2280 pFS->endElement(
FSNS(XML_c, XML_extLst));
2288 const std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
2289 for (
const auto& splitDataSeries : aSplitDataSeries)
2291 if (!splitDataSeries.hasElements())
2294 sal_Int32 nTypeId = XML_lineChart;
2296 nTypeId = XML_line3DChart;
2297 pFS->startElement(
FSNS(XML_c, nTypeId));
2303 bool bPrimaryAxes =
true;
2304 exportSeries(xChartType, splitDataSeries, bPrimaryAxes);
2307 sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
2310 mAny >>= nSymbolType;
2316 const char* marker = nSymbolType == css::chart::ChartSymbolType::NONE?
"0":
"1";
2317 pFS->singleElement(
FSNS(XML_c, XML_marker), XML_val, marker);
2322 pFS->endElement(
FSNS( XML_c, nTypeId ) );
2335 sal_Int32 nTypeId = XML_pieChart;
2337 nTypeId = XML_pie3DChart;
2338 pFS->startElement(
FSNS(XML_c, nTypeId));
2342 bool bPrimaryAxes =
true;
2351 pFS->endElement(
FSNS( XML_c, nTypeId ) );
2357 pFS->startElement(
FSNS(XML_c, XML_radarChart));
2361 const char* radarStyle =
nullptr;
2363 radarStyle =
"filled";
2365 radarStyle =
"marker";
2366 pFS->singleElement(
FSNS(XML_c, XML_radarStyle), XML_val, radarStyle);
2369 bool bPrimaryAxes =
true;
2373 pFS->endElement(
FSNS( XML_c, XML_radarChart ) );
2377 const css::uno::Sequence<css::uno::Reference<chart2::XDataSeries>>* pSeries)
2380 pFS->startElement(
FSNS(XML_c, XML_scatterChart));
2383 sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
2386 mAny >>= nSymbolType;
2388 const char* scatterStyle =
"lineMarker";
2389 if (nSymbolType == css::chart::ChartSymbolType::NONE)
2391 scatterStyle =
"line";
2394 pFS->singleElement(
FSNS(XML_c, XML_scatterStyle), XML_val, scatterStyle);
2398 bool bPrimaryAxes =
true;
2403 pFS->endElement(
FSNS( XML_c, XML_scatterChart ) );
2408 const std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
2409 bool bExported =
false;
2410 for (
const auto& splitDataSeries : aSplitDataSeries)
2412 if (!splitDataSeries.hasElements())
2425 const std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
2426 for (
const auto& splitDataSeries : aSplitDataSeries)
2428 if (!splitDataSeries.hasElements())
2431 pFS->startElement(
FSNS(XML_c, XML_stockChart));
2433 bool bPrimaryAxes =
true;
2438 if (xStockPropProvider.is())
2446 pFS->endElement(
FSNS(XML_c, XML_stockChart));
2456 if (!xChartPropProvider.is())
2460 if( !xStockPropSet.is() )
2463 pFS->startElement(
FSNS(XML_c, XML_hiLowLines));
2465 pFS->endElement(
FSNS( XML_c, XML_hiLowLines ) );
2470 if(xChartType->getChartType() !=
"com.sun.star.chart2.CandleStickChartType")
2476 if(!xChartPropProvider.is())
2480 pFS->startElement(
FSNS(XML_c, XML_upDownBars));
2482 pFS->singleElement(
FSNS(XML_c, XML_gapWidth), XML_val, OString::number(150));
2485 if( xChartPropSet.is() )
2487 pFS->startElement(
FSNS(XML_c, XML_upBars));
2490 if(xChartType->getChartType() ==
"com.sun.star.chart2.CandleStickChartType")
2494 pFS->endElement(
FSNS( XML_c, XML_upBars ) );
2496 xChartPropSet = xChartPropProvider->getDownBar();
2497 if( xChartPropSet.is() )
2499 pFS->startElement(
FSNS(XML_c, XML_downBars));
2500 if(xChartType->getChartType() ==
"com.sun.star.chart2.CandleStickChartType")
2504 pFS->endElement(
FSNS( XML_c, XML_downBars ) );
2506 pFS->endElement(
FSNS( XML_c, XML_upDownBars ) );
2512 sal_Int32 nTypeId = XML_surfaceChart;
2514 nTypeId = XML_surface3DChart;
2515 pFS->startElement(
FSNS(XML_c, nTypeId));
2517 bool bPrimaryAxes =
true;
2521 pFS->endElement(
FSNS( XML_c, nTypeId ) );
2542 Any aAnyVaryColors = xDataSeriesProps->getPropertyValue(
"VaryColorsByPoint");
2543 bool bVaryColors =
false;
2544 aAnyVaryColors >>= bVaryColors;
2545 pFS->singleElement(
FSNS(XML_c, XML_varyColors), XML_val,
ToPsz10(bVaryColors));
2549 pFS->singleElement(
FSNS(XML_c, XML_varyColors), XML_val,
"0");
2556 OUString aLabelRole = xChartType->getRoleOfSequenceForSeriesLabel();
2557 OUString aChartType( xChartType->getChartType());
2560 for(
const auto& rSeries : rSeriesSeq )
2568 xSource->getDataSequences());
2571 sal_Int32 nMainSequenceIndex = -1;
2572 sal_Int32 nSeriesLength = 0;
2575 sal_Int32 nSeqIdx=0;
2576 for( ; nSeqIdx<aSeqCnt.getLength(); ++nSeqIdx )
2579 if( nMainSequenceIndex==-1 )
2584 xSeqProp->getPropertyValue(
"Role") >>= aRole;
2586 if( aRole == aLabelRole )
2588 xValuesSeq.set( xTempValueSeq );
2589 xLabelSeq.set( aSeqCnt[nSeqIdx]->getLabel());
2590 nMainSequenceIndex = nSeqIdx;
2593 sal_Int32 nSequenceLength = (xTempValueSeq.is()? xTempValueSeq->getData().getLength() : sal_Int32(0));
2594 if( nSeriesLength < nSequenceLength )
2595 nSeriesLength = nSequenceLength;
2603 pFS->startElement(
FSNS(XML_c, XML_ser));
2606 pFS->singleElement(
FSNS( XML_c, XML_idx ),
2608 pFS->singleElement(
FSNS( XML_c, XML_order ),
2612 if( xLabelSeq.is() )
2618 sal_Int32 nLocalAttachedAxis = 0;
2619 mAny >>= nLocalAttachedAxis;
2620 rPrimaryAxes = isPrimaryAxes(nLocalAttachedAxis);
2626 if( xOldPropSet.is() )
2631 switch( eChartType )
2637 pFS->singleElement(
FSNS(XML_c, XML_invertIfNegative), XML_val,
"0");
2648 if( xOldPropSet.is() &&
GetProperty( xOldPropSet,
"SegmentOffset") )
2650 sal_Int32 nOffset = 0;
2652 pFS->singleElement(
FSNS( XML_c, XML_explosion ),
2653 XML_val, OString::number( nOffset ) );
2670 exportDataPoints( uno::Reference< beans::XPropertySet >( rSeries, uno::UNO_QUERY ), nSeriesLength, eChartType );
2684 xSeriesPropSet->getPropertyValue(
"ErrorBarY") >>= xErrorBarYProps;
2685 if(xErrorBarYProps.is())
2691 xSeriesPropSet->getPropertyValue(
"ErrorBarX") >>= xErrorBarXProps;
2692 if(xErrorBarXProps.is())
2706 if( xSequence.is() )
2720 if( xSequence.is() )
2729 if( xValuesSeq.is() )
2731 sal_Int32 nYValueType = XML_val;
2733 nYValueType = XML_yVal;
2735 nYValueType = XML_bubbleSize;
2745 pFS->singleElement(
FSNS(XML_c, XML_bubble3D), XML_val,
"0");
2747 if (!aDLblsRange.
empty())
2748 writeDataLabelsRange(pFS,
GetFB(), aDLblsRange);
2750 pFS->endElement(
FSNS( XML_c, XML_ser ) );
2772 xSource->getDataSequences());
2774 const char* sSeries[] = {
"values-first",
"values-max",
"values-min",
"values-last",
nullptr};
2776 for( sal_Int32
idx = 0; sSeries[
idx] != nullptr ;
idx++ )
2779 if( xLabeledSeq.is())
2785 pFS->startElement(
FSNS(XML_c, XML_ser));
2789 pFS->singleElement(
FSNS( XML_c, XML_idx ),
2790 XML_val, OString::number(
idx+1) );
2791 pFS->singleElement(
FSNS( XML_c, XML_order ),
2792 XML_val, OString::number(
idx+1) );
2795 if( xLabelSeq.is() )
2805 if( xValueSeq.is() )
2808 pFS->endElement(
FSNS( XML_c, XML_ser ) );
2819 pFS->startElement(
FSNS(XML_c, XML_tx));
2821 OUString aCellRange = xValueSeq->getSourceRangeRepresentation();
2823 pFS->startElement(
FSNS(XML_c, XML_strRef));
2825 pFS->startElement(
FSNS(XML_c, XML_f));
2826 pFS->writeEscaped( aCellRange );
2827 pFS->endElement(
FSNS( XML_c, XML_f ) );
2830 pFS->startElement(
FSNS(XML_c, XML_strCache));
2831 pFS->singleElement(
FSNS(XML_c, XML_ptCount), XML_val,
"1");
2832 pFS->startElement(
FSNS(XML_c, XML_pt), XML_idx,
"0");
2833 pFS->startElement(
FSNS(XML_c, XML_v));
2834 pFS->writeEscaped( aLabelString );
2835 pFS->endElement(
FSNS( XML_c, XML_v ) );
2836 pFS->endElement(
FSNS( XML_c, XML_pt ) );
2837 pFS->endElement(
FSNS( XML_c, XML_strCache ) );
2838 pFS->endElement(
FSNS( XML_c, XML_strRef ) );
2839 pFS->endElement(
FSNS( XML_c, XML_tx ) );
2845 pFS->startElement(
FSNS(XML_c, nValueType));
2847 OUString aCellRange = xValueSeq.is() ? xValueSeq->getSourceRangeRepresentation() : OUString();
2851 if(aFinalSplitSource.getLength() > 1)
2854 pFS->startElement(
FSNS(XML_c, XML_multiLvlStrRef));
2856 pFS->startElement(
FSNS(XML_c, XML_f));
2857 pFS->writeEscaped(aCellRange);
2858 pFS->endElement(
FSNS(XML_c, XML_f));
2860 pFS->startElement(
FSNS(XML_c, XML_multiLvlStrCache));
2861 pFS->singleElement(
FSNS(XML_c, XML_ptCount), XML_val, OString::number(aFinalSplitSource[0].
getLength()));
2862 for(
const auto& rSeq : aFinalSplitSource)
2864 pFS->startElement(
FSNS(XML_c, XML_lvl));
2865 for(sal_Int32 j = 0; j < rSeq.getLength(); j++)
2867 if(!rSeq[j].isEmpty())
2869 pFS->startElement(
FSNS(XML_c, XML_pt), XML_idx, OString::number(j));
2870 pFS->startElement(
FSNS(XML_c, XML_v));
2871 pFS->writeEscaped(rSeq[j]);
2872 pFS->endElement(
FSNS(XML_c, XML_v));
2873 pFS->endElement(
FSNS(XML_c, XML_pt));
2876 pFS->endElement(
FSNS(XML_c, XML_lvl));
2879 pFS->endElement(
FSNS(XML_c, XML_multiLvlStrCache));
2880 pFS->endElement(
FSNS(XML_c, XML_multiLvlStrRef));
2886 OUString aNumberFormatString;
2887 if (bWriteDateCategories)
2890 if( xAxisXSupp.is())
2900 if (aNumberFormatString.isEmpty())
2901 bWriteDateCategories =
false;
2904 pFS->startElement(
FSNS(XML_c, bWriteDateCategories ? XML_numRef : XML_strRef));
2906 pFS->startElement(
FSNS(XML_c, XML_f));
2907 pFS->writeEscaped(aCellRange);
2908 pFS->endElement(
FSNS(XML_c, XML_f));
2910 ::std::vector< OUString > aCategories;
2912 sal_Int32 ptCount = aCategories.size();
2913 pFS->startElement(
FSNS(XML_c, bWriteDateCategories ? XML_numCache : XML_strCache));
2914 if (bWriteDateCategories)
2916 pFS->startElement(
FSNS(XML_c, XML_formatCode));
2917 pFS->writeEscaped(aNumberFormatString);
2918 pFS->endElement(
FSNS(XML_c, XML_formatCode));
2921 pFS->singleElement(
FSNS(XML_c, XML_ptCount), XML_val, OString::number(ptCount));
2922 for (sal_Int32
i = 0;
i < ptCount;
i++)
2924 pFS->startElement(
FSNS(XML_c, XML_pt), XML_idx, OString::number(
i));
2925 pFS->startElement(
FSNS(XML_c, XML_v));
2926 pFS->writeEscaped(aCategories[
i]);
2927 pFS->endElement(
FSNS(XML_c, XML_v));
2928 pFS->endElement(
FSNS(XML_c, XML_pt));
2931 pFS->endElement(
FSNS(XML_c, bWriteDateCategories ? XML_numCache : XML_strCache));
2932 pFS->endElement(
FSNS(XML_c, bWriteDateCategories ? XML_numRef : XML_strRef));
2935 pFS->endElement(
FSNS( XML_c, nValueType ) );
2941 pFS->startElement(
FSNS(XML_c, nValueType));
2943 OUString aCellRange = xValueSeq.is() ? xValueSeq->getSourceRangeRepresentation() : OUString();
2946 pFS->startElement(
FSNS(XML_c, XML_numRef));
2948 pFS->startElement(
FSNS(XML_c, XML_f));
2949 pFS->writeEscaped( aCellRange );
2950 pFS->endElement(
FSNS( XML_c, XML_f ) );
2953 sal_Int32 ptCount = aValues.size();
2954 pFS->startElement(
FSNS(XML_c, XML_numCache));
2955 pFS->startElement(
FSNS(XML_c, XML_formatCode));
2957 pFS->writeEscaped(
"General" );
2958 pFS->endElement(
FSNS( XML_c, XML_formatCode ) );
2959 pFS->singleElement(
FSNS(XML_c, XML_ptCount), XML_val, OString::number(ptCount));
2961 for( sal_Int32
i = 0;
i < ptCount;
i++ )
2963 if (!std::isnan(aValues[
i]))
2965 pFS->startElement(
FSNS(XML_c, XML_pt), XML_idx, OString::number(
i));
2966 pFS->startElement(
FSNS(XML_c, XML_v));
2967 pFS->write(aValues[
i]);
2968 pFS->endElement(
FSNS(XML_c, XML_v));
2969 pFS->endElement(
FSNS(XML_c, XML_pt));
2973 pFS->endElement(
FSNS( XML_c, XML_numCache ) );
2974 pFS->endElement(
FSNS( XML_c, XML_numRef ) );
2975 pFS->endElement(
FSNS( XML_c, nValueType ) );
2981 pFS->startElement(
FSNS(XML_c, XML_spPr));
2986 pFS->endElement(
FSNS( XML_c, XML_spPr ) );
2992 pFS->startElement(
FSNS(XML_c, XML_txPr));
2994 sal_Int32 nRotation = 0;
2995 const char* textWordWrap =
nullptr;
2997 if (
auto xServiceInfo = uno::Reference<lang::XServiceInfo>(xPropSet, uno::UNO_QUERY))
2999 double fMultiplier = 0.0;
3005 if (xServiceInfo->supportsService(
"com.sun.star.chart.ChartAxis"))
3006 fMultiplier = -600.0;
3007 else if (xServiceInfo->supportsService(
"com.sun.star.chart2.DataSeries") || xServiceInfo->supportsService(
"com.sun.star.chart2.DataPointProperties"))
3009 fMultiplier = -60000.0;
3010 bool bTextWordWrap =
false;
3011 if ((xPropSet->getPropertyValue(
"TextWordWrap") >>= bTextWordWrap) && bTextWordWrap)
3012 textWordWrap =
"square";
3014 textWordWrap =
"none";
3019 double fTextRotation = 0.0;
3020 uno::Any aAny = xPropSet->getPropertyValue(
"TextRotation");
3021 if (aAny.
hasValue() && (aAny >>= fTextRotation))
3023 fTextRotation *= fMultiplier;
3025 if (fTextRotation < -5400000.0 && fTextRotation > -16200000.0)
3028 fTextRotation += 10800000.0;
3030 else if (fTextRotation <= -16200000.0)
3032 fTextRotation += 21600000.0;
3034 nRotation = std::round(fTextRotation);
3040 pFS->singleElement(
FSNS(XML_a, XML_bodyPr), XML_rot, OString::number(nRotation), XML_wrap, textWordWrap);
3042 pFS->singleElement(
FSNS(XML_a, XML_bodyPr), XML_wrap, textWordWrap);
3044 pFS->singleElement(
FSNS(XML_a, XML_lstStyle));
3046 pFS->startElement(
FSNS(XML_a, XML_p));
3047 pFS->startElement(
FSNS(XML_a, XML_pPr));
3052 pFS->endElement(
FSNS(XML_a, XML_pPr));
3053 pFS->endElement(
FSNS(XML_a, XML_p));
3054 pFS->endElement(
FSNS(XML_c, XML_txPr));
3063 if (xServiceInfo.is())
3065 if (xServiceInfo->supportsService(
"com.sun.star.chart.ChartAxisZSupplier"))
3067 xDiagramProperties->getPropertyValue(
"HasZAxis") >>=
mbHasZAxis;
3071 xDiagramProperties->getPropertyValue(
"Dim3D") >>=
mbIs3DChart;
3076 if( xCategories.is() )
3085 sal_Int32 nSize =
maAxes.size();
3089 for ( sal_Int32 nIdx = 0; nIdx < nSize; nIdx++ )
3091 if (nSortIdx ==
maAxes[nIdx].nAxisType)
3099sal_Int32 getXAxisTypeByChartType(sal_Int32 eChartType)
3110sal_Int32 getRealXAxisType(sal_Int32 nAxisType)
3112 if( nAxisType == chart2::AxisType::CATEGORY )
3114 else if( nAxisType == chart2::AxisType::DATE )
3116 else if( nAxisType == chart2::AxisType::SERIES )
3127 bool bHasXAxisTitle =
false,
3128 bHasYAxisTitle =
false,
3129 bHasZAxisTitle =
false,
3130 bHasSecondaryXAxisTitle =
false,
3131 bHasSecondaryYAxisTitle =
false;
3132 bool bHasXAxisMajorGrid =
false,
3133 bHasXAxisMinorGrid =
false,
3134 bHasYAxisMajorGrid =
false,
3135 bHasYAxisMinorGrid =
false,
3136 bHasZAxisMajorGrid =
false,
3137 bHasZAxisMinorGrid =
false;
3141 xDiagramProperties->getPropertyValue(
"HasXAxisTitle") >>= bHasXAxisTitle;
3142 xDiagramProperties->getPropertyValue(
"HasYAxisTitle") >>= bHasYAxisTitle;
3143 xDiagramProperties->getPropertyValue(
"HasZAxisTitle") >>= bHasZAxisTitle;
3144 xDiagramProperties->getPropertyValue(
"HasSecondaryXAxisTitle") >>= bHasSecondaryXAxisTitle;
3145 xDiagramProperties->getPropertyValue(
"HasSecondaryYAxisTitle") >>= bHasSecondaryYAxisTitle;
3147 xDiagramProperties->getPropertyValue(
"HasXAxisGrid") >>= bHasXAxisMajorGrid;
3148 xDiagramProperties->getPropertyValue(
"HasYAxisGrid") >>= bHasYAxisMajorGrid;
3149 xDiagramProperties->getPropertyValue(
"HasZAxisGrid") >>= bHasZAxisMajorGrid;
3151 xDiagramProperties->getPropertyValue(
"HasXAxisHelpGrid") >>= bHasXAxisMinorGrid;
3152 xDiagramProperties->getPropertyValue(
"HasYAxisHelpGrid") >>= bHasYAxisMinorGrid;
3153 xDiagramProperties->getPropertyValue(
"HasZAxisHelpGrid") >>= bHasZAxisMinorGrid;
3159 sal_Int32 nAxisType = XML_catAx;
3160 const char* sAxPos =
nullptr;
3167 if( xAxisXSupp.is())
3168 xAxisProp = xAxisXSupp->getXAxis();
3169 if( bHasXAxisTitle )
3170 xAxisTitle = xAxisXSupp->getXAxisTitle();
3171 if( bHasXAxisMajorGrid )
3172 xMajorGrid = xAxisXSupp->getXMainGrid();
3173 if( bHasXAxisMinorGrid )
3174 xMinorGrid = xAxisXSupp->getXHelpGrid();
3177 if( nAxisType != -1 )
3178 nAxisType = getRealXAxisType(nAxisType);
3188 if( xAxisYSupp.is())
3189 xAxisProp = xAxisYSupp->getYAxis();
3190 if( bHasYAxisTitle )
3191 xAxisTitle = xAxisYSupp->getYAxisTitle();
3192 if( bHasYAxisMajorGrid )
3193 xMajorGrid = xAxisYSupp->getYMainGrid();
3194 if( bHasYAxisMinorGrid )
3195 xMinorGrid = xAxisYSupp->getYHelpGrid();
3197 nAxisType = XML_valAx;
3205 if( xAxisZSupp.is())
3206 xAxisProp = xAxisZSupp->getZAxis();
3207 if( bHasZAxisTitle )
3208 xAxisTitle = xAxisZSupp->getZAxisTitle();
3209 if( bHasZAxisMajorGrid )
3210 xMajorGrid = xAxisZSupp->getZMainGrid();
3211 if( bHasZAxisMinorGrid )
3212 xMinorGrid = xAxisZSupp->getZHelpGrid();
3217 nAxisType = XML_valAx;
3219 nAxisType = XML_dateAx;
3221 nAxisType = XML_serAx;
3229 if( xAxisTwoXSupp.is())
3230 xAxisProp = xAxisTwoXSupp->getSecondaryXAxis();
3231 if( bHasSecondaryXAxisTitle )
3234 xAxisTitle = xAxisSupp->getSecondXAxisTitle();
3238 if( nAxisType != -1 )
3239 nAxisType = getRealXAxisType(nAxisType);
3249 if( xAxisTwoYSupp.is())
3250 xAxisProp = xAxisTwoYSupp->getSecondaryYAxis();
3251 if( bHasSecondaryYAxisTitle )
3254 xAxisTitle = xAxisSupp->getSecondYAxisTitle();
3257 nAxisType = XML_valAx;
3264 _exportAxis(xAxisProp, xAxisTitle, xMajorGrid, xMinorGrid, nAxisType, sAxPos, rAxisIdPair);
3272 sal_Int32 nAxisType,
3273 const char* sAxisPos,
3277 pFS->startElement(
FSNS(XML_c, nAxisType));
3278 pFS->singleElement(
FSNS(XML_c, XML_axId), XML_val, OString::number(rAxisIdPair.
nAxisId));
3280 pFS->startElement(
FSNS(XML_c, XML_scaling));
3285 bool bLogarithmic =
false;
3286 mAny >>= bLogarithmic;
3290 pFS->singleElement(
FSNS(XML_c, XML_logBase), XML_val, OString::number(10));
3295 bool bReverseDirection =
false;
3297 mAny >>= bReverseDirection;
3299 const char*
orientation = bReverseDirection ?
"maxMin":
"minMax";
3300 pFS->singleElement(
FSNS(XML_c, XML_orientation), XML_val,
orientation);
3302 bool bAutoMax =
false;
3306 if( !bAutoMax && (
GetProperty( xAxisProp,
"Max" ) ) )
3310 pFS->singleElement(
FSNS(XML_c, XML_max), XML_val, OString::number(dMax));
3313 bool bAutoMin =
false;
3317 if( !bAutoMin && (
GetProperty( xAxisProp,
"Min" ) ) )
3321 pFS->singleElement(
FSNS(XML_c, XML_min), XML_val, OString::number(dMin));
3324 pFS->endElement(
FSNS( XML_c, XML_scaling ) );
3327 if( xAxisProp.is() )
3329 xAxisProp->getPropertyValue(
"Visible") >>=
bVisible;
3334 bool bDeleted = !aItInsertedPair.second;
3336 pFS->singleElement(
FSNS(XML_c, XML_delete), XML_val, !bDeleted &&
bVisible ?
"0" :
"1");
3339 pFS->singleElement(
FSNS(XML_c, XML_axPos), XML_val, sAxisPos);
3341 if( xMajorGrid.is())
3343 pFS->startElement(
FSNS(XML_c, XML_majorGridlines));
3345 pFS->endElement(
FSNS( XML_c, XML_majorGridlines ) );
3349 if( xMinorGrid.is())
3351 pFS->startElement(
FSNS(XML_c, XML_minorGridlines));
3353 pFS->endElement(
FSNS( XML_c, XML_minorGridlines ) );
3357 if( xAxisTitle.is() )
3360 bool bLinkedNumFmt =
true;
3361 if (
GetProperty(xAxisProp,
"LinkNumberFormatToSource"))
3362 mAny >>= bLinkedNumFmt;
3364 OUString aNumberFormatString(
"General");
3372 pFS->singleElement(
FSNS(XML_c, XML_numFmt),
3373 XML_formatCode, aNumberFormatString,
3374 XML_sourceLinked, bLinkedNumFmt ?
"1" :
"0");
3381 bool bInner =
nValue & css::chart::ChartAxisMarks::INNER;
3382 bool bOuter =
nValue & css::chart::ChartAxisMarks::OUTER;
3383 const char* majorTickMark =
nullptr;
3384 if( bInner && bOuter )
3385 majorTickMark =
"cross";
3387 majorTickMark =
"in";
3389 majorTickMark =
"out";
3391 majorTickMark =
"none";
3392 pFS->singleElement(
FSNS(XML_c, XML_majorTickMark), XML_val, majorTickMark);
3398 bool bInner =
nValue & css::chart::ChartAxisMarks::INNER;
3399 bool bOuter =
nValue & css::chart::ChartAxisMarks::OUTER;
3400 const char* minorTickMark =
nullptr;
3401 if( bInner && bOuter )
3402 minorTickMark =
"cross";
3404 minorTickMark =
"in";
3406 minorTickMark =
"out";
3408 minorTickMark =
"none";
3409 pFS->singleElement(
FSNS(XML_c, XML_minorTickMark), XML_val, minorTickMark);
3412 const char* sTickLblPos =
nullptr;
3413 bool bDisplayLabel =
true;
3415 mAny >>= bDisplayLabel;
3416 if( bDisplayLabel && (
GetProperty( xAxisProp,
"LabelPosition" ) ) )
3418 css::chart::ChartAxisLabelPosition eLabelPosition = css::chart::ChartAxisLabelPosition_NEAR_AXIS;
3419 mAny >>= eLabelPosition;
3420 switch( eLabelPosition )
3422 case css::chart::ChartAxisLabelPosition_NEAR_AXIS:
3423 case css::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE:
3424 sTickLblPos =
"nextTo";
3426 case css::chart::ChartAxisLabelPosition_OUTSIDE_START:
3427 sTickLblPos =
"low";
3429 case css::chart::ChartAxisLabelPosition_OUTSIDE_END:
3430 sTickLblPos =
"high";
3433 sTickLblPos =
"nextTo";
3439 sTickLblPos =
"none";
3441 pFS->singleElement(
FSNS(XML_c, XML_tickLblPos), XML_val, sTickLblPos);
3448 pFS->singleElement(
FSNS(XML_c, XML_crossAx), XML_val, OString::number(rAxisIdPair.
nCrossAx));
3451 bool bCrossesValue =
false;
3452 const char* sCrosses =
nullptr;
3456 css::chart::ChartAxisPosition ePosition( css::chart::ChartAxisPosition_ZERO );
3460 case css::chart::ChartAxisPosition_START:
3463 case css::chart::ChartAxisPosition_END:
3466 case css::chart::ChartAxisPosition_ZERO:
3467 sCrosses =
"autoZero";
3470 bCrossesValue =
true;
3475 if( bCrossesValue &&
GetProperty( xAxisProp,
"CrossoverValue" ) )
3479 pFS->singleElement(
FSNS(XML_c, XML_crossesAt), XML_val, OString::number(dValue));
3485 pFS->singleElement(
FSNS(XML_c, XML_crosses), XML_val, sCrosses);
3489 if( ( nAxisType == XML_catAx )
3490 || ( nAxisType == XML_dateAx ) )
3493 const char*
const isAuto =
"1";
3494 pFS->singleElement(
FSNS(XML_c, XML_auto), XML_val, isAuto);
3496 if( nAxisType == XML_catAx )
3499 const char*
const sLblAlgn =
"ctr";
3500 pFS->singleElement(
FSNS(XML_c, XML_lblAlgn), XML_val, sLblAlgn);
3504 pFS->singleElement(
FSNS(XML_c, XML_lblOffset), XML_val, OString::number(100));
3507 if( nAxisType == XML_dateAx )
3509 sal_Int32 nAxisIndex = -1;
3516 sal_Int32 nTimeResolution = css::chart::TimeUnit::DAY;
3517 if( aTimeIncrement.TimeResolution >>= nTimeResolution )
3520 cssc::TimeInterval aInterval;
3521 if( aTimeIncrement.MajorTimeInterval >>= aInterval )
3523 pFS->singleElement(
FSNS(XML_c, XML_majorUnit), XML_val, OString::number(aInterval.Number));
3526 if( aTimeIncrement.MinorTimeInterval >>= aInterval )
3528 pFS->singleElement(
FSNS(XML_c, XML_minorUnit), XML_val, OString::number(aInterval.Number));
3534 pFS->singleElement(
FSNS(XML_c, XML_noMultiLvlLbl), XML_val, OString::number(0));
3538 if( nAxisType == XML_valAx )
3541 pFS->singleElement(
FSNS(XML_c, XML_crossBetween), XML_val,
"between");
3543 pFS->singleElement(
FSNS(XML_c, XML_crossBetween), XML_val,
"midCat");
3547 bool bAutoStepMain =
false;
3549 mAny >>= bAutoStepMain;
3551 if( !bAutoStepMain && (
GetProperty( xAxisProp,
"StepMain" ) ) )
3553 double dMajorUnit = 0;
3554 mAny >>= dMajorUnit;
3555 pFS->singleElement(
FSNS(XML_c, XML_majorUnit), XML_val, OString::number(dMajorUnit));
3558 bool bAutoStepHelp =
false;
3560 mAny >>= bAutoStepHelp;
3562 if( !bAutoStepHelp && (
GetProperty( xAxisProp,
"StepHelp" ) ) )
3564 double dMinorUnit = 0;
3565 mAny >>= dMinorUnit;
3568 sal_Int32 dMinorUnitCount = 0;
3569 mAny >>= dMinorUnitCount;
3573 if( dMinorUnitCount != 5 )
3575 pFS->singleElement(
FSNS( XML_c, XML_minorUnit ),
3576 XML_val, OString::number( dMinorUnit ) );
3581 if( nAxisType == XML_valAx &&
GetProperty( xAxisProp,
"DisplayUnits" ) )
3583 bool bDisplayUnits =
false;
3584 mAny >>= bDisplayUnits;
3593 pFS->startElement(
FSNS(XML_c, XML_dispUnits));
3595 pFS->singleElement(
FSNS(XML_c, XML_builtInUnit), XML_val, aVal);
3597 pFS->singleElement(
FSNS( XML_c, XML_dispUnitsLbl ));
3598 pFS->endElement(
FSNS( XML_c, XML_dispUnits ) );
3604 pFS->endElement(
FSNS( XML_c, nAxisType ) );
3609struct LabelPlacementParam
3616 LabelPlacementParam(
bool bExport, sal_Int32 nDefault) :
3621 css::chart::DataLabelPlacement::OUTSIDE,
3622 css::chart::DataLabelPlacement::INSIDE,
3623 css::chart::DataLabelPlacement::CENTER,
3624 css::chart::DataLabelPlacement::NEAR_ORIGIN,
3625 css::chart::DataLabelPlacement::TOP,
3626 css::chart::DataLabelPlacement::BOTTOM,
3627 css::chart::DataLabelPlacement::LEFT,
3628 css::chart::DataLabelPlacement::RIGHT,
3629 css::chart::DataLabelPlacement::AVOID_OVERLAP
3635const char* toOOXMLPlacement( sal_Int32 nPlacement )
3639 case css::chart::DataLabelPlacement::OUTSIDE:
return "outEnd";
3640 case css::chart::DataLabelPlacement::INSIDE:
return "inEnd";
3641 case css::chart::DataLabelPlacement::CENTER:
return "ctr";
3642 case css::chart::DataLabelPlacement::NEAR_ORIGIN:
return "inBase";
3643 case css::chart::DataLabelPlacement::TOP:
return "t";
3644 case css::chart::DataLabelPlacement::BOTTOM:
return "b";
3645 case css::chart::DataLabelPlacement::LEFT:
return "l";
3646 case css::chart::DataLabelPlacement::RIGHT:
return "r";
3647 case css::chart::DataLabelPlacement::CUSTOM:
3648 case css::chart::DataLabelPlacement::AVOID_OVERLAP:
return "bestFit";
3656OUString getFieldTypeString(
const chart2::DataPointCustomLabelFieldType aType )
3660 case chart2::DataPointCustomLabelFieldType_CATEGORYNAME:
3661 return "CATEGORYNAME";
3663 case chart2::DataPointCustomLabelFieldType_SERIESNAME:
3664 return "SERIESNAME";
3666 case chart2::DataPointCustomLabelFieldType_VALUE:
3669 case chart2::DataPointCustomLabelFieldType_CELLREF:
3672 case chart2::DataPointCustomLabelFieldType_CELLRANGE:
3681void writeRunProperties( ChartExport* pChartExport, Reference<XPropertySet>
const & xPropertySet )
3683 bool bDummy =
false;
3685 pChartExport->WriteRunProperties(xPropertySet,
false, XML_rPr,
true, bDummy, nDummy);
3688void writeCustomLabel(
const FSHelperPtr& pFS, ChartExport* pChartExport,
3689 const Sequence<Reference<chart2::XDataPointCustomLabelField>>& rCustomLabelFields,
3690 sal_Int32 nLabelIndex, DataLabelsRange& rDLblsRange )
3692 pFS->startElement(
FSNS(XML_c, XML_tx));
3693 pFS->startElement(
FSNS(XML_c, XML_rich));
3696 pFS->singleElement(
FSNS(XML_a, XML_bodyPr));
3698 OUString sFieldType;
3700 pFS->startElement(
FSNS(XML_a, XML_p));
3702 for (
auto& rField : rCustomLabelFields)
3704 Reference<XPropertySet> xPropertySet(rField, UNO_QUERY);
3705 chart2::DataPointCustomLabelFieldType aType = rField->getFieldType();
3708 bool bNewParagraph =
false;
3710 if (aType == chart2::DataPointCustomLabelFieldType_CELLRANGE &&
3711 rField->getDataLabelsRange())
3713 if (rDLblsRange.getRange().isEmpty())
3714 rDLblsRange.setRange(rField->getCellRange());
3716 if (!rDLblsRange.hasLabel(nLabelIndex))
3717 rDLblsRange.setLabel(nLabelIndex, rField->getString());
3719 sContent =
"[CELLRANGE]";
3723 sContent = rField->getString();
3726 if (aType == chart2::DataPointCustomLabelFieldType_NEWLINE)
3727 bNewParagraph =
true;
3728 else if (aType != chart2::DataPointCustomLabelFieldType_TEXT)
3729 sFieldType = getFieldTypeString(aType);
3733 pFS->endElement(
FSNS(XML_a, XML_p));
3734 pFS->startElement(
FSNS(XML_a, XML_p));
3738 if (sFieldType.isEmpty())
3741 pFS->startElement(
FSNS(XML_a, XML_r));
3742 writeRunProperties(pChartExport, xPropertySet);
3744 pFS->startElement(
FSNS(XML_a, XML_t));
3745 pFS->writeEscaped(sContent);
3746 pFS->endElement(
FSNS(XML_a, XML_t));
3748 pFS->endElement(
FSNS(XML_a, XML_r));
3753 pFS->startElement(
FSNS(XML_a, XML_fld), XML_id, rField->getGuid(), XML_type,
3755 writeRunProperties(pChartExport, xPropertySet);
3757 pFS->startElement(
FSNS(XML_a, XML_t));
3758 pFS->writeEscaped(sContent);
3759 pFS->endElement(
FSNS(XML_a, XML_t));
3761 pFS->endElement(
FSNS(XML_a, XML_fld));
3765 pFS->endElement(
FSNS(XML_a, XML_p));
3766 pFS->endElement(
FSNS(XML_c, XML_rich));
3767 pFS->endElement(
FSNS(XML_c, XML_tx));
3770void writeLabelProperties(
const FSHelperPtr& pFS, ChartExport* pChartExport,
3771 const uno::Reference<beans::XPropertySet>& xPropSet,
const LabelPlacementParam& rLabelParam,
3772 sal_Int32 nLabelIndex, DataLabelsRange& rDLblsRange )
3777 chart2::DataPointLabel
aLabel;
3778 Sequence<Reference<chart2::XDataPointCustomLabelField>> aCustomLabelFields;
3779 sal_Int32 nLabelBorderWidth = 0;
3780 sal_Int32 nLabelBorderColor = 0x00FFFFFF;
3781 sal_Int32 nLabelFillColor = -1;
3783 xPropSet->getPropertyValue(
"Label") >>=
aLabel;
3784 xPropSet->getPropertyValue(
"CustomLabelFields") >>= aCustomLabelFields;
3785 xPropSet->getPropertyValue(
"LabelBorderWidth") >>= nLabelBorderWidth;
3786 xPropSet->getPropertyValue(
"LabelBorderColor") >>= nLabelBorderColor;
3787 xPropSet->getPropertyValue(
"LabelFillColor") >>= nLabelFillColor;
3789 if (nLabelBorderWidth > 0 || nLabelFillColor != -1)
3791 pFS->startElement(
FSNS(XML_c, XML_spPr));
3793 if (nLabelFillColor != -1)
3795 pFS->startElement(
FSNS(XML_a, XML_solidFill));
3797 OString
aStr = OString::number(nLabelFillColor, 16).toAsciiUpperCase();
3798 pFS->singleElement(
FSNS(XML_a, XML_srgbClr), XML_val, aStr);
3800 pFS->endElement(
FSNS(XML_a, XML_solidFill));
3803 if (nLabelBorderWidth > 0)
3805 pFS->startElement(
FSNS(XML_a, XML_ln), XML_w,
3808 if (nLabelBorderColor != -1)
3810 pFS->startElement(
FSNS(XML_a, XML_solidFill));
3812 OString
aStr = OString::number(nLabelBorderColor, 16).toAsciiUpperCase();
3813 pFS->singleElement(
FSNS(XML_a, XML_srgbClr), XML_val, aStr);
3815 pFS->endElement(
FSNS(XML_a, XML_solidFill));
3818 pFS->endElement(
FSNS(XML_a, XML_ln));
3821 pFS->endElement(
FSNS(XML_c, XML_spPr));
3824 pChartExport->exportTextProps(xPropSet);
3826 if (aCustomLabelFields.hasElements())
3827 writeCustomLabel(pFS, pChartExport, aCustomLabelFields, nLabelIndex, rDLblsRange);
3829 if (rLabelParam.mbExport)
3831 sal_Int32 nLabelPlacement = rLabelParam.meDefault;
3832 if (xPropSet->getPropertyValue(
"LabelPlacement") >>= nLabelPlacement)
3834 if (!rLabelParam.maAllowedValues.count(nLabelPlacement))
3835 nLabelPlacement = rLabelParam.meDefault;
3836 pFS->singleElement(
FSNS(XML_c, XML_dLblPos), XML_val, toOOXMLPlacement(nLabelPlacement));
3840 pFS->singleElement(
FSNS(XML_c, XML_showLegendKey), XML_val,
ToPsz10(
aLabel.ShowLegendSymbol));
3841 pFS->singleElement(
FSNS(XML_c, XML_showVal), XML_val,
ToPsz10(
aLabel.ShowNumber));
3842 pFS->singleElement(
FSNS(XML_c, XML_showCatName), XML_val,
ToPsz10(
aLabel.ShowCategoryName));
3843 pFS->singleElement(
FSNS(XML_c, XML_showSerName), XML_val,
ToPsz10(
aLabel.ShowSeriesName));
3844 pFS->singleElement(
FSNS(XML_c, XML_showPercent), XML_val,
ToPsz10(
aLabel.ShowNumberInPercent));
3847 uno::Any aAny = xPropSet->getPropertyValue(
"LabelSeparator");
3850 OUString nLabelSeparator;
3851 aAny >>= nLabelSeparator;
3852 pFS->startElement(
FSNS(XML_c, XML_separator));
3853 pFS->writeEscaped( nLabelSeparator );
3854 pFS->endElement(
FSNS( XML_c, XML_separator ) );
3857 if (rDLblsRange.hasLabel(nLabelIndex))
3859 pFS->startElement(
FSNS(XML_c, XML_extLst));
3860 pFS->startElement(
FSNS(XML_c, XML_ext), XML_uri,
3861 "{CE6537A1-D6FC-4f65-9D91-7224C49458BB}",
FSNS(XML_xmlns, XML_c15),
3862 pChartExport->GetFB()->getNamespaceURL(OOX_NS(c15)));
3864 pFS->singleElement(
FSNS(XML_c15, XML_showDataLabelsRange), XML_val,
"1");
3866 pFS->endElement(
FSNS(XML_c, XML_ext));
3867 pFS->endElement(
FSNS(XML_c, XML_extLst));
3874 const uno::Reference<chart2::XDataSeries> & xSeries, sal_Int32 nSeriesLength, sal_Int32 eChartType,
3877 if (!xSeries.is() || nSeriesLength <= 0)
3880 uno::Reference<beans::XPropertySet> xPropSet(xSeries, uno::UNO_QUERY);
3885 pFS->startElement(
FSNS(XML_c, XML_dLbls));
3887 bool bLinkedNumFmt =
true;
3888 if (
GetProperty(xPropSet,
"LinkNumberFormatToSource"))
3889 mAny >>= bLinkedNumFmt;
3891 chart2::DataPointLabel
aLabel;
3892 bool bLabelIsNumberFormat =
true;
3893 if( xPropSet->getPropertyValue(
"Label") >>=
aLabel )
3894 bLabelIsNumberFormat =
aLabel.ShowNumber;
3896 if (
GetProperty(xPropSet, bLabelIsNumberFormat ? OUString(
"NumberFormat") : OUString(
"PercentageNumberFormat")))
3903 pFS->singleElement(
FSNS(XML_c, XML_numFmt),
3904 XML_formatCode, aNumberFormatString,
3905 XML_sourceLinked,
ToPsz10(bLinkedNumFmt));
3908 uno::Sequence<sal_Int32> aAttrLabelIndices;
3909 xPropSet->getPropertyValue(
"AttributedDataPoints") >>= aAttrLabelIndices;
3921 aParam.mbExport =
false;
3924 aParam.mbExport =
true;
3930 aParam.mbExport =
false;
3935 aParam.maAllowedValues.clear();
3936 aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::CENTER);
3937 aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::INSIDE);
3938 aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::NEAR_ORIGIN);
3939 aParam.meDefault = css::chart::DataLabelPlacement::CENTER;
3943 aParam.maAllowedValues.clear();
3944 aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::CENTER);
3945 aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::INSIDE);
3946 aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::OUTSIDE);
3947 aParam.maAllowedValues.insert(css::chart::DataLabelPlacement::NEAR_ORIGIN);
3948 aParam.meDefault = css::chart::DataLabelPlacement::OUTSIDE;
3955 for (
const sal_Int32 nIdx : std::as_const(aAttrLabelIndices))
3957 uno::Reference<beans::XPropertySet> xLabelPropSet = xSeries->getDataPointByIndex(nIdx);
3959 if (!xLabelPropSet.is())
3962 pFS->startElement(
FSNS(XML_c, XML_dLbl));
3963 pFS->singleElement(
FSNS(XML_c, XML_idx), XML_val, OString::number(nIdx));
3968 chart2::RelativePosition aCustomLabelPosition;
3969 if( xLabelPropSet->getPropertyValue(
"CustomLabelPosition") >>= aCustomLabelPosition )
3971 pFS->startElement(
FSNS(XML_c, XML_layout));
3972 pFS->startElement(
FSNS(XML_c, XML_manualLayout));
3974 pFS->singleElement(
FSNS(XML_c, XML_x), XML_val, OString::number(aCustomLabelPosition.Primary));
3975 pFS->singleElement(
FSNS(XML_c, XML_y), XML_val, OString::number(aCustomLabelPosition.Secondary));
3977 SAL_WARN_IF(aCustomLabelPosition.Anchor != css::drawing::Alignment_TOP_LEFT,
"oox",
"unsupported anchor position");
3979 pFS->endElement(
FSNS(XML_c, XML_manualLayout));
3980 pFS->endElement(
FSNS(XML_c, XML_layout));
3984 if(
GetProperty(xLabelPropSet,
"LinkNumberFormatToSource") )
3985 mAny >>= bLinkedNumFmt;
3987 if( xLabelPropSet->getPropertyValue(
"Label") >>=
aLabel )
3988 bLabelIsNumberFormat =
aLabel.ShowNumber;
3990 bLabelIsNumberFormat =
true;
3992 if (
GetProperty(xLabelPropSet, bLabelIsNumberFormat ? OUString(
"NumberFormat") : OUString(
"PercentageNumberFormat")))
3999 pFS->singleElement(
FSNS(XML_c, XML_numFmt), XML_formatCode, aNumberFormatString,
4000 XML_sourceLinked,
ToPsz10(bLinkedNumFmt));
4004 writeLabelProperties(pFS,
this, xLabelPropSet, aParam, nIdx, rDLblsRange);
4005 pFS->endElement(
FSNS(XML_c, XML_dLbl));
4009 writeLabelProperties(pFS,
this, xPropSet, aParam, -1, rDLblsRange);
4011 bool bShowLeaderLines =
false;
4012 xPropSet->getPropertyValue(
"ShowCustomLeaderLines") >>= bShowLeaderLines;
4013 pFS->singleElement(
FSNS(XML_c, XML_showLeaderLines), XML_val,
ToPsz10(bShowLeaderLines));
4018 pFS->startElement(
FSNS(XML_c, XML_extLst));
4019 pFS->startElement(
FSNS(XML_c, XML_ext), XML_uri,
"{CE6537A1-D6FC-4f65-9D91-7224C49458BB}",
FSNS(XML_xmlns, XML_c15),
GetFB()->getNamespaceURL(OOX_NS(c15)));
4020 pFS->singleElement(
FSNS(XML_c15, XML_showLeaderLines), XML_val,
ToPsz10(bShowLeaderLines));
4021 pFS->endElement(
FSNS(XML_c, XML_ext));
4022 pFS->endElement(
FSNS(XML_c, XML_extLst));
4024 pFS->endElement(
FSNS(XML_c, XML_dLbls));
4028 const uno::Reference< beans::XPropertySet > & xSeriesProperties,
4029 sal_Int32 nSeriesLength, sal_Int32 eChartType )
4031 uno::Reference< chart2::XDataSeries > xSeries( xSeriesProperties, uno::UNO_QUERY );
4032 bool bVaryColorsByPoint =
false;
4034 if( xSeriesProperties.is())
4036 Any aAny = xSeriesProperties->getPropertyValue(
"AttributedDataPoints" );
4037 aAny >>= aDataPointSeq;
4038 xSeriesProperties->getPropertyValue(
"VaryColorsByPoint" ) >>= bVaryColorsByPoint;
4041 const sal_Int32 * pPoints = aDataPointSeq.getConstArray();
4045 xColorScheme.set(
mxNewDiagram->getDefaultColorScheme());
4047 if( bVaryColorsByPoint && xColorScheme.is() )
4050 aAttrPointSet.
reserve(aDataPointSeq.getLength());
4051 for (
auto p = pPoints;
p < pPoints + aDataPointSeq.getLength(); ++
p)
4053 const auto aEndIt = aAttrPointSet.
end();
4054 for( nElement = 0; nElement < nSeriesLength; ++nElement )
4056 uno::Reference< beans::XPropertySet > xPropSet;
4057 if( aAttrPointSet.
find( nElement ) != aEndIt )
4064 catch(
const uno::Exception & )
4078 pFS->startElement(
FSNS(XML_c, XML_dPt));
4079 pFS->singleElement(
FSNS(XML_c, XML_idx), XML_val, OString::number(nElement));
4086 if( xPropSet.is() &&
GetProperty( xPropSet,
"SegmentOffset") )
4088 sal_Int32 nOffset = 0;
4091 pFS->singleElement(
FSNS( XML_c, XML_explosion ),
4092 XML_val, OString::number( nOffset ) );
4101 pFS->endElement(
FSNS( XML_c, XML_dPt ) );
4107 if( bVaryColorsByPoint )
4111 aAttrPointSet.
reserve(aDataPointSeq.getLength());
4112 for (
auto p = pPoints;
p < pPoints + aDataPointSeq.getLength(); ++
p)
4114 const auto aEndIt = aAttrPointSet.
end();
4115 for( nElement = 0; nElement < nSeriesLength; ++nElement )
4117 uno::Reference< beans::XPropertySet > xPropSet;
4118 if( aAttrPointSet.
find( nElement ) != aEndIt )
4125 catch(
const uno::Exception & )
4134 pFS->startElement(
FSNS(XML_c, XML_dPt));
4135 pFS->singleElement(
FSNS(XML_c, XML_idx), XML_val, OString::number(nElement));
4137 switch( eChartType )
4142 pFS->singleElement(
FSNS(XML_c, XML_invertIfNegative), XML_val,
"0");
4157 pFS->endElement(
FSNS( XML_c, XML_dPt ) );
4164 sal_Int32 nAxisIdx, nAxisIdy;
4165 bool bPrimaryAxisExists =
false;
4166 bool bSecondaryAxisExists =
false;
4174 if ( bCheckCombinedAxes && ( bPrimaryAxisExists || bSecondaryAxisExists ) )
4176 nAxisIdx =
maAxes[0].nAxisId;
4177 nAxisIdy =
maAxes[1].nAxisId;
4185 maAxes.emplace_back( eXAxis, nAxisIdx, nAxisIdy );
4186 maAxes.emplace_back( eYAxis, nAxisIdy, nAxisIdx );
4189 pFS->singleElement(
FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdx));
4190 pFS->singleElement(
FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdy));
4193 sal_Int32 nAxisIdz = 0;
4199 pFS->singleElement(
FSNS(XML_c, XML_axId), XML_val, OString::number(nAxisIdz));
4213 const char* grouping =
nullptr;
4215 grouping =
"stacked";
4217 grouping =
"percentStacked";
4222 grouping =
"clustered";
4225 grouping =
"standard";
4227 pFS->singleElement(
FSNS(XML_c, XML_grouping), XML_val, grouping);
4234 if( !xRegressionCurveContainer.is() )
4240 if (!xRegCurve.is())
4247 if( !xServiceName.is() )
4250 aService = xServiceName->getServiceName();
4252 if(aService !=
"com.sun.star.chart2.LinearRegressionCurve" &&
4253 aService !=
"com.sun.star.chart2.ExponentialRegressionCurve" &&
4254 aService !=
"com.sun.star.chart2.LogarithmicRegressionCurve" &&
4255 aService !=
"com.sun.star.chart2.PotentialRegressionCurve" &&
4256 aService !=
"com.sun.star.chart2.PolynomialRegressionCurve" &&
4257 aService !=
"com.sun.star.chart2.MovingAverageRegressionCurve")
4260 pFS->startElement(
FSNS(XML_c, XML_trendline));
4263 xProperties->getPropertyValue(
"CurveName") >>=
aName;
4264 if(!
aName.isEmpty())
4266 pFS->startElement(
FSNS(XML_c, XML_name));
4267 pFS->writeEscaped(
aName);
4268 pFS->endElement(
FSNS( XML_c, XML_name) );
4273 if( aService ==
"com.sun.star.chart2.LinearRegressionCurve" )
4275 pFS->singleElement(
FSNS(XML_c, XML_trendlineType), XML_val,
"linear");
4277 else if( aService ==
"com.sun.star.chart2.ExponentialRegressionCurve" )
4279 pFS->singleElement(
FSNS(XML_c, XML_trendlineType), XML_val,
"exp");
4281 else if( aService ==
"com.sun.star.chart2.LogarithmicRegressionCurve" )
4283 pFS->singleElement(
FSNS(XML_c, XML_trendlineType), XML_val,
"log");
4285 else if( aService ==
"com.sun.star.chart2.PotentialRegressionCurve" )
4287 pFS->singleElement(
FSNS(XML_c, XML_trendlineType), XML_val,
"power");
4289 else if( aService ==
"com.sun.star.chart2.PolynomialRegressionCurve" )
4291 pFS->singleElement(
FSNS(XML_c, XML_trendlineType), XML_val,
"poly");
4293 sal_Int32 aDegree = 2;
4294 xProperties->getPropertyValue(
"PolynomialDegree") >>= aDegree;
4295 pFS->singleElement(
FSNS(XML_c, XML_order), XML_val, OString::number(aDegree));
4297 else if( aService ==
"com.sun.star.chart2.MovingAverageRegressionCurve" )
4299 pFS->singleElement(
FSNS(XML_c, XML_trendlineType), XML_val,
"movingAvg");
4301 sal_Int32 aPeriod = 2;
4302 xProperties->getPropertyValue(
"MovingAveragePeriod") >>= aPeriod;
4304 pFS->singleElement(
FSNS(XML_c, XML_period), XML_val, OString::number(aPeriod));
4313 double fExtrapolateForward = 0.0;
4314 double fExtrapolateBackward = 0.0;
4316 xProperties->getPropertyValue(
"ExtrapolateForward") >>= fExtrapolateForward;
4317 xProperties->getPropertyValue(
"ExtrapolateBackward") >>= fExtrapolateBackward;
4319 pFS->singleElement(
FSNS( XML_c, XML_forward ),
4320 XML_val, OString::number(fExtrapolateForward) );
4322 pFS->singleElement(
FSNS( XML_c, XML_backward ),
4323 XML_val, OString::number(fExtrapolateBackward) );
4325 bool bForceIntercept =
false;
4326 xProperties->getPropertyValue(
"ForceIntercept") >>= bForceIntercept;
4328 if (bForceIntercept)
4330 double fInterceptValue = 0.0;
4331 xProperties->getPropertyValue(
"InterceptValue") >>= fInterceptValue;
4333 pFS->singleElement(
FSNS( XML_c, XML_intercept ),
4334 XML_val, OString::number(fInterceptValue) );
4341 bool bShowEquation =
false;
4342 xEquationProperties->getPropertyValue(
"ShowEquation") >>= bShowEquation;
4345 bool bShowCorrelationCoefficient =
false;
4346 xEquationProperties->getPropertyValue(
"ShowCorrelationCoefficient") >>= bShowCorrelationCoefficient;
4348 pFS->singleElement(
FSNS( XML_c, XML_dispRSqr ),
4349 XML_val,
ToPsz10(bShowCorrelationCoefficient) );
4351 pFS->singleElement(
FSNS(XML_c, XML_dispEq), XML_val,
ToPsz10(bShowEquation));
4353 pFS->endElement(
FSNS( XML_c, XML_trendline ) );
4359 chart2::Symbol aSymbol;
4363 if(aSymbol.Style != chart2::SymbolStyle_STANDARD && aSymbol.Style != chart2::SymbolStyle_NONE)
4367 pFS->startElement(
FSNS(XML_c, XML_marker));
4369 sal_Int32 nSymbol = aSymbol.StandardSymbol;
4371 const char* pSymbolType;
4376 pSymbolType =
"square";
4379 pSymbolType =
"diamond";
4385 pSymbolType =
"triangle";
4388 pSymbolType =
"circle";
4391 pSymbolType =
"star";
4397 pSymbolType =
"plus";
4400 pSymbolType =
"dash";
4403 pSymbolType =
"square";
4407 bool bSkipFormatting =
false;
4408 if (aSymbol.Style == chart2::SymbolStyle_NONE)
4410 bSkipFormatting =
true;
4411 pSymbolType =
"none";
4414 pFS->singleElement(
FSNS(XML_c, XML_symbol), XML_val, pSymbolType);
4416 if (!bSkipFormatting)
4418 awt::Size aSymbolSize = aSymbol.Size;
4419 sal_Int32 nSize = std::max( aSymbolSize.Width, aSymbolSize.Height );
4421 nSize = nSize/250.0*7.0 + 1;
4423 nSize = std::clamp(
int(nSize), 2, 72 );
4424 pFS->singleElement(
FSNS(XML_c, XML_size), XML_val, OString::number(nSize));
4426 pFS->startElement(
FSNS(XML_c, XML_spPr));
4428 util::Color aColor = aSymbol.FillColor;
4434 pFS->singleElement(
FSNS(XML_a, XML_noFill));
4439 pFS->endElement(
FSNS( XML_c, XML_spPr ) );
4442 pFS->endElement(
FSNS( XML_c, XML_marker ) );
4449 sal_Int32 nSplineType = 0;
4451 mAny >>= nSplineType;
4452 const char* pVal = nSplineType != 0 ?
"1" :
"0";
4453 pFS->singleElement(
FSNS(XML_c, XML_smooth), XML_val, pVal);
4459 sal_Int32 nStartingAngle = 0;
4462 mAny >>= nStartingAngle;
4465 nStartingAngle = (450 - nStartingAngle ) % 360;
4466 pFS->singleElement(
FSNS(XML_c, XML_firstSliceAng), XML_val, OString::number(nStartingAngle));
4471const char* getErrorBarStyle(sal_Int32 nErrorBarStyle)
4473 switch(nErrorBarStyle)
4475 case cssc::ErrorBarStyle::NONE:
4477 case cssc::ErrorBarStyle::VARIANCE:
4479 case cssc::ErrorBarStyle::STANDARD_DEVIATION:
4481 case cssc::ErrorBarStyle::ABSOLUTE:
4483 case cssc::ErrorBarStyle::RELATIVE:
4484 return "percentage";
4485 case cssc::ErrorBarStyle::ERROR_MARGIN:
4487 case cssc::ErrorBarStyle::STANDARD_ERROR:
4489 case cssc::ErrorBarStyle::FROM_DATA:
4492 assert(
false &&
"can't happen");
4497Reference< chart2::data::XDataSequence> getLabeledSequence(
4498 const uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > >& aSequences,
4507 for(
const auto& rSequence : aSequences )
4511 uno::Reference< chart2::data::XDataSequence > xSequence( rSequence->getValues());
4512 uno::Reference< beans::XPropertySet > xSeqProp( xSequence, uno::UNO_QUERY_THROW );
4514 if( ( xSeqProp->getPropertyValue(
"Role" ) >>= aRole ) &&
4515 aRole.match(
"error-bars" ) && aRole.indexOf(aDirection) >= 0 )
4522 return Reference< chart2::data::XDataSequence > ();
4529 sal_Int32 nErrorBarStyle = cssc::ErrorBarStyle::NONE;
4530 xErrorBarProps->getPropertyValue(
"ErrorBarStyle") >>= nErrorBarStyle;
4531 const char* pErrorBarStyle = getErrorBarStyle(nErrorBarStyle);
4536 pFS->startElement(
FSNS(XML_c, XML_errBars));
4537 pFS->singleElement(
FSNS(XML_c, XML_errDir), XML_val, bYError ?
"y" :
"x");
4538 bool bPositive =
false, bNegative =
false;
4539 xErrorBarProps->getPropertyValue(
"ShowPositiveError") >>= bPositive;
4540 xErrorBarProps->getPropertyValue(
"ShowNegativeError") >>= bNegative;
4541 const char* pErrBarType;
4542 if(bPositive && bNegative)
4543 pErrBarType =
"both";
4545 pErrBarType =
"plus";
4547 pErrBarType =
"minus";
4552 pErrBarType =
"both";
4554 pFS->singleElement(
FSNS(XML_c, XML_errBarType), XML_val, pErrBarType);
4555 pFS->singleElement(
FSNS(XML_c, XML_errValType), XML_val, pErrorBarStyle);
4556 pFS->singleElement(
FSNS(XML_c, XML_noEndCap), XML_val,
"0");
4557 if(nErrorBarStyle == cssc::ErrorBarStyle::FROM_DATA)
4559 uno::Reference< chart2::data::XDataSource > xDataSource(xErrorBarProps, uno::UNO_QUERY);
4561 xDataSource->getDataSequences();
4576 if(nErrorBarStyle == cssc::ErrorBarStyle::STANDARD_DEVIATION)
4578 xErrorBarProps->getPropertyValue(
"Weight") >>= nVal;
4583 xErrorBarProps->getPropertyValue(
"PositiveError") >>= nVal;
4585 xErrorBarProps->getPropertyValue(
"NegativeError") >>= nVal;
4588 pFS->singleElement(
FSNS(XML_c, XML_val), XML_val, OString::number(nVal));
4593 pFS->endElement(
FSNS( XML_c, XML_errBars) );
4599 if( !xPropSet.is() )
4602 pFS->startElement(
FSNS(XML_c, XML_view3D));
4605 if(
GetProperty( xPropSet,
"RotationHorizontal" ) )
4607 sal_Int32 nRotationX = 0;
4608 mAny >>= nRotationX;
4609 if( nRotationX < 0 )
4621 pFS->singleElement(
FSNS(XML_c, XML_rotX), XML_val, OString::number(nRotationX));
4630 sal_Int32 nStartingAngle=0;
4631 mAny >>= nStartingAngle;
4633 nStartingAngle = (450 - nStartingAngle ) % 360;
4634 pFS->singleElement(
FSNS(XML_c, XML_rotY), XML_val, OString::number(nStartingAngle));
4638 sal_Int32 nRotationY = 0;
4639 mAny >>= nRotationY;
4641 if( nRotationY < 0 )
4643 pFS->singleElement(
FSNS(XML_c, XML_rotY), XML_val, OString::number(nRotationY));
4649 bool bRightAngled =
false;
4650 mAny >>= bRightAngled;
4651 const char* sRightAngled = bRightAngled ?
"1":
"0";
4652 pFS->singleElement(
FSNS(XML_c, XML_rAngAx), XML_val, sRightAngled);
4657 sal_Int32 nPerspective = 0;
4658 mAny >>= nPerspective;
4661 pFS->singleElement(
FSNS(XML_c, XML_perspective), XML_val, OString::number(nPerspective));
4663 pFS->endElement(
FSNS( XML_c, XML_view3D ) );
4668 bool isDeep =
false;
4684 OUString aCode(
"General");
4685 uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(
mxChartModel, uno::UNO_QUERY_THROW);
4686 SvNumberFormatsSupplierObj* pSupplierObj = comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>( xNumberFormatsSupplier);
4691 if (!pNumberFormatter)
std::unordered_set< sal_Int32 > maAllowedValues
static css::uno::Reference< css::beans::XPropertySet > createOldAPIDataPointPropertySet(const css::uno::Reference< css::chart2::XDataSeries > &xSeries, sal_Int32 nPointIndex, const css::uno::Reference< css::frame::XModel > &xChartModel)
static css::uno::Reference< css::beans::XPropertySet > createOldAPISeriesPropertySet(const css::uno::Reference< css::chart2::XDataSeries > &xSeries, const css::uno::Reference< css::frame::XModel > &xChartModel)
bool isSingleColor(BColor &rSingleColor) const
const basegfx::BColorStops & GetColorStops() const
void reserve(size_type amount)
const_iterator find(const Value &x) const
const_iterator end() const
std::pair< const_iterator, bool > insert(Value &&x)
A wrapper for a UNO property set.
bool getBoolProperty(sal_Int32 nPropId) const
Gets the specified boolean property from the property set.
bool getProperty(Type &orValue, sal_Int32 nPropId) const
Gets the specified property from the property set.
const css::uno::Reference< css::lang::XMultiServiceFactory > & getModelFactory() const
Returns the service factory provided by the document model (always existing).
OUString addRelation(const OUString &rType, std::u16string_view rTarget)
Adds new relation.
OUString getNamespaceURL(sal_Int32 nNSID) const
const css::uno::Reference< css::frame::XModel > & getModel() const
void _exportAxis(const css::uno::Reference< css::beans::XPropertySet > &xAxisProp, const css::uno::Reference< css::drawing::XShape > &xAxisTitle, const css::uno::Reference< css::beans::XPropertySet > &xMajorGrid, const css::uno::Reference< css::beans::XPropertySet > &xMinorGrid, sal_Int32 nAxisType, const char *sAxisPos, const AxisIdPair &rAxisIdPair)
void exportAdditionalShapes(const css::uno::Reference< css::chart::XChartDocument > &rChartDoc)
void exportVaryColors(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportAllSeries(const css::uno::Reference< css::chart2::XChartType > &xChartType, bool &rPrimaryAxes)
void exportScatterChartSeries(const css::uno::Reference< css::chart2::XChartType > &xChartType, const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > *pSeries)
void exportPlotArea(const css::uno::Reference< css::chart::XChartDocument > &rChartDoc)
void exportShapeProps(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
css::uno::Reference< css::chart2::XDiagram > mxNewDiagram
void exportExternalData(const css::uno::Reference< css::chart::XChartDocument > &rChartDoc)
void exportBitmapFill(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
void exportSeries(const css::uno::Reference< css::chart2::XChartType > &xChartType, const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > &rSeriesSeq, bool &rPrimaryAxes)
void exportRadarChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportAxesId(bool bPrimaryAxes, bool bCheckCombinedAxes=false)
void exportMissingValueTreatment(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
void exportLegend(const css::uno::Reference< css::chart::XChartDocument > &rChartDoc)
void InitRangeSegmentationProperties(const css::uno::Reference< css::chart2::XChartDocument > &xChartDoc)
void exportMarker(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
css::uno::Reference< css::chart2::data::XDataSequence > mxCategoriesValues
void exportHatch(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
void exportDoughnutChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
css::uno::Reference< css::chart::XDiagram > mxDiagram
void exportAreaChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportTrendlines(const css::uno::Reference< css::chart2::XDataSeries > &xSeries)
void exportSolidFill(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
void exportBubbleChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportManualLayout(const css::chart2::RelativePosition &rPos, const css::chart2::RelativeSize &rSize, const bool bIsExcludingDiagramPositioning)
void exportDataLabels(const css::uno::Reference< css::chart2::XDataSeries > &xSeries, sal_Int32 nSeriesLength, sal_Int32 eChartType, DataLabelsRange &rDLblsRange)
void exportFirstSliceAng()
std::set< sal_Int32 > maExportedAxis
void exportTitle(const css::uno::Reference< css::drawing::XShape > &xShape, const OUString *pSubText=nullptr)
void exportScatterChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportSurfaceChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportChart(const css::uno::Reference< css::chart::XChartDocument > &rChartDoc)
OUString parseFormula(const OUString &rRange)
void SetURLTranslator(const std::shared_ptr< URLTransformer > &pTransformer)
void exportChartSpace(const css::uno::Reference< css::chart::XChartDocument > &rChartDoc, bool bIncludeTable)
css::uno::Sequence< css::uno::Sequence< rtl::OUString > > getSplitCategoriesList(const OUString &rRange)
void exportSeriesCategory(const css::uno::Reference< css::chart2::data::XDataSequence > &xValueSeq, sal_Int32 nValueType=XML_cat)
void exportPieChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportSeriesText(const css::uno::Reference< css::chart2::data::XDataSequence > &xValueSeq)
void exportDataPoints(const css::uno::Reference< css::beans::XPropertySet > &xSeriesProperties, sal_Int32 nSeriesLength, sal_Int32 eChartType)
void exportCandleStickSeries(const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > &aSeriesSeq, bool &rPrimaryAxes)
void exportFill(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
void exportGrouping(bool isBar=false)
css::uno::Reference< css::frame::XModel > mxChartModel
ChartExport(sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, css::uno::Reference< css::frame::XModel > const &xModel, ::oox::core::XmlFilterBase *pFB, DocumentType eDocumentType)
OUString getNumberFormatCode(sal_Int32 nKey) const
void exportErrorBar(const css::uno::Reference< css::beans::XPropertySet > &xErrorBarProps, bool bYError)
void exportTextProps(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
void exportGradientFill(const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
void exportLineChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportUpDownBars(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportStockChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
std::shared_ptr< URLTransformer > mpURLTransformer
void exportSeriesValues(const css::uno::Reference< css::chart2::data::XDataSequence > &xValueSeq, sal_Int32 nValueType=XML_val)
void WriteChartObj(const css::uno::Reference< css::drawing::XShape > &xShape, sal_Int32 nID, sal_Int32 nChartCount)
void exportBarChart(const css::uno::Reference< css::chart2::XChartType > &xChartType)
void exportAxis(const AxisIdPair &rAxisIdPair)
A helper container class to collect the chart data point labels and the address of the cell[range] fr...
const OUString & getRange() const
Returns the address of the cell[range] from which label contents are sourced.
void setRange(const OUString &rRange)
Sets the address of the cell[range] from which label contents are sourced.
bool empty() const
Returns whether the container is empty or not.
void setLabel(sal_Int32 nIndex, const OUString &rText)
Adds a new indexed label text.
LabelsRangeMap::const_iterator begin() const
size_t count() const
Returns the count of labels stored.
bool hasLabel(sal_Int32 nIndex) const
Indicates whether the container has a label with index specified by nIndex.
LabelsRangeMap::const_iterator end() const
static sal_Int32 getNewDrawingUniqueId()
::oox::core::XmlFilterBase * mpFB
void WriteGradientFill(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
static void WriteFromTo(const css::uno::Reference< css::drawing::XShape > &rXShape, const css::awt::Size &aPageSize, const sax_fastparser::FSHelperPtr &pDrawing)
sax_fastparser::FSHelperPtr CreateOutputStream(const OUString &sFullStream, std::u16string_view sRelativeStream, const css::uno::Reference< css::io::XOutputStream > &xParentRelation, const OUString &sContentType, const OUString &sRelationshipType, OUString *pRelationshipId)
::sax_fastparser::FSHelperPtr mpFS
bool GetProperty(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet, const OUString &aName)
void WriteXGraphicBlipFill(css::uno::Reference< css::beans::XPropertySet > const &rXPropSet, css::uno::Reference< css::graphic::XGraphic > const &rxGraphic, sal_Int32 nXmlNamespace, bool bWriteMode, bool bRelPathToMedia=false, css::awt::Size const &rSize={})
void SetFS(::sax_fastparser::FSHelperPtr pFS)
const ::sax_fastparser::FSHelperPtr & GetFS() const
::oox::core::XmlFilterBase * GetFB()
DocumentType GetDocumentType() const
void WriteShapeTransformation(const css::uno::Reference< css::drawing::XShape > &rXShape, sal_Int32 nXmlNamespace, bool bFlipH=false, bool bFlipV=false, bool bSuppressRotation=false, bool bSuppressFlipping=false, bool bFlippedBeforeRotation=false)
void WriteSolidFill(::Color nColor, sal_Int32 nAlpha=MAX_PERCENT)
void WritePattFill(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet)
void WriteOutline(const css::uno::Reference< css::beans::XPropertySet > &rXPropSet, css::uno::Reference< css::frame::XModel > const &xModel=nullptr)
void WriteRunProperties(const css::uno::Reference< css::beans::XPropertySet > &rRun, bool bIsField, sal_Int32 nElement, bool bCheckDirect, bool &rbOverridingCharHeight, sal_Int32 &rnCharHeight, sal_Int16 nScriptType=css::i18n::ScriptType::LATIN, const css::uno::Reference< css::beans::XPropertySet > &rXShapePropSet={})
ShapeExport & WriteShape(const css::uno::Reference< css::drawing::XShape > &xShape)
Write the DrawingML for a particular shape.
#define TOOLS_WARN_EXCEPTION(area, stream)
#define TOOLS_INFO_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
constexpr sal_Int32 FSNS(sal_Int32 namespc, sal_Int32 element)
Sequence< PropertyValue > aArguments
#define LANGUAGE_ENGLISH_US
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
double getLength(const B2DPolygon &rCandidate)
enum SAL_DLLPUBLIC_RTTI FillStyle
int uniform_int_distribution(int a, int b)
Reference< XComponentContext > getProcessComponentContext()
std::shared_ptr< T > make_shared(Args &&... args)
constexpr T & temporary(T &&x)
const TypeGroupInfo & GetTypeGroupInfo(TypeId eType)
TypeId
Enumerates different chart types.
@ TYPEID_RADARLINE
Stock chart.
@ TYPEID_SURFACE
Bubble chart.
@ TYPEID_OFPIE
Doughnut (ring) chart.
@ TYPEID_LINE
Horizontal bar chart.
@ TYPEID_HORBAR
Vertical bar chart.
@ TYPEID_PIE
Filled radar chart.
@ TYPEID_UNKNOWN
Surface chart.
@ TYPEID_DOUGHNUT
Pie chart.
@ TYPEID_BUBBLE
Scatter (XY) chart.
@ TYPEID_RADARAREA
Linear radar chart.
@ TYPEID_SCATTER
Pie-to-pie or pie-to-bar chart.
@ TYPEID_STOCK
Area chart.
static bool lcl_isSeriesAttachedToFirstAxis(const Reference< chart2::XDataSeries > &xDataSeries)
static OUString lcl_flattenStringSequence(const Sequence< OUString > &rSequence)
OString calcRotationValue(sal_Int32 nRotation)
nRotation is a 100th of a degree and the return value is in a 60,000th of a degree
static ::std::vector< double > lcl_getAllValuesFromSequence(const Reference< chart2::data::XDataSequence > &xSeq)
static Sequence< OUString > lcl_getLabelSequence(const Reference< chart2::data::XDataSequence > &xLabelSeq)
static sal_Int32 lcl_getCategoryAxisType(const Reference< chart2::XDiagram > &xDiagram, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex)
static sal_Int32 lcl_getChartType(std::u16string_view sChartType)
static bool lcl_isCategoryAxisShifted(const Reference< chart2::XDiagram > &xDiagram)
static void lcl_fillCategoriesIntoStringVector(const Reference< chart2::data::XDataSequence > &xCategories, ::std::vector< OUString > &rOutCategories)
static Reference< chart2::data::XLabeledDataSequence > lcl_getCategories(const Reference< chart2::XDiagram > &xDiagram, bool &bHasDateCategories)
static cssc::TimeIncrement lcl_getDateTimeIncrement(const Reference< chart2::XDiagram > &xDiagram, sal_Int32 nAxisIndex)
static bool lcl_hasCategoryLabels(const Reference< chart2::XChartDocument > &xChartDoc)
static OUString lclGetTimeUnitToken(sal_Int32 nTimeUnit)
const sal_Int32 MAX_PERCENT
static Reference< chart2::data::XLabeledDataSequence > lcl_getDataSequenceByRole(const Sequence< Reference< chart2::data::XLabeledDataSequence > > &aLabeledSeq, const OUString &rRole)
const sal_Int32 PER_PERCENT
static sal_Int32 lcl_generateRandomValue()
sal_Int64 convertHmmToEmu(sal_Int32 nValue)
Converts the passed 32-bit integer value from 1/100 mm to EMUs.
OUString getRelationship(Relationship eRelationship)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
bool getOutputStream(ProgramOptions const &options, OString const &extension, std::ostream **ppOutputStream, OString &targetSourceFileName, OString &tmpSourceFileName)
::std::array< OUString, NF_KEYWORD_ENTRIES_COUNT > NfKeywordTable
std::unique_ptr< uint8_t[]> pLabels
Contains info for a chart type related to the OpenOffice.org chart module.
sal_Int32 mnDefLabelPos
Mode for varying point colors.
Reference< XModel > xModel
css::drawing::Direction3D aDirection
static constexpr const char * ToPsz10(bool b)