Changing position of Axis Labels

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MCM
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Changing position of Axis Labels

Post by MCM » Fri Jan 23, 2004 8:52 pm

I'm trying to modify the behaviour of the chart axis label drawing and having a lot of problems getting the required result.

I'm using the OnGetAxisLabel event to convert the chart's internal x value to a label which is meaningful to my program. This is working fine, but the problem is I want to see the labels at positions other than where they are currently.
I can adjust the increment to give me the right separation, but can't see how to control their position.
I suppose the behaviour I want is similar to what is done when RoundFirstLabel = FALSE, except that instead of using the Maximum Axis value for the label position, I want to set my own value.

I'm using TeeChart Pro 5 VCL version v5.01
Thanks.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Re: Changing position of Axis Labels

Post by Marjan » Tue Jan 27, 2004 4:47 pm

5889539 wrote:I'm using the OnGetAxisLabel event to convert the chart's internal x value to a label which is meaningful to my program. This is working fine, but the problem is I want to see the labels at positions other than where they are currently.
I can adjust the increment to give me the right separation, but can't see how to control their position.
I suppose the behaviour I want is similar to what is done when RoundFirstLabel = FALSE, except that instead of using the Maximum Axis value for the label position, I want to set my own value.
In Teechart v5 you might have some problems with this task. In older TeeChart version(s) it's a bit difficult to control individual axis label position, label text (or value). Your approach seems correct, but it's not so flexible. In your case the only alternative is to avoid using default axis labels. Instead, in chart OnAfterDraw event, manually draw required labels (text) directly on chart Canvas by using it's TextOut method.
Alternatively you can also upgrade to TeeChart v6 and use it's custom label feature to fully customize individual axis label text, value (position) and general appearance. There is an example of this feature available in Teechart v6 demo.
Marjan Slatinek,
http://www.steema.com

MCM
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by MCM » Tue Jan 27, 2004 5:50 pm

Thanks Marjan.

I'll have to review the different options.

I know this is probably posted somewhere on the site, but I'll ask anyway. Are there any known problems with upgrading from v5 to v6 that I should be aware of or changes in events, etc.? I do a lot of overriding of the default behaviour and am trying to gauge how much recoding I'm likely to need if we do upgrade.

Again I suspect this is in a list somewhere, but does v6 allow the editor to be selectively enabled? I'd like to be able to shut down a lot of the user I/F and perhaps add some additional editing of my own? Is this possible?

Thanks for the continued good support.

Darren

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Feb 10, 2004 1:28 pm

Hi.
Are there any known problems with upgrading from v5 to v6 that I should be aware of or changes in events
Nothing major. Some new published properties and some changed default values for properties. Nothing one can't fix with opening&saving forms with TC 6 installed.
but does v6 allow the editor to be selectively
In TeeChart v6 rditor customization has been grewatly improved. But all options are not fully customizable. Perhaps you could try to download Teechart v6 demo (exe) and check all the new features before deciding on upgrade. A demo with sources is available on our web site.
Marjan Slatinek,
http://www.steema.com

MCM
Newbie
Newbie
Posts: 4
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Post by MCM » Mon Mar 01, 2004 10:04 pm

Thanks for the info.
I'm just downloading V6 now.
I'll let you know how I get on with the Axis labelling.

Re: The editor, I've found that for our users, the Chart Control's editor is much too complex, and also doesn't allow them to setup a useful schema which can be applied to lots of different charts. So I've bitten the bullet and rolled my own editor with just what relevant.
It may still be useful to be able to disable some of the Chart editor's functionality to allow further fine-tuning of the charts after they're created.

Post Reply