Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does LightningChart.NET create 3D SurfaceGrid Chart

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how LightningChart.NET creates 3D SurfaceGrid charts". In daily operation, I believe many people have doubts about how LightningChart.NET creates 3D SurfaceGrid charts. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how LightningChart.NET creates 3D SurfaceGrid charts". Next, please follow the editor to study!

LightningChart provides two ways to represent data as 3D surfaces-SurfaceGridSeries3D and SurfaceMeshSeries3D.

In SurfaceGridSeries3D, nodes are distributed equidistant in X and Z dimensions, and in SurfaceMeshSeries3D, nodes can be located freely in 3D space.

This tutorial shows how to use LightningChart SurfaceGridSeries3D to create a simple 3D SurfaceGrid using wireframes and contours.

SurfaceGrid allows data to be visualized as 3D surfaces and can be used to represent, measure and examine data and their changes.

Palette shading is used in this tutorial to represent data in different colors depending on the value of the data.

It is recommended that you give a brief introduction to our Heat Map tutorial and explain the shading of the palette before continuing with this tutorial.

In this tutorial, we predefine some variables to make them easy to use and clear.

Define the following variables in the Form or MainWindow class, as shown below.

/ / /

/ LightningChart component. / / private LightningChartUltimate _ chart = null; / Reference to SurfaceGrid series in chart. / / private SurfaceGridSeries3D _ surfaceGrid = null; / SurfaceGrid rows. / int _ rows = 500; / SurfaceGrid columns. / int _ columns = 500; / Minimum X-axis value. / private const int MinX = 0; / Maximum X-axis value. / private const int MaxX = 100; / Minimum Z-axis value. / private const int MinZ = 0; / Maximum Z-axis value. / private const int MaxZ = 100

1. Define View3D as the active view and define the Y axis range.

/ / Set View3D as active view and set Y-axis range._chart.ActiveView = ActiveView.View3D;_chart.View3D.YAxisPrimary3D.SetRange (- 50,100)

two。 Create a new instance of SurfaceGrid as SurfaceGridSeries3D.

/ / Create a new SurfaceGrid instance as SurfaceGridSeries3D._surfaceGrid = new SurfaceGridSeries3D (_ chart.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary)

3. Define the settings for SurfaceGrid.

/ / Set range, size and color saturation options for SurfaceGrid._surfaceGrid.RangeMinX = MinX;_surfaceGrid.RangeMaxX = MaxX;_surfaceGrid.RangeMinZ = MinZ;_surfaceGrid.RangeMaxZ = MaxZ;_surfaceGrid.SizeX = _ columns;_surfaceGrid.SizeZ = _ rows;// Stronger colors._surfaceGrid.ColorSaturation = 80

4. Create a ValueRangePalette and set it to the ContourPalette of SurfaceGrid.

/ / Create ValueRangePalette for coloring SurfaceGrid's data.ValueRangePalette palette = CreatePalette (_ surfaceGrid); _ surfaceGrid.ContourPalette = palette

5. Define wireframes and contours for SurfaceGrid.

/ / Define WireFrameType and ContourLineType for SurfaceGrid._surfaceGrid.WireframeType = SurfaceWireframeType3D.WireframePalettedByY;_surfaceGrid.ContourLineType = ContourLineType3D.ColorLineByY;_surfaceGrid.ContourLineWidth = 2

6. Generate data.

/ / Generate data.public void GenerateData (int columns, int rows) {/ / Create variable for storing data. Double data = 0; / / Disable rendering before updating chart properties to improve performance / / and to prevent unnecessary chart redrawing while changing multiple properties. _ chart.BeginUpdate (); / / Set data values and add them to SurfaceGrid. For (int I = 0; I

< _columns; i++) { for (int j = 0; j < _rows; j++) { // Add values to the SurfaceGrid as SurfacePoints, points are distributed by using following function. data = 30.0 + 8 * Math.Cos(20 + 0.0001 * (double)(i * j)) + 60.0 * Math.Cos((double)(j - i) * 0.01); _surfaceGrid.Data[i, j].Y = data; } } // Notify chart about updated data. _surfaceGrid.InvalidateData(); // Call EndUpdate to enable rendering again. _chart.EndUpdate(); }

At this point, the study on "how to create 3D SurfaceGrid charts by LightningChart.NET" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report