diff options
Diffstat (limited to 'chart2/source/model')
-rw-r--r-- | chart2/source/model/template/ChartTypeTemplate.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index 498be4e2daf9..82aa3e12075e 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -643,17 +643,21 @@ void ChartTypeTemplate::adaptScales( sal_Int32 nDim( xCooSys->getDimension()); if( nDim > 0 ) { - const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(0); + const sal_Int32 nDimensionX = 0; + const sal_Int32 nMaxIndex = xCooSys->getMaximumAxisIndexByDimension(nDimensionX); for(sal_Int32 nI=0; nI<=nMaxIndex; ++nI) { - Reference< XAxis > xAxis( xCooSys->getAxisByDimension(0,nI) ); + Reference< XAxis > xAxis( xCooSys->getAxisByDimension(nDimensionX,nI) ); if( xAxis.is()) { ScaleData aData( xAxis->getScaleData() ); aData.Categories = xCategories; if(bSupportsCategories) { - if( aData.AxisType != AxisType::CATEGORY && aData.AxisType != AxisType::DATE ) + + Reference< XChartType > xChartType( getChartTypeForNewSeries(Sequence< Reference< XChartType > >() )); + bool bSupportsDates = ::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, 2, nDimensionX ); + if( aData.AxisType != AxisType::CATEGORY && ( aData.AxisType != AxisType::DATE || !bSupportsDates) ) { aData.AxisType = AxisType::CATEGORY; aData.AutoDateAxis = true; |