double[,] zdata = new double[50,50];
double temp = 0;
for (int i = 0; i < 50; i++)
{
for (int j=0;j<50;j++)
{
// temp = -(i - 25) * (i - 25)/100- (j - 25) * (j - 25)/100;
temp =- ((i - 25) * (i - 25)+ (j - 25) * (j - 25))/ 100;
zdata[i, j] = 10*Math.Exp(temp);
}
}
GridDataSeries data = new GridDataSeries();
data.Start = new Point(0, 0);
data.Step = new Point(1, 1);
data.ZData = zdata;
chart3D.Children.Add(data );
chart3D.ChartType = C1.WPF.C1Chart3D.Chart3DType.SurfaceZoneContour;
chart3D.ColorPalette = new Color[] { Colors.Blue, Colors.Yellow, Colors.Red};
chart3D.ContourLevelsCount = 20;
chart3D.Elevation = 150;
chart3D.Azimuth = 30;
chart3D.AxisX.MajorUnit = 10;
chart3D.AxisY.MajorUnit = 10;
chart3D.AxisZ.MajorUnit = 2;
chart3D.AxisZ.Max = 10;
chart3D.AxisX.MajorTickAppearance = TickAppearance.Line;
chart3D.AxisY.MajorTickAppearance = TickAppearance.Line;
chart3D.AxisZ.MajorTickAppearance = TickAppearance.Line;
chart3D.AxisX.Title = new TextBlock { Text = "X Axis", FontSize = 14 };
chart3D.AxisY.Title = new TextBlock { Text = "Y Axis", FontSize = 14 };
chart3D.AxisZ.Title = new TextBlock { Text = "Z Axis", FontSize = 14 }; |