problem of shiffted axes synchronizing two charts

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

problem of shiffted axes synchronizing two charts

Post by annelise » Thu Jan 31, 2008 10:37 am

Hi,

I have a problem with the TeeChart component, I reproduced it in a simple prototype (see code joined).
I have two TeeCharts I want to synchronize in term of scaling.
When I zoom / unzoom in one of them, I apply the same zoom to the other one,

For this I call
{
tChart1.Axes.Left.SetMinMax(tChart2.Axes.Left.Minimum, tChart2.Axes.Left.Maximum);
tChart1.Axes.Bottom.SetMinMax(tChart2.Axes.Bottom.Minimum, tChart2.Axes.Bottom.Maximum);
}
In functions linked to TChart.zoomed event.

In general it works, but in some cases after a zoom, the left axes of my two charts are shifted. The scales are correctly synchronized, but the positions where left axes are displayed are not exactly the same.
Could you tell me if it is a known problem and how to solve it.

Thanks a lot,

Anne-Lise


//here is my code
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
for(int index=1;index<1000;index++)
{

fastLine1.Add(0.0001*index,0.0001*index);
fastLine2.Add(0.0001 * index,0.0001*index);
}
}

private void tChart1_Zoomed(object sender, EventArgs e)
{
Synchronize(tChart1);
}

private void Synchronize(Steema.TeeChart.TChart chart)
{
Bitmap bmp = chart.Bitmap;
if(chart==tChart1)
{
tChart2.Axes.Left.SetMinMax(tChart1.Axes.Left.Minimum, tChart1.Axes.Left.Maximum);
tChart2.Axes.Bottom.SetMinMax(tChart1.Axes.Bottom.Minimum, tChart1.Axes.Bottom.Maximum);
}
else
{
tChart1.Axes.Left.SetMinMax(tChart2.Axes.Left.Minimum, tChart2.Axes.Left.Maximum);
tChart1.Axes.Bottom.SetMinMax(tChart2.Axes.Bottom.Minimum, tChart2.Axes.Bottom.Maximum);
}
}

private void tChart2_Zoomed(object sender, EventArgs e)
{
Synchronize(tChart2);
}


}

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 31, 2008 11:14 am

Hi Anne-Lise,
In general it works, but in some cases after a zoom, the left axes of my two charts are shifted. The scales are correctly synchronized, but the positions where left axes are displayed are not exactly the same.
Could you tell me if it is a known problem and how to solve it.
Could you please let us know the exact steps I should follow to reproduce the issue here?

Thanks in advance.
Best Regards,
Narcís Calvet / 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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Thu Jan 31, 2008 11:51 am

Hi Narcis,

The problem is not clearly reproducible, you can try to change the series by the following one:
for (int index = 1; index < 100; index++)
{

fastLine1.Add(index, index);
fastLine2.Add(index, index);
}
It seems more easy to reproduce it.

Make a lot of consecutive zoom, and you will have it.
I can send you a screen copy if you want.

Anne-Lise

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 31, 2008 11:59 am

Hi Anne-Lise,

Thanks for the information.

Code: Select all

I can send you a screen copy if you want. 
Yes please as can't reproduce the issue here. Which TeeChart version are you using?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / 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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Thu Jan 31, 2008 12:10 pm

Narcis,

I am using the 3.2.2894.29190 version.

Anne-Lise

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 31, 2008 12:18 pm

Hi Anne-Lise,

Can you please try to reproduce the issue using build 3.2.2945.19736/7/8?

Thanks in advance
Best Regards,
Narcís Calvet / 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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Thu Jan 31, 2008 3:36 pm

Narcis,

I try my prototype with the latest downloaded version:
3.2.2945.19736 (I install also the pluggin solving license problem when referncing dll using TeeChart in another dll...)

I reproduce the problem, zooming in one of the 2 chart 10 or more consecutive times.

Anne-Lise

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 31, 2008 6:14 pm

Hi Anne-Lise,

I'm still unable to reproduce the problem here using this code:

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
          InitializeComponent();
          InitializeChart();
        }

        private Steema.TeeChart.Styles.FastLine fastLine1;
        private Steema.TeeChart.Styles.FastLine fastLine2;

        private void InitializeChart()
        {
          fastLine1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
          fastLine2 = new Steema.TeeChart.Styles.FastLine(tChart2.Chart);

          for (int index = 1; index < 1000; index++)
          {
            fastLine1.Add(index, index);
            fastLine2.Add(index, index);
          }

          tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
          tChart2.Zoomed += new EventHandler(tChart2_Zoomed);

          tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
          tChart2.UndoneZoom += new EventHandler(tChart2_UndoneZoom);
        }

        void tChart2_UndoneZoom(object sender, EventArgs e)
        {
          Synchronize(tChart2);
        }

        void tChart1_UndoneZoom(object sender, EventArgs e)
        {
          Synchronize(tChart1);
        }

        private void tChart1_Zoomed(object sender, EventArgs e)
        {
          Synchronize(tChart1);
        }

        private void tChart2_Zoomed(object sender, EventArgs e)
        {
          Synchronize(tChart2);
        }

        private void Synchronize(Steema.TeeChart.TChart chart)
        {
          Bitmap bmp = chart.Bitmap;
          if (chart == tChart1)
          {
            tChart2.Axes.Left.SetMinMax(tChart1.Axes.Left.Minimum, tChart1.Axes.Left.Maximum);
            tChart2.Axes.Bottom.SetMinMax(tChart1.Axes.Bottom.Minimum, tChart1.Axes.Bottom.Maximum);
          }
          else
          {
            tChart1.Axes.Left.SetMinMax(tChart2.Axes.Left.Minimum, tChart2.Axes.Left.Maximum);
            tChart1.Axes.Bottom.SetMinMax(tChart2.Axes.Bottom.Minimum, tChart2.Axes.Bottom.Maximum);
          }
        }
    }
}
Could you please send us the screenshot you mentioned so that we can see the problem? If we can not reproduce it we will send you the application we use so that you can test it at your end.

Thanks in advance.
Best Regards,
Narcís Calvet / 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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Fri Feb 01, 2008 8:36 am

Hi Narcis,

I can send you a screen shot I obtain with my prototype with the code you mention but series of 100 points (instead of 1000).
But I don't know how to send you a picture, could you tell me please.

Thank you.
Anne-Lise

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 01, 2008 8:43 am

Hi Anne-Lise,

Yes, I posted this information earlier on this thread, can you please look at my previous meesages? You can use our public newsgroups or the upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / 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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Fri Feb 01, 2008 11:21 am

Narcis,

Sorry, I did'nt see it in your previous message.
I sent you a news with the screen shot attached.

Anne-Lise

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 01, 2008 11:46 am

Hi Anne-Lise,

I've checked that I'm using 100 values in my code and still couldn't reproduce the problem here. I've posted the .exe of the project I'm testing at the newsgrups. Could you please try reproducing the issue with it?

Thanks in advance!
Best Regards,
Narcís Calvet / 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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Fri Feb 01, 2008 12:00 pm

Narcis,

I can't execute your application. I have an error (see the picture screen shot in the news group)

Anne-Lise

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 01, 2008 12:24 pm

Hi Anne-Lise,

Thanks for the information. Can you please confirm that you are using 3.2.2945.19736 which is for Visual Studio .NET 2003 or are you using build 3.2.2945.19737 for Visual Studio 2005? My application was built in VS2003 but I can compile it with any other Visual Studio version if necessary.
Best Regards,
Narcís Calvet / 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

annelise
Newbie
Newbie
Posts: 28
Joined: Wed Jul 18, 2007 12:00 am
Contact:

Post by annelise » Fri Feb 01, 2008 12:39 pm

Narcis,

I use a version for visual 2005.
Yesterday I installed the last version (the 24 of january one but for visual 2005) and I reproduced the problem you can see on screen shot.
After this I reinstall the version we use here (3.2.2894.29190) to be compatible with our source and continue to develop.
If you can compile your project for visual 2005, I think I can try to reproduce the problem with it.

Thank you,
Anne-Lise

Post Reply