Adjusting start position of axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Adjusting start position of axis

Post by lilo » Sun Nov 14, 2010 9:42 am

I need to adjust the aspect ratio of the points chart. If I set the Left and right axis start position to 25%

Points1.Chart.Axes.Left.StartPosition = 25
Points1.Chart.Axes.Right.StartEndPositionUnits = Steema.TeeChart.PositionUnits.Percent
Points1.Chart.Axes.Right.StartPosition = 25

The Left and Right Axis plot correctly, but if I add the top axis, it does not plot in the correct position

Points1.Chart.Axes.Right.Visible = True
Points1.Chart.Axes.Bottom.Visible = True
Points1.Chart.Axes.Left.Visible = True
Points1.Chart.Axes.Top.Visible = True

See picture
Points1.jpg
Points1.jpg (49.1 KiB) Viewed 6792 times

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

Re: Adjusting start position of axis

Post by Sandra » Mon Nov 15, 2010 11:03 am

Hello lilo,

I suggest you, use property of Axes RelativePosition for change position of Top axis, as do in next example:

Code: Select all

private void InitializeChart()
        {

            tChart1.Aspect.View3D = false;
            tChart1.Dock = DockStyle.Fill;
            for (int i = 0; i < 5; i++)
            {
                Steema.TeeChart.Styles.Points series1 = new Steema.TeeChart.Styles.Points(tChart1.Chart);
                series1.FillSampleValues(10);
                series1.Pointer.HorizSize = 7;
                series1.Pointer.VertSize = 7;
                if (i < 2)
                {

                    series1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
                    series1.HorizAxis = Steema.TeeChart.Styles.HorizontalAxis.Top;
                }
                
            }
            
            tChart1.Axes.Left.StartPosition = 25;
            tChart1.Axes.Right.StartEndPositionUnits = Steema.TeeChart.PositionUnits.Percent;
            tChart1.Axes.Right.StartPosition = 25;
            tChart1.Axes.Top.RelativePosition = 25;
          
}
Could you tell us, if previous code works fine for you?

I hope will helps.

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

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Adjusting start position of axis

Post by lilo » Mon Nov 15, 2010 8:22 pm

This works OK, but a new problem is introduced. The labels on the top axis are not positioned correctly. See picture.
Points2.jpg
Points2.jpg (63.19 KiB) Viewed 6791 times

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

Re: Adjusting start position of axis

Post by Sandra » Tue Nov 16, 2010 12:11 pm

Hello lilo,

I couldn't reproduce your problem using last version of TeeChart.Net. I have got next image where axes labels see correctly:
Chart1.jpg
Chart1.jpg (51.93 KiB) Viewed 6756 times
Please, you could send us a simple project so we can reproduce your problem here? Also, can you say us what number of build of version 4 are you using now?

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