problem of shiffted axes synchronizing two charts

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Feb 04, 2008 12:24 pm

Hi Anne-Lise,

Sorry, I think the newsgroups only admit files up to 1M and the upload page had some problems. Could you please try it again?

http://www.steema.net/upload/

Thanks in advance
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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Mon Feb 04, 2008 1:10 pm

I think this time it is Ok, you can get my prototype code in a .zip file on the news server.
Thanks a lot,
Anne-Lise

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Mon Feb 04, 2008 1:39 pm

I think this time it is Ok, you can get my prototype code in a .zip file on the news server.
Thanks a lot,
Anne-Lise

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

Post by Narcís » Mon Feb 04, 2008 2:51 pm

Hi Anne-Lise,

Thanks for the project. I could finally reproduce the issue here. This mostly happens because the 2 charts don't have the same height and some times same left axis increment can't be fitted for both charts. The solution is doing something as what Marjan suggested here.

Regarding custom drawing on TeeChart, you should do that in the AfterDraw event, for example:

Code: Select all

			private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
			{
				g.Rectangle(new Rectangle(5, 5, 5, 5));
				g.TextOut(10, 10, "chart1");
			}
An easier option to achieve what you request may be using Annotation tools.
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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Wed Feb 06, 2008 8:59 am

Hi Narcis,

Thank you for your support.

1-We still had an exception on g.Textout in our application as we had 2 functions plugged on the chart.AfterDraw event, and we didn't really undersatnd why this genereated an exception...We solved it by plugging one of those function on the chart.Resize event. So now we have the version for visual 2005 and it works.

2-For the axes shiffting problem, with this version we still have it.
That seems to be true that in my prototype when the 2 charts have the same height I can't reproduce the bug, but I don't understand we the chart heingt influe on the left position axes...
Althought in our application we have charts having the same height and we sill have the shiffted axes problem. Debugging or logging values we see that the Chart.Panel.LeftMargin are the same, but on the screen we have a shifft...
I can't reproduce it in a prototype for the moment...perhaps later.

Thanks,
Anne-Lise

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

Post by Narcís » Wed Feb 06, 2008 9:26 am

Hi Anne-Lise,
1-We still had an exception on g.Textout in our application as we had 2 functions plugged on the chart.AfterDraw event, and we didn't really undersatnd why this genereated an exception...We solved it by plugging one of those function on the chart.Resize event. So now we have the version for visual 2005 and it works.
How can we reproduce this issue here?

2-For the axes shiffting problem, with this version we still have it.
That seems to be true that in my prototype when the 2 charts have the same height I can't reproduce the bug, but I don't understand we the chart heingt influe on the left position axes...
Althought in our application we have charts having the same height and we sill have the shiffted axes problem. Debugging or logging values we see that the Chart.Panel.LeftMargin are the same, but on the screen we have a shifft...
I can't reproduce it in a prototype for the moment...perhaps later.


This is not a TeeChart bug. What happens is that, by default, axes set their scales (min. and max. values and increment) automatically and try to fit in as many labels as possible provided they don't overlap. Since both charts have different height, their left axis length is difference and therefore same number of labels can't be displayed on them. So, under some circumstances and as an example, one chart may have integer labels (0, 1, 2, 3, ...) and the other one can have decimal labels (0, 0.5, 1, 1.5, 2, 2.5, ...) this makes second chart labels being longer and left axis being drawn more to the right than the other chart. Hope my explanation is clear now.
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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Wed Feb 06, 2008 10:49 am

Narcis,

I understand what you mean, but in some case we have exactly the same precision / values on left axes labels, and axes are shiffted...

Anne-Lise

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

Post by Narcís » Wed Feb 06, 2008 10:56 am

Hi Anne-Lise,

Ok, have you tried applying the solution Marjan suggested in the forums thread I pointed?

Thanks in advance.
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

Post Reply