Page 1 of 1

Transpose on Contour

Posted: Fri Aug 07, 2009 5:53 am
by 14050297
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

Re: Transpose on Contour

Posted: Fri Aug 07, 2009 10:28 am
by yeray
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);
}

Re: Transpose on Contour

Posted: Fri Aug 07, 2009 11:17 am
by 14050297
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

Re: Transpose on Contour

Posted: Wed Aug 12, 2009 8:41 am
by 10050769
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,