diff options
-rw-r--r-- | chart2/source/view/axes/DateHelper.cxx | 3 | ||||
-rw-r--r-- | chart2/source/view/charttypes/AreaChart.cxx | 5 | ||||
-rw-r--r-- | chart2/source/view/charttypes/VSeriesPlotter.cxx | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/chart2/source/view/axes/DateHelper.cxx b/chart2/source/view/axes/DateHelper.cxx index 046760436acd..dfe772e45f66 100644 --- a/chart2/source/view/axes/DateHelper.cxx +++ b/chart2/source/view/axes/DateHelper.cxx @@ -69,6 +69,9 @@ bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 ) double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution ) { + if (rtl::math::isNan(fValue)) + return fValue; + Date aDate(rNullDate); aDate.AddDays(::rtl::math::approxFloor(fValue)); switch(TimeResolution) { diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 02ea81e98232..cba08e0bd007 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -722,7 +722,12 @@ void AreaChart::createShapes() //collect data point information (logic coordinates, style ): double fLogicX = pSeries->getXValue(nIndex); if (bDateCategory) + { + if (rtl::math::isNan(fLogicX)) + continue; + fLogicX = DateHelper::RasterizeDateValue( fLogicX, m_aNullDate, m_nTimeResolution ); + } double fLogicY = pSeries->getYValue(nIndex); if( m_nDimension==3 && m_bArea && rXSlot.m_aSeriesVector.size()!=1 ) diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index b61a195bec97..27f57980f4be 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -1463,10 +1463,17 @@ long VSeriesPlotter::calculateTimeResolutionOnXAxis() if( !rDateCategories.empty() ) { std::vector< double >::const_iterator aIt = rDateCategories.begin(), aEnd = rDateCategories.end(); + while (rtl::math::isNan(*aIt) && aIt != aEnd) + { + ++aIt; + } Date aPrevious(aNullDate); aPrevious.AddDays(rtl::math::approxFloor(*aIt)); ++aIt; for(;aIt!=aEnd;++aIt) { + if (rtl::math::isNan(*aIt)) + continue; + Date aCurrent(aNullDate); aCurrent.AddDays(rtl::math::approxFloor(*aIt)); if( nRet == css::chart::TimeUnit::YEAR ) { |