Put axis label above left axis?

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Put axis label above left axis?

Post by znakeeye » Tue Mar 26, 2013 9:53 pm

It's possible to put a (vertically centered) title on the left axis. It's also possible to add a label placed to the left, at the maximum value.

I want to place a label/title above the axis. Actually, I have an arrow at the top of the axis and I would like to put the label above that.
axis.png
axis.png (962 Bytes) Viewed 4262 times

Yeray
Site Admin
Site Admin
Posts: 8737
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Put axis label above left axis?

Post by Yeray » Wed Mar 27, 2013 12:34 pm

Hi,

You could use an Annotation tool for it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Re: Put axis label above left axis?

Post by znakeeye » Sun Jun 23, 2013 3:37 pm

Thanks. But how do I position it at that exact location? At the time I instantiate my axis/arrow, they have no coordinates set!

Yeray
Site Admin
Site Admin
Posts: 8737
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Put axis label above left axis?

Post by Yeray » Wed Jun 26, 2013 9:26 am

Hi,

You need the chart to be drawn at least once to retrieve getChartRect or the axis position.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Re: Put axis label above left axis?

Post by znakeeye » Wed Jun 26, 2013 11:46 am

There is no event or similar that I can hook into to position the label? Or should I simply call setAutoRepaint(true) and refreshControl() and then position the label?

Yeray
Site Admin
Site Admin
Posts: 8737
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Put axis label above left axis?

Post by Yeray » Wed Jun 26, 2013 12:05 pm

Hi,

I'm not sure it will work. In cases like this I remember to end up setting it at the chartPaint event, using some boolean to make sure I'm not creating and endless loop.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Re: Put axis label above left axis?

Post by znakeeye » Sat Jun 29, 2013 8:52 am

Thanks. I have a feeling it won't work, like you say. I believe I tried this in the past.

One problem is that I'd like my label to push down the axis from the top, so that it does indeed fit. This happens automatically when an axis label is present. In that case the entire axis is pushed to the right.

May the best approach is to modify the source code to get this desired feature?

Yeray
Site Admin
Site Admin
Posts: 8737
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Put axis label above left axis?

Post by Yeray » Tue Jul 02, 2013 11:38 am

Hi,

Of course modifying the sources can be more accurate if you are always going to have this label on top of your axis.
Alternatively, if the axis will always have the same position, you can just find the appropriate Top and Left values to set for the Annotation tool and set them at the startup. In this option, you'll probably have to add some Top and/or Left Margins to the chart panel to leave some space for the Annotation.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply