Page 1 of 1
Get Axes Coordinates of 3d Charts
Posted: Thu Sep 29, 2011 4:46 am
by 15660116
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?
Re: Get Axes Coordinates of 3d Charts
Posted: Thu Sep 29, 2011 2:01 pm
by 10050769
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,