Custom Vertical Axis changes .Minimum when FastLine.Add(X,Y)

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Custom Vertical Axis changes .Minimum when FastLine.Add(X,Y)

Post by tirby » Mon Jan 07, 2013 8:37 pm

Hi,

I'm having no luck solving this by myself, I'm hoping someone can help!

The problem occurs after setting up the grid and setting scaling of the custom Vertical axis 0 to 100.

Then using a pushbutton- FastL(0).Add(111458, 30.2);

Some code fragments I'm using:

Code: Select all

public static Steema.TeeChart.Styles.FastLine[] FastL = new Steema.TeeChart.Styles.FastLine[128];

FastL[Index] = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);

I have a small test project to demonstrate the problem that I can upload for reference.

Thanks!

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

Re: Custom Vertical Axis changes .Minimum when FastLine.Add(X,Y)

Post by Sandra » Tue Jan 08, 2013 11:42 am

Hello Tirby,

Using last version Build 4.1.2012.09283 and next code the mínim custom vertical axis isn't change for me:

Code: Select all

   public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Axis axis1;
        Random rnd = new Random();
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            //Custom Vertical Axis
            axis1 = new Steema.TeeChart.Axis(tChart1.Chart);
            tChart1.Axes.Custom.Add(axis1);
            axis1.Horizontal = false;
            axis1.StartPosition = 0;
            axis1.EndPosition = 48;
            axis1.AxisPen.Color = Color.Red;
            axis1.SetMinMax(0, 100);
            //Left Axis. 
            tChart1.Axes.Left.StartPosition = 50;
            tChart1.Axes.Left.EndPosition = 100;
            tChart1.Axes.Left.SetMinMax(0, 100);

            for (int i = 0; i < 128; i++)
            {
                new FastLine(tChart1.Chart);
                for (int j = 100000; j < 111458; j = j + 100)
                {
                    tChart1[i].Add(j, rnd.Next(100));
                }
                if (i % 2 == 0)
                {
                    tChart1[i].CustomVertAxis = axis1;
                }
                else
                {
                    tChart1[i].VertAxis = VerticalAxis.Left;
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
               tChart1[0].Add(111458, 30.2);
          
        }
Could you tell us if previous code works for you? If previous code doesn't behave as you want, please could you send us your project because we can reproduce your problem and try to suggest you a good solution 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

tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Re: Custom Vertical Axis changes .Minimum when FastLine.Add(X,Y)

Post by tirby » Tue Jan 08, 2013 3:13 pm

Sandra,

Thanks for looking at this, I'll try the code.

The version I'm running is the latest available from the Customer Download section.
My version is 3.5.3700.30575

tirby
Newbie
Newbie
Posts: 84
Joined: Mon Mar 16, 2009 12:00 am

Re: Custom Vertical Axis changes .Minimum when FastLine.Add(X,Y)

Post by tirby » Wed Jan 09, 2013 2:37 am

Sandra,

Using your example, I was able to modify my program and correct the problem.
I think it was probably the way I was doing things.

Thanks for getting me on the right track!

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

Re: Custom Vertical Axis changes .Minimum when FastLine.Add(X,Y)

Post by Sandra » Wed Jan 09, 2013 12:28 pm

Hello Tirby,

I am glad my solution help you :D.


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