|
Position of axis title TextBox |
Posted by Stephan Bielmann on Jun-27-2014 22:20 |
|
Hello all,
is there a way to get the leftX and topY of the axis title its TextBox?
Actually I tried to Axis::setTitle() before and after Chart::layout(),
but in both cases I get 0 for both coordinates.
My goal is to paint something beneath the axis title.
Thanks for any help. |
Re: Position of axis title TextBox |
Posted by Peter Kwan on Jun-28-2014 01:11 |
|
Hi Stephan,
Although there is no method to get the bounding box of the built-in axis title, you may
simply add a custom text box as the axis title. For example:
//layout axis first so that we know its thickness
c->layoutAxes();
//put the title under the axis and center aligned to the axis.
TextBox *t = c->addText(c->getPlotArea()->getLeftX() + c->getPlotArea()->getWidth() /
2, c->getPlotArea()->getBottomY() + c->xAxis()->getThickness(), "My Title", "arialbd.ttf",
10);
You may use the methods of the above TextBox object to determine its bounding box.
Hope this can help.
Regards
Peter Kwan |
Re: Position of axis title TextBox |
Posted by Stephan Bielmann on Jun-30-2014 15:25 |
|
Hello Peter,
thank your for the hint, works perfectly like that.
Regards, Stephan |
|