TriangulatedSurfaceChart with empty data points


https://www.nevron.com/Forum/Topic8770.aspx
Print Topic | Close Window

By joern kunze - 10 Years Ago
Hi Experts,
SnippetI want to display grid based measurement data (X: 1,2,3.. Z:1,2,3) but with empty data points and no interpolation at all between data points.
So far I found a way to do it with NTriangulatedSurfaceSeries - here is a rough example with just 4 data points - where one data point is empty:
https://www.nevron.com/forum/uploads/images/90963ff0-7c01-41ae-993d-bdaa.jpg

Unfortunatly, I could not find a way to handle empty data points.
The upper left square should be completly empty since all corner values are NaN - but it isnt.

Is there a way to achieve this?
Or is there even an easier and better way than using Triangulated surface chart ? Basically I have transformed each measured data point to 4 points representing the points very close to the corner of the measured data point within the measurement grid - for example measurement point represented by the upper right yellowish square (X=2, Z=2 with value 3.1) is transformed to:
Snippet
surface.XValues.AddRange( new double[] {1.51, 1.51, 2,49, 2.49} );Snippet
surface.ZValues.AddRange( new double[] {1.51, 2.49, 1.51, 2.49});
Snippet
surface.Values.AddRange( new double[] {3.1, 3.1, 3.1 , 3.1});
This approach works (except for empty data points which are double.NaN) - but looks clumsy somehow ...

Thanks a lot for your help,
Joern
By Nevron Support - 10 Years Ago
Hi Joern,

The grid surface also regards empty data points - check the following example:

NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

chart.Enable3D = true;

chart.Width = chart.Height = chart.Depth = 40;

chart.Projection.SetPredefinedProjection(Nevron.GraphicsCore.PredefinedProjection.OrthogonalTop);

NGridSurfaceSeries gridSurface = new NGridSurfaceSeries();

gridSurface.Data.SetGridSize(3, 3);

for (int i = 0; i < gridSurface.Data.GridSizeX; i++)

{

for (int j = 0; j < gridSurface.Data.GridSizeZ; j++)

{

gridSurface.Data.SetValue(i, j, i * j);

}

}

gridSurface.Data.SetValue(0, 2, double.NaN);

chart.Series.Add(gridSurface);

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

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

Hope this helps - let us now if you meet any problems...


By joern kunze - 10 Years Ago
Thanks a lot for the reply - unfortunatly I still cant get it working the way I want. I already tried NGridSurfaceSeries in the first place since it can work with NaN-values.
But there are 2 major drawbacks:
1. There is always interpolation between adjacent squares of the grid - but I want to color each single square of the underlying grid with just one color
2. When I run the example, it is all colored in the same color when viewd from the top:

https://www.nevron.com/forum/uploads/images/6e5d8110-b520-4e8f-adca-b088.jpg

Basically, I am looking for a way to make the example look like:

https://www.nevron.com/forum/uploads/images/e21f93d6-58d2-41d0-9dfe-ad72.jpg

Is there a way to do so?

Thanks again,
Joern












By Nevron Support - 10 Years Ago
Hi Joern,

We're going to have a heat map series in the upcoming new version that will solve this problem. How urgent is this for your project?
By joern kunze - 10 Years Ago
... unfortunatly it is rather urgent - it is scheduled to be working at the end of this month.

Best regards,
Joern