Page 1 of 1

Find axes position relative to panel

Posted: Wed Mar 28, 2012 3:42 pm
by 17061873
Hi,
I am developing a chart for an Android app.
I am trying to find the axes positions relative to the panel in order to position a view on top of the chart in the top corner.
The only thing I found that is relative to the actual chart area (not including labels) is:

Code: Select all

chart.getGraphics3D().getXCenter();
That gives the number of pixels from the edge of the screen to the middle point between left and right axes, but there is no getXLeft() or getXRight or even getXWidth().
I am using a very simple chart with only back wall and labels on right and bottom axes.
Any help will be much appreciated.
Thanks,
Meir, InvestSoft

Re: Find axes position relative to panel

Posted: Thu Mar 29, 2012 12:49 pm
by narcis
Hi Meir,

There's ChartRect which defines the chart drawing area, the area delimited by chart axes, for example:

Code: Select all

        Rectangle rect = tChart1.getChart().getChartRect();
Please bear in mind that you'll need to retrieve that after the chart has been drawn as it needs the chart being plotted to be calculated. You'll also fine more information on getting axes boundaries and drawing events in tutorial 10. Custom drawing on the Chart Panel. Tutorials can be found at the Docs folder included with TeeChart installation.

Hope this helps.

Re: Find axes position relative to panel

Posted: Mon Apr 02, 2012 6:37 am
by 17061873
Please bear in mind that you'll need to retrieve that after the chart has been drawn as it needs the chart being plotted to be calculated.
That's what I was missing.
Thanks