Map 0 from Axes.Left to 0 from Axes.Right

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Re: Map 0 from Axes.Left to 0 from Axes.Right

Post by Neelam » Wed Sep 15, 2010 7:48 pm

Can you explain why we need variable axisSize?
And in code line 'tChart1.Axes.Right.EndPosition = zeroPos - 38' what is 38?

Thanks.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Map 0 from Axes.Left to 0 from Axes.Right

Post by Sandra » Thu Sep 16, 2010 9:57 am

Hello Neelam,
Can you explain why we need variable axisSize?
Sorry, I forgot remove it.
And in code line 'tChart1.Axes.Right.EndPosition = zeroPos - 38' what is 38?
It is 38 because it depends the number of values there are in the axes right and I have adapted this value for your code. It must be to adjust 0 of axis Right, with 0 of axis Left, because always there are a few pixels of difference. Would be appropriate; find a property works as this constant but for the moment I haven't found any.

Thanks,
Best Regards,
Sandra Pazos / 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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Re: Map 0 from Axes.Left to 0 from Axes.Right

Post by Neelam » Tue Sep 21, 2010 2:48 pm

It does not work for me. If bar values changes or we have to set Offset property ( to show labels inside chart) 0 Position way out of right position. If you max the screen, 0 on right axis jumps out. You should create property to adjust position to 0 position and introduce it in new release.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Map 0 from Axes.Left to 0 from Axes.Right

Post by Sandra » Wed Sep 22, 2010 9:46 am

Hello Neelam,

I have added your request in the bug list with number [TF02015166]. We will try to fix it for next maintenance releases of TeeChart.Net

Thanks,
Best Regards,
Sandra Pazos / 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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Map 0 from Axes.Left to 0 from Axes.Right

Post by Sandra » Thu Sep 23, 2010 9:49 am

Hello Neelman,

I have informed you that this bug (TF02015166) is not a bug. Because, Axis.StartPosition and Axis.EndPosition are not absolute values when Axis.StartEndPositionUnits=Pixels but that Axis.CalcPosValue() does return an absolute value. StartPosition is zero even when Axis.StartEndPositionUnits=Pixels. This means that the absolute position of the start of the axis, IStartPos, has to be subtracted from zeroPos. Following code works fine:

Code: Select all

private Steema.TeeChart.Styles.Line line1, line2;
   private void InitializeChart()
   {

     tChart1.Aspect.View3D = false;
     line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
     line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);

     line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left;
     line2.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;

     for (int i = 0; i < 10; i++)
     {
       line1.Add(i, i - 5);
       line2.Add(i, i);
     }
     tChart1.Draw();
     tChart1.Axes.Right.StartEndPositionUnits = Steema.TeeChart.PositionUnits.Pixels;
     int zeroPos = tChart1.Axes.Left.CalcPosValue(0.0);
     tChart1.Axes.Right.EndPosition = zeroPos - tChart1.Axes.Right.IStartPos;
   }
I hope will helps.

Thanks,

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Re: Map 0 from Axes.Left to 0 from Axes.Right

Post by Neelam » Mon Sep 27, 2010 1:29 pm

Thank you so much. Now it's working perfectly.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Map 0 from Axes.Left to 0 from Axes.Right

Post by Sandra » Mon Sep 27, 2010 3:02 pm

Hello Neelman,

I am glad that solution works fine for you :).

Thanks,
Best Regards,
Sandra Pazos / 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