36using ::com::sun::star::uno::Reference;
39 : VCoordinateSystem(xCooSys)
43VPolarCoordinateSystem::~VPolarCoordinateSystem()
49 const awt::Size& rPageSize,
const awt::Size& rPageResolution )
53 if( aResolution.getLength() >= 2 )
55 auto pResolution = aResolution.getArray();
56 if( getPropertySwapXAndYAxis() )
71void VPolarCoordinateSystem::createVAxisList(
73 const awt::Size& rFontReferenceSize,
74 const awt::Rectangle& rMaximumSpaceForLabels,
76 std::vector<std::unique_ptr<VSeriesPlotter>>& ,
77 css::uno::Reference<css::uno::XComponentContext>
const& )
82 xChartDoc->getNumberFormatsSupplier());
85 sal_Int32 nDimensionCount = m_xCooSysModel->getDimension();
86 sal_Int32 nDimensionIndex = 0;
89 for( nDimensionIndex = 0; nDimensionIndex < nDimensionCount; nDimensionIndex++ )
91 sal_Int32 nMaxAxisIndex = m_xCooSysModel->getMaximumAxisIndexByDimension(nDimensionIndex);
92 for( sal_Int32 nAxisIndex = 0; nAxisIndex <= nMaxAxisIndex; nAxisIndex++ )
95 if(!xAxis.is() || !AxisHelper::shouldAxisBeDisplayed( xAxis, m_xCooSysModel ))
99 AxisProperties aAxisProperties(xAxis,getExplicitCategoriesProvider(), xDiagram->getDataTableRef());
100 aAxisProperties.
init();
104 std::shared_ptr< VAxisBase > apVAxis( VPolarAxis::createAxis( aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount) );
106 m_aAxisMap[aFullAxisIndex] = apVAxis;
108 apVAxis->initAxisLabelProperties(rFontReferenceSize,rMaximumSpaceForLabels);
113void VPolarCoordinateSystem::initVAxisInList()
115 if(!m_xLogicTargetForAxes.is() || !m_xFinalTarget.is() || !m_xCooSysModel.is() )
118 sal_Int32 nDimensionCount = m_xCooSysModel->getDimension();
119 bool bSwapXAndY = getPropertySwapXAndYAxis();
121 for (
auto const& elem : m_aAxisMap)
126 sal_Int32 nDimensionIndex = elem.first.first;
127 sal_Int32 nAxisIndex = elem.first.second;
128 pVAxis->
setExplicitScaleAndIncrement( getExplicitScale( nDimensionIndex, nAxisIndex ), getExplicitIncrement(nDimensionIndex, nAxisIndex) );
129 pVAxis->
initPlotter(m_xLogicTargetForAxes,m_xFinalTarget
130 , createCIDForAxis( nDimensionIndex, nAxisIndex ) );
133 pVPolarAxis->
setIncrements( getExplicitIncrements( nDimensionIndex, nAxisIndex ) );
134 if(nDimensionCount==2)
136 pVAxis->
setScales( getExplicitScales( nDimensionIndex, nAxisIndex ), bSwapXAndY );
141void VPolarCoordinateSystem::updateScalesAndIncrementsOnAxes()
143 if(!m_xLogicTargetForAxes.is() || !m_xFinalTarget.is() || !m_xCooSysModel.is() )
146 sal_Int32 nDimensionCount = m_xCooSysModel->getDimension();
147 bool bSwapXAndY = getPropertySwapXAndYAxis();
149 for (
auto const& elem : m_aAxisMap)
154 sal_Int32 nDimensionIndex = elem.first.first;
155 sal_Int32 nAxisIndex = elem.first.second;
156 pVAxis->
setExplicitScaleAndIncrement( getExplicitScale( nDimensionIndex, nAxisIndex ), getExplicitIncrement(nDimensionIndex, nAxisIndex) );
159 pVPolarAxis->
setIncrements( getExplicitIncrements( nDimensionIndex, nAxisIndex ) );
160 if(nDimensionCount==2)
162 pVAxis->
setScales( getExplicitScales( nDimensionIndex, nAxisIndex ), bSwapXAndY );
167void VPolarCoordinateSystem::createGridShapes()
169 if(!m_xLogicTargetForGrids.is() || !m_xFinalTarget.is() )
172 sal_Int32 nDimensionCount = m_xCooSysModel->getDimension();
173 bool bSwapXAndY = getPropertySwapXAndYAxis();
175 for( sal_Int32 nDimensionIndex=0; nDimensionIndex<3; nDimensionIndex++)
180 if(!xAxis.is() || !AxisHelper::shouldAxisBeDisplayed( xAxis, m_xCooSysModel ))
183 VPolarGrid aGrid(nDimensionIndex,nDimensionCount,getGridListFromAxis( xAxis ));
184 aGrid.
setIncrements( getExplicitIncrements( nDimensionIndex, nAxisIndex ) );
185 aGrid.
initPlotter(m_xLogicTargetForGrids,m_xFinalTarget
186 , createCIDForGrid( nDimensionIndex, nAxisIndex ) );
187 if(nDimensionCount==2)
189 aGrid.
setScales( getExplicitScales( nDimensionIndex, nAxisIndex), bSwapXAndY );
virtual void setScales(std::vector< ExplicitScaleData > &&rScales, bool bSwapXAndYAxis)
virtual void initPlotter(const rtl::Reference< SvxShapeGroupAnyD > &xLogicTarget, const rtl::Reference< SvxShapeGroupAnyD > &xFinalTarget, const OUString &rCID)
virtual void setExplicitScaleAndIncrement(const ExplicitScaleData &rScale, const ExplicitIncrementData &rIncrement) override
virtual void setTransformationSceneToScreen(const css::drawing::HomogenMatrix &rMatrix) override
std::pair< sal_Int32, sal_Int32 > tFullAxisIndex
void setIncrements(std::vector< ExplicitIncrementData > &&rIncrements)
VPolarCoordinateSystem()=delete
void setIncrements(std::vector< ExplicitIncrementData > &&rIncrements)
virtual void createShapes() override
const sal_Int32 MAIN_AXIS_INDEX
void init(bool bCartesian=false)
sal_Int32 m_nNumberFormatKey