Min-max labels of custom vertical axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
asupriya
Advanced
Posts: 179
Joined: Mon Dec 01, 2008 12:00 am

Min-max labels of custom vertical axis

Post by asupriya » Sun Nov 20, 2011 4:47 pm

I need to always display min-max values of custom Y-axis to a nearest rounded value. How can I do it?

Any help will be appreciated.

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

Re: Min-max labels of custom vertical axis

Post by Sandra » Mon Nov 21, 2011 3:01 pm

Hello asupriya,

You can use a methods of Math class to around the min and max values. You can do something as next code:

Code: Select all

Steema.TeeChart.Styles.Line line1 = new Line(tChart1.Chart);
            Steema.TeeChart.Axis axis1 = new Steema.TeeChart.Axis(tChart1.Chart);
            tChart1.Axes.Custom.Add(axis1);
            
            line1.FillSampleValues(100);
            line1.CustomVertAxis = axis1;
            tChart1.Panel.MarginLeft = 10;
            double max, min, max1,min1; 
            max= 100.5559; 
            min = 0.55559;
            max1 = Math.Round(max);
            min1 = Math.Round(min);
            axis1.SetMinMax(min1, max1); 
Can you tell us, if this solution allow you do as you want?

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

asupriya
Advanced
Posts: 179
Joined: Mon Dec 01, 2008 12:00 am

Re: Min-max labels of custom vertical axis

Post by asupriya » Mon Nov 21, 2011 5:45 pm

Sandra,

Thanks for the reply. However, what I needed to know was about the labels of custom vertical axis. I successfully set the SetMinMax, but the labels on the min and max values of custom-axis are not being displayed. I need to have labels displayed on the min, max values.

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

Re: Min-max labels of custom vertical axis

Post by Sandra » Tue Nov 22, 2011 11:11 am

Hello asupriya,

Ok. I think can help you use Minimum and Maximum offset as do in next simple example:

Code: Select all

        private void InitializeChart()
        {

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

            Random rnd = new Random();
            for (int i = 0; i < 10; i++)
            {
                line1.Add(i, rnd.Next(20));
            } 

            Steema.TeeChart.Axis axis1 = new Steema.TeeChart.Axis(tChart1.Chart);
            tChart1.Axes.Custom.Add(axis1);
            line1.CustomVertAxis = axis1;
            axis1.SetMinMax(1, 15);
            axis1.MaximumOffset = 15;
            axis1.MinimumOffset= 1;
            axis1.AxisPen.Color = Color.Red;
        }
Can you tell us if previous serve you to achieves as you want?

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

Post Reply