Setting Minimum and Maximum Values

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
lilo
Newbie
Newbie
Posts: 62
Joined: Wed Sep 07, 2011 12:00 am

Setting Minimum and Maximum Values

Post by lilo » Wed Sep 14, 2011 8:31 am

Hi,

I am manually setting the minimum and maximum x and y scales for a point chart.
Points1.Chart.Axes.Right.AutomaticMaximum = False
Points1.Chart.Axes.Bottom.AutomaticMaximum = False
Points1.Chart.Axes.Left.AutomaticMaximum = False
Points1.Chart.Axes.Top.AutomaticMaximum = False
Points1.Chart.Axes.Right.AutomaticMinimum = False
Points1.Chart.Axes.Bottom.AutomaticMinimum = False
Points1.Chart.Axes.Left.AutomaticMinimum = False
Points1.Chart.Axes.Top.AutomaticMinimum = False
Points1.Chart.Axes.Top.Maximum = XMax
Points1.Chart.Axes.Top.Minimum = XMin
Points1.Chart.Axes.Left.Maximum = YMax
Points1.Chart.Axes.Left.Minimum = YMin
Points1.Chart.Axes.Right.Maximum = YMax
Points1.Chart.Axes.Right.Minimum = YMin

The chart calculates an offset for each axes. The result is offset x and y scales. Is there some way to overcome this?

I want the scale to plot exactly how I specify.

I did have this working previously, but something must have changed when I upgraded the tchart.

lilo
Newbie
Newbie
Posts: 62
Joined: Wed Sep 07, 2011 12:00 am

Re: Setting Minimum and Maximum Values

Post by lilo » Wed Sep 14, 2011 8:36 am

I have also tried setting the following values:

Points1.Chart.Axes.Bottom.MaximumOffset = 0
Points1.Chart.Axes.Bottom.MinimumOffset = 0
Points1.Chart.Axes.Top.MaximumOffset = 0
Points1.Chart.Axes.Top.MinimumOffset = 0
Points1.Chart.Axes.Left.MaximumOffset = 0
Points1.Chart.Axes.Left.MinimumOffset = 0
Points1.Chart.Axes.Right.MaximumOffset = 0
Points1.Chart.Axes.Right.MinimumOffset = 0

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

Re: Setting Minimum and Maximum Values

Post by Sandra » Wed Sep 14, 2011 9:53 am

Hello lilo,

I have made simple project to try to reproduce your problem, but it doesn't appear in it, so I can scale the axes how I want:

Code: Select all

 private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Series1 = new Points(tChart1.Chart);
            Series1.FillSampleValues();
            Series1.HorizAxis = HorizontalAxis.Both;
            Series1.VertAxis = VerticalAxis.Both;
                     
             tChart1.Axes.Bottom.Automatic=false;
             tChart1.Axes.Left.Automatic=false;
             tChart1.Axes.Top.Automatic = false;
             tChart1.Axes.Right.Automatic = false;


             tChart1.Axes.Bottom.Maximum = Series1.MaxXValue();
             tChart1.Axes.Bottom.Minimum = Series1.MinXValue();
             tChart1.Axes.Left.Maximum= Series1.MaxYValue();
             tChart1.Axes.Left.Minimum = Series1.MinYValue();

             tChart1.Axes.Top.Maximum = Series1.MaxXValue();
             tChart1.Axes.Top.Minimum = Series1.MinXValue();
             tChart1.Axes.Right.Maximum = Series1.MaxYValue();
             tChart1.Axes.Right.Minimum = Series1.MinYValue();

        }
Can you please, tell us if previous code works as you want? If it doesn't work as you want, explain us exactly which is the problem.

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: 62
Joined: Wed Sep 07, 2011 12:00 am

Re: Setting Minimum and Maximum Values

Post by lilo » Wed Sep 14, 2011 10:21 am

I am able to fix the problem by setting:
Points1.Chart.Axes.Bottom.Labels.RoundFirstLabel = True
Points1.Chart.Axes.Right.Labels.RoundFirstLabel = True
Points1.Chart.Axes.Left.Labels.RoundFirstLabel = True
Points1.Chart.Axes.Top.Labels.RoundFirstLabel = True

I will try your code later.

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

Re: Setting Minimum and Maximum Values

Post by Sandra » Wed Sep 14, 2011 11:05 am

Hello lilo,

I am glad that you can find a solution for your problem.

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