34#include <com/sun/star/chart/DataLabelPlacement.hpp>
36#include <com/sun/star/chart2/DataPointGeometry3D.hpp>
37#include <rtl/math.hxx>
43using namespace ::rtl::math;
47 , sal_Int32 nDimensionCount )
48 : VSeriesPlotter( xChartTypeModel, nDimensionCount )
49 , m_pMainPosHelper( new BarPositionHelper() )
51 PlotterBase::m_pPosHelper = m_pMainPosHelper.get();
52 VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper.get();
56 if( m_xChartTypeModel.is() )
58 m_xChartTypeModel->getPropertyValue(
"OverlapSequence" ) >>= m_aOverlapSequence;
59 m_xChartTypeModel->getPropertyValue(
"GapwidthSequence" ) >>= m_aGapwidthSequence;
62 catch(
const uno::Exception& )
76 if( pBarPosHelper && nAxisIndex >= 0 )
78 if( nAxisIndex < m_aOverlapSequence.getLength() )
80 if( nAxisIndex < m_aGapwidthSequence.getLength() )
86drawing::Direction3D BarChart::getPreferredDiagramAspectRatio()
const
88 drawing::Direction3D aRet(1.0,1.0,1.0);
89 if( m_nDimension == 3 )
91 aRet = drawing::Direction3D(1.0,-1.0,1.0);
96 if(aScale.DirectionX!=0.0)
98 double fXSlotCount = 1.0;
99 if(!m_aZSlots.empty())
101 fXSlotCount = m_aZSlots.begin()->size();
103 aRet.DirectionZ = aScale.DirectionZ /
104 (aScale.DirectionX + aScale.DirectionX * (fXSlotCount-1.0) * pPosHelper->
getScaledSlotWidth());
108 return VSeriesPlotter::getPreferredDiagramAspectRatio();
113 return VSeriesPlotter::getPreferredDiagramAspectRatio();
116 if(aRet.DirectionZ<0.05)
118 aRet.DirectionZ=0.05;
120 else if(aRet.DirectionZ>10)
124 if( m_pMainPosHelper && m_pMainPosHelper->isSwapXAndY() )
126 std::swap(aRet.DirectionX, aRet.DirectionY);
130 aRet = drawing::Direction3D(-1,-1,-1);
134awt::Point BarChart::getLabelScreenPositionAndAlignment(
136 ,
double fScaledX,
double fScaledLowerYValue,
double fScaledUpperYValue,
double fScaledZ
137 ,
double fScaledLowerBarDepth,
double fScaledUpperBarDepth,
double fBaseValue
141 double fX = fScaledX;
142 double fY = fScaledUpperYValue;
143 double fZ = fScaledZ;
145 bool bNormalOutside = (!bReverse == (fBaseValue < fScaledUpperYValue));
146 double fDepth = fScaledUpperBarDepth;
148 switch(nLabelPlacement)
150 case css::chart::DataLabelPlacement::TOP:
154 fY = bReverse ? fScaledLowerYValue : fScaledUpperYValue;
157 fDepth = bReverse ? fabs(fScaledLowerBarDepth) : fabs(fScaledUpperBarDepth);
161 fY -= (fScaledUpperYValue-fScaledLowerYValue)/2.0;
163 OSL_FAIL(
"top label placement is not really supported by horizontal bar charts" );
167 case css::chart::DataLabelPlacement::BOTTOM:
171 fY = bReverse ? fScaledUpperYValue : fScaledLowerYValue;
174 fDepth = bReverse ? fabs(fScaledUpperBarDepth) : fabs(fScaledLowerBarDepth);
178 fY -= (fScaledUpperYValue-fScaledLowerYValue)/2.0;
180 OSL_FAIL(
"bottom label placement is not supported by horizontal bar charts" );
184 case css::chart::DataLabelPlacement::LEFT:
188 fY = bReverse ? fScaledUpperYValue : fScaledLowerYValue;
191 fDepth = bReverse ? fabs(fScaledUpperBarDepth) : fabs(fScaledLowerBarDepth);
195 fY -= (fScaledUpperYValue-fScaledLowerYValue)/2.0;
197 OSL_FAIL(
"left label placement is not supported by column charts" );
201 case css::chart::DataLabelPlacement::RIGHT:
205 fY = bReverse ? fScaledLowerYValue : fScaledUpperYValue;
208 fDepth = bReverse ? fabs(fScaledLowerBarDepth) : fabs(fScaledUpperBarDepth);
212 fY -= (fScaledUpperYValue-fScaledLowerYValue)/2.0;
214 OSL_FAIL(
"right label placement is not supported by column charts" );
218 case css::chart::DataLabelPlacement::OUTSIDE:
220 fY = (fBaseValue < fScaledUpperYValue) ? fScaledUpperYValue : fScaledLowerYValue;
223 if( fBaseValue == fScaledUpperYValue && fBaseValue == fScaledLowerYValue )
229 if( fBaseValue == fScaledUpperYValue && fBaseValue == fScaledLowerYValue )
234 fDepth = (fBaseValue < fScaledUpperYValue) ? fabs(fScaledUpperBarDepth) : fabs(fScaledLowerBarDepth);
237 case css::chart::DataLabelPlacement::INSIDE:
239 fY = (fBaseValue < fScaledUpperYValue) ? fScaledUpperYValue : fScaledLowerYValue;
245 fDepth = (fBaseValue < fScaledUpperYValue) ? fabs(fScaledUpperBarDepth) : fabs(fScaledLowerBarDepth);
248 case css::chart::DataLabelPlacement::NEAR_ORIGIN:
250 fY = (fBaseValue < fScaledUpperYValue) ? fScaledLowerYValue : fScaledUpperYValue;
253 if( fBaseValue == fScaledUpperYValue && fBaseValue == fScaledLowerYValue )
259 if( fBaseValue == fScaledUpperYValue && fBaseValue == fScaledLowerYValue )
264 fDepth = (fBaseValue < fScaledUpperYValue) ? fabs(fScaledLowerBarDepth) : fabs(fScaledUpperBarDepth);
267 case css::chart::DataLabelPlacement::CENTER:
268 fY -= (fScaledUpperYValue-fScaledLowerYValue)/2.0;
270 if( fBaseValue == fScaledUpperYValue && fBaseValue == fScaledLowerYValue )
278 fDepth = fabs(fScaledUpperBarDepth-fScaledLowerBarDepth)/2.0;
281 OSL_FAIL(
"this label alignment is not implemented yet");
288 drawing::Position3D aScenePosition3D( pPosHelper->
289 transformScaledLogicToScene( fX, fY, fZ,
true ) );
296 ,
const drawing::Position3D& rPosition,
const drawing::Direction3D& rSize
297 ,
double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree
299 , sal_Int32 nGeometry3D )
301 bool bRoundedEdges =
true;
304 if( xObjectProperties.is() )
306 sal_Int16 nPercentDiagonal = 0;
307 xObjectProperties->getPropertyValue(
"PercentDiagonal" ) >>= nPercentDiagonal;
308 if( nPercentDiagonal < 5 )
309 bRoundedEdges =
false;
312 catch(
const uno::Exception& )
318 switch( nGeometry3D )
320 case DataPointGeometry3D::CYLINDER:
321 xShape = ShapeFactory::createCylinder(
xTarget, rPosition, rSize, nRotateZAngleHundredthDegree );
323 case DataPointGeometry3D::CONE:
324 xShape = ShapeFactory::createCone(
xTarget, rPosition, rSize, fTopHeight, nRotateZAngleHundredthDegree );
326 case DataPointGeometry3D::PYRAMID:
327 xShape = ShapeFactory::createPyramid(
xTarget, rPosition, rSize, fTopHeight, nRotateZAngleHundredthDegree>0
328 , xObjectProperties, PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
330 case DataPointGeometry3D::CUBOID:
332 xShape = ShapeFactory::createCube(
xTarget, rPosition, rSize
333 , nRotateZAngleHundredthDegree, xObjectProperties
334 , PropertyMapper::getPropertyNameMapForFilledSeriesProperties(), bRoundedEdges );
337 if( nGeometry3D != DataPointGeometry3D::PYRAMID )
338 PropertyMapper::setMappedProperties( *xShape, xObjectProperties, PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
344bool lcl_hasGeometry3DVariableWidth( sal_Int32 nGeometry3D )
347 switch( nGeometry3D )
349 case DataPointGeometry3D::PYRAMID:
350 case DataPointGeometry3D::CONE:
353 case DataPointGeometry3D::CUBOID:
354 case DataPointGeometry3D::CYLINDER:
363void BarChart::addSeries( std::unique_ptr<VDataSeries> pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot )
372 sal_Int32 nAxisIndex = pSeries->getAttachedAxisIndex();
375 if( !pSeries->getGroupBarsPerAxis() )
377 if(zSlot>=
static_cast<sal_Int32
>(m_aZSlots.size()))
378 m_aZSlots.resize(zSlot+1);
380 VSeriesPlotter::addSeries( std::move(pSeries), zSlot, xSlot, ySlot );
383void BarChart::adaptOverlapAndGapwidthForGroupBarsPerAxis()
394 sal_Int32 nUseThisIndex = nAxisIndex;
395 if( nUseThisIndex < 0 || nUseThisIndex >= m_aOverlapSequence.getLength() )
397 auto aOverlapSequenceRange = asNonConstRange(m_aOverlapSequence);
398 for( nN = 0; nN < m_aOverlapSequence.getLength(); nN++ )
400 if(nN!=nUseThisIndex)
401 aOverlapSequenceRange[nN] = m_aOverlapSequence[nUseThisIndex];
404 nUseThisIndex = nAxisIndex;
405 if( nUseThisIndex < 0 || nUseThisIndex >= m_aGapwidthSequence.getLength() )
407 auto aGapwidthSequenceRange = asNonConstRange(m_aGapwidthSequence);
408 for( nN = 0; nN < m_aGapwidthSequence.getLength(); nN++ )
410 if(nN!=nUseThisIndex)
411 aGapwidthSequenceRange[nN] = m_aGapwidthSequence[nUseThisIndex];
415void BarChart::createShapes()
417 if( m_aZSlots.empty() )
420 OSL_ENSURE(m_xLogicTarget.is()&&m_xFinalTarget.is(),
"BarChart is not proper initialized");
421 if(!(m_xLogicTarget.is()&&m_xFinalTarget.is()))
436 ShapeFactory::createGroup2D( m_xFinalTarget );
439 bool bDrawConnectionLines =
false;
440 bool bDrawConnectionLinesInited =
false;
442 std::unordered_set<rtl::Reference<SvxShape>> aShapeSet;
446 std::unordered_set<E3dScene*> aSceneSet;
452 aSceneSet.insert(pScene->getRootE3dSceneFromE3dObject());
457 pScene->ResumeReportingDirtyRects();
458 pScene->SetAllSceneRectsDirty();
462 adaptOverlapAndGapwidthForGroupBarsPerAxis();
465 std::map< VDataSeries*, FormerBarPoint > aSeriesFormerPointMap;
466 m_bPointsWereSkipped =
false;
468 sal_Int32 nStartIndex = 0;
469 sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
471 for( sal_Int32 nPointIndex = nStartIndex; nPointIndex < nEndIndex; nPointIndex++ )
474 std::map< sal_Int32, double > aLogicYSumMap;
475 for(
auto& rZSlot : m_aZSlots )
477 for(
auto& rXSlot : rZSlot )
479 sal_Int32 nAttachedAxisIndex = rXSlot.getAttachedAxisIndexForFirstSeries();
480 aLogicYSumMap.insert({nAttachedAxisIndex, 0.0});
482 const sal_Int32 nSlotPoints = rXSlot.getPointCount();
483 if( nPointIndex >= nSlotPoints )
486 double fMinimumY = 0.0, fMaximumY = 0.0;
487 rXSlot.calculateYMinAndMaxForCategory( nPointIndex
488 , isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
490 if( !std::isnan( fMaximumY ) && fMaximumY > 0)
491 aLogicYSumMap[nAttachedAxisIndex] += fMaximumY;
492 if( !std::isnan( fMinimumY ) && fMinimumY < 0)
493 aLogicYSumMap[nAttachedAxisIndex] += fabs(fMinimumY);
498 for(
auto& rZSlot : m_aZSlots )
500 doZSlot(bDrawConnectionLines, bDrawConnectionLinesInited, rZSlot, nZ, nPointIndex, nStartIndex,
501 xSeriesTarget, xRegressionCurveTarget, xRegressionCurveEquationTarget, xTextTarget,
502 aShapeSet, aSeriesFormerPointMap, aLogicYSumMap);
506 if( bDrawConnectionLines )
508 for(
auto const& rZSlot : m_aZSlots )
511 if( !rZSlot.empty() )
513 sal_Int32 nAttachedAxisIndex = rZSlot.front().getAttachedAxisIndexForFirstSeries();
515 pPosHelper =
dynamic_cast<BarPositionHelper*
>(&( getPlottingPositionHelper( nAttachedAxisIndex ) ) );
517 pPosHelper = m_pMainPosHelper.get();
519 PlotterBase::m_pPosHelper = pPosHelper;
522 for(
auto const& rXSlot : rZSlot )
525 for( std::unique_ptr<VDataSeries>
const & pSeries : rXSlot.m_aSeriesVector )
529 std::vector<std::vector<css::drawing::Position3D>>* pSeriesPoly = &pSeries->m_aPolyPolygonShape3D;
530 if(!ShapeFactory::hasPolygonAnyLines(*pSeriesPoly))
533 std::vector<std::vector<css::drawing::Position3D>> aPoly;
536 if(!ShapeFactory::hasPolygonAnyLines(aPoly))
543 getSeriesGroupShape(pSeries.get(), xSeriesTarget) );
545 xSeriesGroupShape_Shapes, aPoly ) );
546 PropertyMapper::setMappedProperties( *xShape, pSeries->getPropertiesOfSeries()
547 , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
557void BarChart::doZSlot(
558 bool& bDrawConnectionLines,
bool& bDrawConnectionLinesInited,
559 const std::vector< VDataSeriesGroup >& rZSlot,
560 const sal_Int32 nZ,
const sal_Int32 nPointIndex,
const sal_Int32 nStartIndex,
566 std::map< VDataSeries*, FormerBarPoint >& aSeriesFormerPointMap,
567 std::map< sal_Int32, double >& aLogicYSumMap)
571 for(
auto& rXSlot : rZSlot )
573 sal_Int32 nAttachedAxisIndex = rXSlot.getAttachedAxisIndexForFirstSeries();
577 pPosHelper = m_pMainPosHelper.get();
579 PlotterBase::m_pPosHelper = pPosHelper;
587 double fMinimumY = 0.0, fMaximumY = 0.0;
588 if( nPointIndex < rXSlot.getPointCount())
589 rXSlot.calculateYMinAndMaxForCategory( nPointIndex
590 , isSeparateStackingForDifferentSigns( 1 ), fMinimumY, fMaximumY, nAttachedAxisIndex );
592 double fLogicPositiveYSum = 0.0;
593 if( !std::isnan( fMaximumY ) )
594 fLogicPositiveYSum = fMaximumY;
596 double fLogicNegativeYSum = 0.0;
597 if( !std::isnan( fMinimumY ) )
598 fLogicNegativeYSum = fMinimumY;
610 if( fLogicNegativeYSum < 0.0 )
613 if( fLogicPositiveYSum < 0.0 )
614 fLogicPositiveYSum = -fLogicNegativeYSum;
617 fLogicPositiveYSum -= fLogicNegativeYSum;
619 fLogicNegativeYSum = 0.0;
622 doXSlot(rXSlot, bDrawConnectionLines, bDrawConnectionLinesInited, nZ, nPointIndex, nStartIndex,
623 xSeriesTarget, xRegressionCurveTarget, xRegressionCurveEquationTarget, xTextTarget,
624 aShapeSet, aSeriesFormerPointMap, aLogicYSumMap,
625 fLogicBaseWidth, fSlotX, pPosHelper, fLogicPositiveYSum, fLogicNegativeYSum, nAttachedAxisIndex);
632void BarChart::doXSlot(
634 bool& bDrawConnectionLines,
bool& bDrawConnectionLinesInited,
635 const sal_Int32 nZ,
const sal_Int32 nPointIndex,
const sal_Int32 nStartIndex,
641 std::map< VDataSeries*, FormerBarPoint >& aSeriesFormerPointMap,
642 std::map< sal_Int32, double >& aLogicYSumMap,
643 const double fLogicBaseWidth,
const double fSlotX,
645 const double fLogicPositiveYSum,
const double fLogicNegativeYSum,
646 const sal_Int32 nAttachedAxisIndex)
648 double fBaseValue = 0.0;
651 double fPositiveLogicYForNextSeries = fBaseValue;
652 double fNegativeLogicYForNextSeries = fBaseValue;
655 for( std::unique_ptr<VDataSeries>
const & pSeries : rXSlot.
m_aSeriesVector )
660 bool bHasFillColorMapping = pSeries->hasPropertyMapping(
"FillColor");
662 bool bOnlyConnectionLinesForThisPoint =
false;
664 if(nPointIndex==nStartIndex)
665 createRegressionCurvesShapes( *pSeries, xRegressionCurveTarget, xRegressionCurveEquationTarget,
666 m_pPosHelper->maySkipPointsInRegressionCalculation());
668 if( !bDrawConnectionLinesInited )
670 bDrawConnectionLines = pSeries->getConnectBars();
671 if( m_nDimension==3 )
672 bDrawConnectionLines =
false;
676 StackingDirection eDirection = pSeries->getStackingDirection();
677 if( eDirection != StackingDirection_Y_STACKING )
678 bDrawConnectionLines =
false;
680 bDrawConnectionLinesInited =
true;
687 aShapeSet.insert(xSeriesGroupShape_Shapes);
688 aShapeSet.insert(xSeriesBackgroundShape_Shapes);
693 pScene =
DynCastE3dScene(xSeriesBackgroundShape_Shapes->GetSdrObject());
698 double fUnscaledLogicX = pSeries->getXValue( nPointIndex );
699 fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
700 if(std::isnan(fUnscaledLogicX))
702 if(fUnscaledLogicX<pPosHelper->getLogicMinX())
710 double fLogicBarHeight = pSeries->getYValue( nPointIndex );
711 if( std::isnan( fLogicBarHeight ))
714 double fLogicValueForLabeDisplay = fLogicBarHeight;
715 fLogicBarHeight-=fBaseValue;
719 if(fLogicPositiveYSum!=0.0)
720 fLogicBarHeight = fabs( fLogicBarHeight )/fLogicPositiveYSum;
722 fLogicBarHeight = 0.0;
727 if( fLogicBarHeight == 0.0 )
728 fLogicBarHeight = DBL_MIN;
731 bool bPositive = fLogicBarHeight >= 0.0;
732 double fLowerYValue = bPositive ? fPositiveLogicYForNextSeries : fNegativeLogicYForNextSeries;
733 double fUpperYValue = fLowerYValue+fLogicBarHeight;
735 fPositiveLogicYForNextSeries += fLogicBarHeight;
737 fNegativeLogicYForNextSeries += fLogicBarHeight;
739 double fLogicZ = 1.0;
743 drawing::Position3D aUnscaledLogicPosition( fUnscaledLogicX, fUpperYValue, fLogicZ );
753 sal_Int32 nGeometry3D = DataPointGeometry3D::CUBOID;
754 if(m_nDimension==3)
try
756 xDataPointProperties->getPropertyValue(
"Geometry3D") >>= nGeometry3D;
758 catch(
const uno::Exception& )
768 double fUnclippedUpperYValue = fUpperYValue;
771 if( !pPosHelper->
clipYRange(fLowerYValue,fUpperYValue) )
773 if( bDrawConnectionLines )
774 bOnlyConnectionLinesForThisPoint =
true;
785 pSubPosHelper->
doLogicScaling(
nullptr,&fUnclippedUpperYValue,
nullptr);
788 double fCompleteHeight = bPositive ? fLogicPositiveYSum : fLogicNegativeYSum;
790 fCompleteHeight = 1.0;
791 double fLogicBarWidth = fLogicBaseWidth;
792 double fTopHeight=approxSub(fCompleteHeight,fUpperYValue);
794 fTopHeight=approxSub(fCompleteHeight,fLowerYValue);
795 double fLogicYStart = bPositive ? fLowerYValue : fUpperYValue;
796 double fMiddleHeight = fUpperYValue-fLowerYValue;
799 double fLogicBarDepth = 0.5;
802 if( lcl_hasGeometry3DVariableWidth(nGeometry3D) && fCompleteHeight!=0.0 )
804 double fHeight = fCompleteHeight-fLowerYValue;
806 fHeight = fCompleteHeight-fUpperYValue;
807 fLogicBarWidth = fLogicBaseWidth*fHeight/fCompleteHeight;
808 if(fLogicBarWidth<=0.0)
809 fLogicBarWidth=fLogicBaseWidth;
810 fLogicBarDepth = fLogicBarDepth*fHeight/fCompleteHeight;
811 if(fLogicBarDepth<=0.0)
812 fLogicBarDepth*=-1.0;
817 FormerBarPoint aFormerPoint( aSeriesFormerPointMap[pSeries.get()] );
819 if( !pSeries->isAttributedDataPoint(nPointIndex)
822 , fLogicX, fUpperYValue, fLogicZ )
825 , fLogicX, fLowerYValue, fLogicZ )
828 m_bPointsWereSkipped =
true;
831 aSeriesFormerPointMap[pSeries.get()] =
FormerBarPoint(fLogicX,fUpperYValue,fLowerYValue,fLogicZ);
833 if( bDrawConnectionLines )
837 drawing::Position3D aLeftUpperPoint( fLogicX-fLogicBarWidth/2.0,fUnclippedUpperYValue,fLogicZ );
838 drawing::Position3D aRightUpperPoint( fLogicX+fLogicBarWidth/2.0,fUnclippedUpperYValue,fLogicZ );
840 if( isValidPosition(aLeftUpperPoint) )
841 AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aLeftUpperPoint );
842 if( isValidPosition(aRightUpperPoint) )
843 AddPointToPoly( pSeries->m_aPolyPolygonShape3D, aRightUpperPoint );
846 if( bOnlyConnectionLinesForThisPoint )
855 if( !approxEqual(fLowerYValue,fUpperYValue) )
858 if( m_nDimension==3 )
860 drawing::Position3D aLogicBottom (fLogicX,fLogicYStart,fLogicZ);
861 drawing::Position3D aLogicLeftBottomFront (fLogicX+fLogicBarWidth/2.0,fLogicYStart,fLogicZ-fLogicBarDepth/2.0);
862 drawing::Position3D aLogicRightDeepTop (fLogicX-fLogicBarWidth/2.0,fLogicYStart+fMiddleHeight,fLogicZ+fLogicBarDepth/2.0);
863 drawing::Position3D aLogicTopTop (fLogicX,fLogicYStart+fMiddleHeight+fTopHeight,fLogicZ);
868 drawing::Position3D aTransformedBottom ( pTransformation->
transform( aLogicBottom ) );
869 drawing::Position3D aTransformedLeftBottomFront ( pTransformation->
transform( aLogicLeftBottomFront ) );
870 drawing::Position3D aTransformedRightDeepTop ( pTransformation->
transform( aLogicRightDeepTop ) );
871 drawing::Position3D aTransformedTopTop ( pTransformation->
transform( aLogicTopTop ) );
873 drawing::Direction3D aSize = aTransformedRightDeepTop - aTransformedLeftBottomFront;
874 drawing::Direction3D aTopSize( aTransformedTopTop - aTransformedRightDeepTop );
875 fTopHeight = aTopSize.DirectionY;
877 sal_Int32 nRotateZAngleHundredthDegree = 0;
880 fTopHeight = aTopSize.DirectionX;
881 nRotateZAngleHundredthDegree = 90*100;
882 aSize = drawing::Direction3D(aSize.DirectionY,aSize.DirectionX,aSize.DirectionZ);
885 if( aSize.DirectionX < 0 )
886 aSize.DirectionX *= -1.0;
887 if( aSize.DirectionZ < 0 )
888 aSize.DirectionZ *= -1.0;
892 xShape = createDataPoint3D_Bar(
893 xSeriesGroupShape_Shapes, aTransformedBottom, aSize, fTopHeight, nRotateZAngleHundredthDegree
894 , xDataPointProperties, nGeometry3D );
898 drawing::Position3D aLeftUpperPoint( fLogicX-fLogicBarWidth/2.0,fUpperYValue,fLogicZ );
899 drawing::Position3D aRightUpperPoint( fLogicX+fLogicBarWidth/2.0,fUpperYValue,fLogicZ );
900 std::vector<std::vector<css::drawing::Position3D>> aPoly
903 drawing::Position3D( fLogicX-fLogicBarWidth/2.0,fLowerYValue,fLogicZ),
904 drawing::Position3D( fLogicX+fLogicBarWidth/2.0,fLowerYValue,fLogicZ),
907 drawing::Position3D( fLogicX-fLogicBarWidth/2.0,fLowerYValue,fLogicZ)
911 xShape = ShapeFactory::createArea2D( xSeriesGroupShape_Shapes, aPoly );
912 PropertyMapper::setMappedProperties( *xShape, xDataPointProperties, PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
915 if(bHasFillColorMapping)
917 double nPropVal = pSeries->getValueByProperty(nPointIndex,
"FillColor");
918 if(!std::isnan(nPropVal))
920 xShape->setPropertyValue(
"FillColor",
uno::Any(
static_cast<sal_Int32
>(nPropVal)));
924 ShapeFactory::setShapeName(xShape
925 , ObjectIdentifier::createPointCID(
926 pSeries->getPointCID_Stub(),nPointIndex) );
930 createErrorBar_Y( aUnscaledLogicPosition, *pSeries, nPointIndex, m_xLogicTarget, &fLogicX );
933 if( pSeries->getDataPointLabelIfLabel(nPointIndex) )
935 double fLogicSum = aLogicYSumMap[nAttachedAxisIndex];
938 sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nPointIndex, m_xChartTypeModel, pPosHelper->
isSwapXAndY() );
940 double fLowerBarDepth = fLogicBarDepth;
941 double fUpperBarDepth = fLogicBarDepth;
943 if( lcl_hasGeometry3DVariableWidth(nGeometry3D) && fCompleteHeight!=0.0 )
945 double fOuterBarDepth = fLogicBarDepth * fTopHeight/(fabs(fCompleteHeight));
946 fLowerBarDepth = (fBaseValue < fUpperYValue) ? fabs(fLogicBarDepth) : fabs(fOuterBarDepth);
947 fUpperBarDepth = (fBaseValue < fUpperYValue) ? fabs(fOuterBarDepth) : fabs(fLogicBarDepth);
951 awt::Point aScreenPosition2D = getLabelScreenPositionAndAlignment(
952 eAlignment, nLabelPlacement, fLogicX, fLowerYValue, fUpperYValue, fLogicZ,
953 fLowerBarDepth, fUpperBarDepth, fBaseValue, pPosHelper);
954 sal_Int32 nOffset = 0;
958 if( m_nDimension == 3 )
962 xTextTarget, *pSeries, nPointIndex,
963 fLogicValueForLabeDisplay, fLogicSum, aScreenPosition2D, eAlignment, nOffset);
void SuspendReportingDirtyRects()
virtual double getScaledSlotPos(double fCategoryX, double fSeriesNumber) const override
void updateSeriesCount(double fSeriesCount)
double getScaledSlotWidth() const
void setOuterDistance(double fOuterDistance)
void setInnerDistance(double fInnerDistance)
css::awt::Point transformSceneToScreenPosition(const css::drawing::Position3D &rScenePosition3D) const
double getBaseValueY() const
double getLogicMaxX() const
bool isStrongLowerRequested(sal_Int32 nDimensionIndex) const
virtual ::chart::XTransformation2 * getTransformationScaledLogicToScene() const
bool isSameForGivenResolution(double fX, double fY, double fZ, double fX2, double fY2, double fZ2)
css::drawing::Direction3D getScaledLogicWidth() const
bool clipYRange(double &rMin, double &rMax) const
void setCoordinateSystemResolution(const css::uno::Sequence< sal_Int32 > &rCoordinateSystemResolution)
::basegfx::B2DRectangle getScaledLogicClipDoubleRect() const
void doLogicScaling(double *pX, double *pY, double *pZ) const
virtual css::drawing::Position3D transformScaledLogicToScene(double fX, double fY, double fZ, bool bClip) const
bool isMathematicalOrientationY() const
A list of series that have the same CoordinateSystem.
std::vector< std::unique_ptr< VDataSeries > > m_aSeriesVector
sal_Int32 getAttachedAxisIndex() const
bool getGroupBarsPerAxis() const
#define TOOLS_WARN_EXCEPTION(area, stream)
Reference< XInterface > xTarget
OOO_DLLPUBLIC_CHARTTOOLS void AddPointToPoly(css::drawing::PolyPolygonShape3D &rPoly, const css::drawing::Position3D &rPos, sal_Int32 nSequenceIndex=0)
PolyPolygonShape3D + drawing::Position3D -> PolyPolygonShape3D.
const sal_Int32 MAIN_AXIS_INDEX
SVXCORE_DLLPUBLIC E3dScene * DynCastE3dScene(SdrObject *)