Find axes position relative to panel

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
investsoft
Newbie
Newbie
Posts: 5
Joined: Mon Mar 05, 2012 12:00 am

Find axes position relative to panel

Post by investsoft » Wed Mar 28, 2012 3:42 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Find axes position relative to panel

Post by Narcís » Thu Mar 29, 2012 12:49 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

investsoft
Newbie
Newbie
Posts: 5
Joined: Mon Mar 05, 2012 12:00 am

Re: Find axes position relative to panel

Post by investsoft » Mon Apr 02, 2012 6:37 am

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

Post Reply