diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-03-11 12:08:58 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-23 02:55:28 +0100 |
commit | 68e482e9d8e29944a00fb53959f2e728e78a9782 (patch) | |
tree | 24fd2820dc36fa2d0f8e3e182599ffd85e03c4a9 /chart2/source/view | |
parent | 3bb87d7c5f0c1ad75f138d9d641963497da822e0 (diff) |
Create respective error bars in areachart when creating shapes.
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/charttypes/AreaChart.cxx | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 8aaaf23365f8..2c2e8276522c 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -836,7 +836,7 @@ void AreaChart::createShapes() if( !bIsVisible ) continue; - bool bCreateErrorBar = false; + bool bCreateYErrorBar = false, bCreateXErrorBar = false; { uno::Reference< beans::XPropertySet > xErrorBarProp(pSeries->getYErrorBarProperties(nIndex)); if( xErrorBarProp.is() ) @@ -845,14 +845,25 @@ void AreaChart::createShapes() bool bShowNegative = false; xErrorBarProp->getPropertyValue( C2U( "ShowPositiveError" )) >>= bShowPositive; xErrorBarProp->getPropertyValue( C2U( "ShowNegativeError" )) >>= bShowNegative; - bCreateErrorBar = bShowPositive || bShowNegative; + bCreateYErrorBar = bShowPositive || bShowNegative; + } + + xErrorBarProp = pSeries->getXErrorBarProperties(nIndex); + if ( xErrorBarProp.is() ) + { + bool bShowPositive = false; + bool bShowNegative = false; + xErrorBarProp->getPropertyValue( C2U( "ShowPositiveError" )) >>= bShowPositive; + xErrorBarProp->getPropertyValue( C2U( "ShowNegativeError" )) >>= bShowNegative; + bCreateXErrorBar = bShowPositive || bShowNegative; } } Symbol* pSymbolProperties = m_bSymbol ? (*aSeriesIter)->getSymbolProperties( nIndex ) : 0; bool bCreateSymbol = pSymbolProperties && (pSymbolProperties->Style != SymbolStyle_NONE); - if( !bCreateSymbol && !bCreateErrorBar && !pSeries->getDataPointLabelIfLabel(nIndex) ) + if( !bCreateSymbol && !bCreateYErrorBar && + !bCreateXErrorBar && !pSeries->getDataPointLabelIfLabel(nIndex) ) continue; //create a group shape for this point and add to the series shape: @@ -899,8 +910,12 @@ void AreaChart::createShapes() } } } - //create error bar - createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nIndex, m_xErrorBarTarget ); + //create error bars + if (bCreateXErrorBar) + createErrorBar_X( aUnscaledLogicPosition, **aSeriesIter, nIndex, m_xErrorBarTarget ); + + if (bCreateYErrorBar) + createErrorBar_Y( aUnscaledLogicPosition, **aSeriesIter, nIndex, m_xErrorBarTarget ); //create data point label if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) ) |