There are issues with Zoom/Rotate interactions with 3D Surface plots. Essentially the mesh distorts or breaks apart and eventually asserts .
The code we are using worked fine with the 2011 DotNet version ( and we have tested on more than one machine with different graphics cards)
Version tested: TeeChartNET2018_4.1.2018.05040
I have created a simple bi-variate normal distribution curve to demonstrate the problem (our actual data/code is obviously more complex).
A screenshot is included to demonstrate the actual data.
- In this example I use a rotate tool and set the Chart-3D-3D % to 60% (through the editor)
- Normally we use left mouse button down to start a rotation. Here I am using right button in order to separate effect of rotate vs zoom action. Rotate by itself is fine, stretching the mesh with Zoom area selection followed by rotate appears to cause the problems.
Steps to reproduce
1. Perform a series of zoom (in) and rotate about the distribution shape.
2. Eventually either the Mesh will splinter with vertices drawn (far) into or out of the elevation axis (as though very large or negative values) or the plot will disappear and assert with an overflow error ( leaving the red checked box of doom)
Please note it is not easy to describe the exact zoom/rotate steps required.
Choose a zoom rectangle much larger in one dimension than the other , rotate 45 degrees and repeat is usually enough to trigger the assert
Code snippet follows
=========================
Code: Select all
Steema.TeeChart.Styles.Surface surfaceSeries1;
Steema.TeeChart.TChart _chart = chart.Chart();
chart.Chart().Aspect.View3D = true;
chart.Chart().Aspect.Orthogonal = false;
Steema.TeeChart.Tools.Rotate rotate1 = new Steema.TeeChart.Tools.Rotate(_chart.Chart);
rotate1.Button = MouseButtons.Right;
rotate1.Style = Steema.TeeChart.Tools.RotateStyles.All;
rotate1.Active = true;
surfaceSeries1 = new Steema.TeeChart.Styles.Surface();
surfaceSeries1.Visible = true;
surfaceSeries1.WireFrame = false;
surfaceSeries1.Pen.Visible = true;
surfaceSeries1.Clear();
surfaceSeries1.ClearPalette();
surfaceSeries1.IrregularGrid = true;
// bottom axis - pipe length
Steema.TeeChart.Axis bottomAxis = chart.Chart().Axes.Bottom;
bottomAxis.Title.Visible = true;
bottomAxis.Title.Text = "Pipe length";
// left axis - property
Steema.TeeChart.Axis leftAxis = chart.Chart().Axes.Left;
leftAxis.Title.Visible = true;
//leftAxis.Title.Text =
// depth axis - time
Steema.TeeChart.Axis depthAxis = chart.Chart().Axes.Depth;
depthAxis.Title.Visible = true;
depthAxis.Title.Text = "Time (s)";
double X;
double Y;
double Z;
double B1;
double B2;
double Xbar;
double Ybar;
Xbar = Ybar = 10;
B1 = B2 = 0.01;
for (int i = -100; i < 100; i++)
{
X = (double)i;
for (int j = -100; j < 100; j++)
{
Y = (double)j;
Z= Math.Exp(-1 * B1*(X - Xbar)* (X - Xbar) -1 * B2*(Y - Ybar)* (Y - Ybar));
surfaceSeries1.Add(X, Z, Y);
}
}
chart.Chart().Series.Add(surfaceSeries1);
================
System.OverflowException: Overflow error.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.FillPolygon(Brush brush, Point[] points, FillMode fillMode)
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.Polygon(Point[] p)
at Steema.TeeChart.Drawing.Graphics3D.PolygonFour()
at Steema.TeeChart.Drawing.Graphics3D.PlaneFour3D(Int32 z0, Int32 z1, Point[] p)
at Steema.TeeChart.Styles.Surface.DrawTheCell(Int32 z0)
at Steema.TeeChart.Styles.Surface.DrawCell(Int32 x, Int32 z)
at Steema.TeeChart.Styles.Surface.DrawAllCells()
at Steema.TeeChart.Styles.Surface.Draw()
at Steema.TeeChart.Styles.Series.DrawSeries()
at Steema.TeeChart.Chart.DoDraw(Graphics3D g, Int32 First, Int32 Last, Int32 Inc)
at Steema.TeeChart.Chart.DrawAllSeries(Graphics3D g)
at Steema.TeeChart.Chart.InternalDraw(Graphics g, Boolean noTools)
at Steema.TeeChart.TChart.Draw(Graphics g)
at Steema.TeeChart.TChart.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)