Profile Picture

XYZ Axis on a surface plot

Posted By Luis Baldeon 3 Years Ago
Author
Message
Luis Baldeon
Question Posted 3 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 8, Visits: 27
I'm trying to draw an axis for the surface plot.  I would arrows at the ends and the letters x, y and z.  Is it possible to draw the surface plot so that the axis is in the center?

Attachments
Nevron.PNG (162 views, 299.00 KB)
Nevron Support
Posted 3 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Luis,

Currently, the axes do not support caps in 3D. To cross the axes at some particular value you need to set a cross-axis anchor to each of the axes - the following example shows how to do this:

NChart chart = nChartControl1.Charts[0];
chart.Enable3D = true;

chart.Wall(ChartWallType.Back).Visible = false;
chart.Wall(ChartWallType.Floor).Visible = false;
chart.Wall(ChartWallType.Left).Visible = false;

NAxis xAxis = chart.Axis(StandardAxis.PrimaryX);
NAxis yAxis = chart.Axis(StandardAxis.PrimaryY);
NAxis zAxis = chart.Axis(StandardAxis.Depth);

xAxis.ScaleConfigurator = new NLinearScaleConfigurator();
yAxis.ScaleConfigurator = new NLinearScaleConfigurator();
zAxis.ScaleConfigurator = new NLinearScaleConfigurator();

xAxis.Anchor = new NCrossAxisAnchor(AxisOrientation.Horizontal);
((NCrossAxisAnchor)xAxis.Anchor).Crossings.Add(new NValueAxisCrossing(yAxis, 0));
((NCrossAxisAnchor)xAxis.Anchor).Crossings.Add(new NValueAxisCrossing(zAxis, 0));

yAxis.Anchor = new NCrossAxisAnchor(AxisOrientation.Vertical);
((NCrossAxisAnchor)yAxis.Anchor).Crossings.Add(new NValueAxisCrossing(xAxis, 0));
((NCrossAxisAnchor)yAxis.Anchor).Crossings.Add(new NValueAxisCrossing(zAxis, 0));

zAxis.Anchor = new NCrossAxisAnchor(AxisOrientation.Depth);
((NCrossAxisAnchor)zAxis.Anchor).Crossings.Add(new NValueAxisCrossing(xAxis, 0));
((NCrossAxisAnchor)zAxis.Anchor).Crossings.Add(new NValueAxisCrossing(yAxis, 0));

NGridSurfaceSeries surface = new NGridSurfaceSeries();
chart.Series.Add(surface);
chart.Width = chart.Height = chart.Depth = 50;
surface.XValuesMode = GridSurfaceValuesMode.OriginAndStep;
surface.OriginX = -1;
surface.StepX = 2;
surface.ZValuesMode = GridSurfaceValuesMode.OriginAndStep;
surface.OriginZ = -1;
surface.StepZ = 2;
surface.Data.SetSize(2, 2);

surface.Data.SetValue(0, 0, -1);
surface.Data.SetValue(0, 1, -1);
surface.Data.SetValue(1, 0, 1);
surface.Data.SetValue(1, 1, 1);

nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
nChartControl1.Controller.Tools.Add(new NTrackballTool());

We hope this helps - let us know if you have any questions or meet any problems.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic