Get Axes Coordinates of 3d Charts

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

Get Axes Coordinates of 3d Charts

Post by lilo » Thu Sep 29, 2011 4:46 am

What is the best method to determine the axes values of the surface series and other 3d charts.

I think I can use:
Private Sub Surface1_GetYValue(ByVal sender As Steema.TeeChart.Styles.Series, ByVal e As Steema.TeeChart.Styles.Custom3DGrid.GetYValueEventArgs) Handles Surface1.GetYValue
SurfaceX1 = e.X
SurfaceY1 = e.Value
SurfaceZ1 = e.Z
End Sub

How should I trigger the event when required to get these values?

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

Re: Get Axes Coordinates of 3d Charts

Post by Sandra » Thu Sep 29, 2011 2:01 pm

Hello lilo,
What is the best method to determine the axes values of the surface series and other 3d charts.
I think I can use:
Private Sub Surface1_GetYValue(ByVal sender As Steema.TeeChart.Styles.Series, ByVal e As Steema.TeeChart.Styles.Custom3DGrid.GetYValueEventArgs) Handles Surface1.GetYValue
SurfaceX1 = e.X
SurfaceY1 = e.Value
SurfaceZ1 = e.Z
End Sub
How should I trigger the event when required to get these values?
I think, GetYValues event doesn't help you, so the GetYValue event occurs when the Surface Series needs to recreate the grid of values. Calling the ReCreateValues method forces Surface Series to be created again. You should return the corresponding Y value for a given X and Z values. Usually you will place a formula or algorithm that calculates its value based on X and Z parameters.To achieve correct values of axes of 3DCharts, you need convert 2D Points to 3D Points and I'm afraid that it is a known problem, as explain in this thread.

On the other hand, I suggest that use XValues[], YValues[], ZValues[] and MouseMove event, to calculate value of the surface cells. You can do something as next:

Code: Select all

        Steema.TeeChart.ChartController ChartController1;
        Steema.TeeChart.Styles.Surface series1;
        private void InitializeChart()
        {
            ChartController1 = new Steema.TeeChart.ChartController();
            this.Controls.Add(ChartController1);
            tChart1.Aspect.Orthogonal = true;
            tChart1.Aspect.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighSpeed;
            ChartController1.Chart = tChart1;
            tChart1.Axes.Depth.Visible = true;
            series1 = new Surface(tChart1.Chart);
            series1.FillSampleValues();
            tChart1.Aspect.Chart3DPercent = 30;
            tChart1.MouseMove += new MouseEventHandler(tChart1_MouseMove);
        }
        void tChart1_MouseMove(object sender, MouseEventArgs e)
        {
            int index1 = series1.Clicked(e.X, e.Y);
            if (index1 != -1)
            {
                this.Text = "X: " + series1.XValues[index1] + ", Y:" + series1.YValues[index1] + ", Z:" + series1.ZValues[index1];
            }
        }
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