Transpose on Contour

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Transpose on Contour

Post by VarUser » Fri Aug 07, 2009 5:53 am

Hi,

I load the contour on chart and zooming the contour and then I transpose the contour using gridTranspose tool, the axis are not getting updated with new values and result of that we don't able to see anything on the Chart (it becomes blank).

If we undone the zoom then the axis get updated and we see the whole contours trasnsposed.

In our case, all axis are inverted and irregulargrid set to true. We are using setminmax method for Zooming/Unzooming.

I have also tried to call Invalidate but no difference.

Regards,
Ripal

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Transpose on Contour

Post by Yeray » Fri Aug 07, 2009 10:28 am

Hi Ripal,

If I understand well, the problem is that, when you transpose your series, you would like the axes also to transpose, but it only happens automatically when there is no zoom.
So you could proceed as follows if I'm not wrong:

Code: Select all

TransposeTool.Transpose();
if (tChart1.Zoom.Zoomed)
{
    double min = tChart1.Axes.Bottom.Minimum;
    double max = tChart1.Axes.Bottom.Maximum;

    tChart1.Axes.Bottom.SetMinMax(tChart1.Axes.Left.Minimum, tChart1.Axes.Left.Maximum);
    tChart1.Axes.Left.SetMinMax(min, max);
}
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

VarUser
Newbie
Newbie
Posts: 23
Joined: Mon Sep 15, 2008 12:00 am

Re: Transpose on Contour

Post by VarUser » Fri Aug 07, 2009 11:17 am

Hi,

I am doing as you have mentioned but as I mentioned the Axis shows the previous numbers.

For example, Bottom axis has 1 to 10 and Left axis has 1 to 50 and after zooming we set the min max for Bottom axis 3 to 5 and Left axis to 15 to 25.

Now if I transpose Bottom axis still shows the values from 3 to 5 instead of 15 to 25 and same effect for Left axis i.e. 15 to 25 instead of 3 to 5.

and because of this chart doesn't show any contours.

Regards,
Ripal

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

Re: Transpose on Contour

Post by Sandra » Wed Aug 12, 2009 8:41 am

Hello Ripal,

I made a simple project that works correctly here. Please check next code works fine with your version of TeeChartFor .Net in your application.

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Tools.GridTranspose TransposeTool;
        Steema.TeeChart.Styles.Contour contour1;  

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            TransposeTool = new Steema.TeeChart.Tools.GridTranspose(tChart1.Chart);
            contour1 = new Steema.TeeChart.Styles.Contour(tChart1.Chart);
            double y;
            for (int x = 0; x < 10; x++)
                for (int z = 0; z < 50; z++)
                {
                    y = 0.5 * Math.Pow(Math.Cos(x * 0.25), 2) +
                       Math.Pow(Math.Cos(z / 15.0), 2) -
                       Math.Cos(z / 15.0);
                    this.contour1.Add(x, y, z);
                }
            this.tChart1.Axes.Depth.Visible = true;
            this.tChart1.Legend.Visible = false;
            this.contour1.UseColorRange = false;
            this.contour1.UsePalette = true;
            TransposeTool.Series = contour1;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            TransposeTool.Transpose();

            if (tChart1.Zoom.Zoomed)
            {
                double min = tChart1.Axes.Bottom.Minimum;
                double max = tChart1.Axes.Bottom.Maximum;

                tChart1.Axes.Bottom.SetMinMax(tChart1.Axes.Left.Minimum, tChart1.Axes.Left.Maximum);
                tChart1.Axes.Left.SetMinMax(min, max);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int x0, x1, y0, y1, height1, width1;
            x0 = tChart1.Axes.Bottom.CalcXPosValue(3);
            x1 = tChart1.Axes.Bottom.CalcXPosValue(5);
            y0 = tChart1.Axes.Left.CalcYPosValue(15);
            y1=tChart1.Axes.Left.CalcYPosValue(25);
            height1=y0-y1;
            width1=x1-x0;
            Rectangle rect = new Rectangle(x0,y1,x1-x0,y0-y1);
            tChart1.Zoom.ZoomRect(rect);
        }
Also, you could said what is your version of TeeChartFor .Net are you use?

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