Sync Axis Position between two Charts

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ibsd
Newbie
Newbie
Posts: 5
Joined: Wed Feb 12, 2014 12:00 am

Sync Axis Position between two Charts

Post by ibsd » Tue Aug 26, 2014 8:58 am

Hello

i'm using two Charts and i want to have the right Y-Axis of the Charts on the same X-Position.
The right Y-Axis in the upper Chart is an costum axis, in the lower chart it's the default right axis.
It also could be inverted (upper Chart is default axis and lower Chart is custom axis)

To make it more easier i have uploaded two pictures, the first one is what i have until now.
The secound one is what i want to have (edited with Paint).
Trend_small.png
Trend_small.png (26.09 KiB) Viewed 5417 times
Trend_want_to_have_small.png
Trend_want_to_have_small.png (27.79 KiB) Viewed 5409 times
I tryed to use the Chart.Panel.MarginRight Propertie but that doesn't work for me because the legend moves too when it was set.
Can someone help me to achieve this goal?

Best regards

Franz

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

Re: Sync Axis Position between two Charts

Post by Narcís » Tue Aug 26, 2014 10:17 am

Hi Franz,

Custom axes don't calculate margins automatically. You can either set desired margin manually or for a more dynamic solution implement something as the PlaceAxes method Sandra posted here. Also, for the margin between the chart and the legend you can use tChart1.Legend.HorizMargin property.

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

ibsd
Newbie
Newbie
Posts: 5
Joined: Wed Feb 12, 2014 12:00 am

Re: Sync Axis Position between two Charts

Post by ibsd » Tue Aug 26, 2014 3:22 pm

Hi Narcís,

thank you for your help.

I set the Chart.Legend.HorizMargin in the Chart.BeforeDraw-Event and it works very well.

Post Reply