diff options
Diffstat (limited to 'chart2/source/view/charttypes/CategoryPositionHelper.cxx')
-rw-r--r-- | chart2/source/view/charttypes/CategoryPositionHelper.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.cxx b/chart2/source/view/charttypes/CategoryPositionHelper.cxx index d43fd0856e02..76f07168bdf2 100644 --- a/chart2/source/view/charttypes/CategoryPositionHelper.cxx +++ b/chart2/source/view/charttypes/CategoryPositionHelper.cxx @@ -57,7 +57,7 @@ CategoryPositionHelper::~CategoryPositionHelper() { } -double CategoryPositionHelper::getSlotWidth() const +double CategoryPositionHelper::getScaledSlotWidth() const { double fWidth = m_fCategoryWidth / ( m_fSeriesCount @@ -66,14 +66,14 @@ double CategoryPositionHelper::getSlotWidth() const return fWidth; } -double CategoryPositionHelper::getSlotPos( double fCategoryX, double fSeriesNumber ) const +double CategoryPositionHelper::getScaledSlotPos( double fScaledXPos, double fSeriesNumber ) const { //the returned position is in the middle of the rect //fSeriesNumber 0...n-1 - double fPos = fCategoryX - (m_fCategoryWidth/2.0) - + (m_fOuterDistance/2.0 + fSeriesNumber*(1.0+m_fInnerDistance)) * getSlotWidth() - + getSlotWidth()/2.0; - + double fPos = fScaledXPos + - (m_fCategoryWidth/2.0) + + (m_fOuterDistance/2.0 + fSeriesNumber*(1.0+m_fInnerDistance)) * getScaledSlotWidth() + + getScaledSlotWidth()/2.0; return fPos; } @@ -95,6 +95,11 @@ void CategoryPositionHelper::setOuterDistance( double fOuterDistance ) m_fOuterDistance = fOuterDistance; } +void CategoryPositionHelper::setCategoryWidth( double fCategoryWidth ) +{ + m_fCategoryWidth = fCategoryWidth; +} + //............................................................................. } //namespace chart //............................................................................. |