Profile Picture

Add Cursot to a surface chart

Posted By Giulio Certo 11 Years Ago
Author
Message
Giulio Certo
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 1, Visits: 1

I've a surface chart with one serie of data; I try to add a cursor tool following your example but I'm not able to show anything. What is wrong?
Thank you very much
This is my code snippet:

// setup Y axis
chart.Axis(StandardAxis.PrimaryY).Visible = false;

// setup X axis
NAxis axisX = chart.Axis(StandardAxis.PrimaryX);
axisX.Anchor =
new NDockAxisAnchor(AxisDockZone.FrontTop);
NLinearScaleConfigurator scaleX = new NLinearScaleConfigurator();
scaleX.InnerMajorTickStyle.Visible =
false;
scaleX.RoundToTickMin =
false;
scaleX.RoundToTickMax =
false;
axisX.ScaleConfigurator = scaleX;

// setup Z axis
NAxis axisZ = chart.Axis(StandardAxis.Depth);
axisZ.Anchor =
new NDockAxisAnchor(AxisDockZone.TopLeft);
NLinearScaleConfigurator scaleZ = new NLinearScaleConfigurator();
scaleZ.InnerMajorTickStyle.Visible =
false;
scaleZ.MajorGridStyle.ShowAtWalls =
new ChartWallType[0];
scaleZ.RoundToTickMin = false;
scaleZ.RoundToTickMax =
false;
axisZ.ScaleConfigurator = scaleZ;

// add a surface series
surface = (NGridSurfaceSeries)chart.Series.Add(SeriesType.GridSurface);
surface.Name =
"Contour";
surface.Legend.Mode = SeriesLegendMode.SeriesLogic;
surface.ValueFormatter =
new NNumericValueFormatter("0.000");
surface.FillMode =
SurfaceFillMode.Zone;
surface.FrameMode =
SurfaceFrameMode.Contour;
surface.ShadingMode =
ShadingMode.Flat;
surface.DrawFlat =
true;

//add cursor
NInteractivityStyle curStyle = new NInteractivityStyle();
curStyle.Cursor =
new NCursorAttribute(CursorType.Cross);
m_HorizontalAxisCursor =
new NAxisCursor();
m_HorizontalAxisCursor.BeginEndAxis = (
int)StandardAxis.PrimaryX;
m_HorizontalAxisCursor.ValueChanged +=
new EventHandler(OnValueChanged);
m_HorizontalAxisCursor.SynchronizeOnMouseAction |=
MouseAction.Down;
m_HorizontalAxisCursor.InteractivityStyle = curStyle;
chart.Axis(
StandardAxis.PrimaryX).Cursors.Add(m_HorizontalAxisCursor);
m_VerticalAxisCursor =
new NAxisCursor();
m_VerticalAxisCursor.BeginEndAxis = (
int)StandardAxis.Depth;
m_VerticalAxisCursor.ValueChanged +=
new EventHandler(OnValueChanged);
m_VerticalAxisCursor.SynchronizeOnMouseAction |=
MouseAction.Down;
m_VerticalAxisCursor.InteractivityStyle = curStyle;
chart.Axis(StandardAxis.Depth).Cursors.Add(m_VerticalAxisCursor);

// add selector and data cursor tool
nChart.Controller.Tools.Add(new NSelectorTool());
nChart.Controller.Tools.Add(new NDataCursorTool());



Nevron Support
Posted 11 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 Giulio,

By default the chart is in 2D mode and surface charts require 3D mode. You have to add the following code:

chart.Enable3D = true;

Also you'll probably have to adjust the chart dimensions (Width, Height, Depth) as the default values are not appropriate for surface charts.

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic