From ead6136ba9a5eff7df2c7f094e8fc4d3f5d2428f Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sat, 24 May 2014 15:35:30 +0200 Subject: add text on both sides of the chart Change-Id: I12d5f5e92bf908bc6d8fbd0e88293e1fcaa31c96 --- chart2/source/view/charttypes/GL3DBarChart.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'chart2') diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 6d0b6d780e1c..7a3d3111bc97 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -190,6 +190,18 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector& rDataSer aBottomRight.x = nXPos; aBottomRight.y = nYPos + 0.5 * nBarDistanceY; p->setPosition(aTopLeft, aTopRight, aBottomRight); + + // create shapes on other side as well + + maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aCats[i], nId++)); + p = static_cast(&maShapes.back()); + aTopLeft.x = nXPos + TEXT_HEIGHT; + aTopLeft.y = - 0.5 * nBarDistanceY; + aTopRight = aTopLeft; + aTopRight.y = -calculateTextWidth(aCats[i]) - 0.5* nBarDistanceY; + aBottomRight.x = nXPos; + aBottomRight.y = -calculateTextWidth(aCats[i]) - 0.5 * nBarDistanceY; + p->setPosition(aTopLeft, aTopRight, aBottomRight); } } -- cgit