翻譯|使用教程|編輯:凌霄漢|2022-03-09 11:02:17.810|閱讀 411 次
概述:本文主要介紹如何使用LightningChart 創建3D SurfaceGrid 圖表。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
Arction Ltd從事高性能的大數據可視化研發近15年,其下產品LightningChart處于行業絕對領先水平,本使用教程將會帶您學會如何使用LightningChart .NET進行數據可視化展示。
LightningChart提供了兩種不同的方式將數據表示為 3D 表面 - SurfaceGridSeries3D和SurfaceMeshSeries3D。
在 SurfaceGridSeries3D 中,節點在 X 和 Z 維度上等距分布,而在SurfaceMeshSeries3D中,節點可以在 3D 空間中自由定位。
本教程展示了如何使用LightningChart SurfaceGridSeries3D創建帶有線框和輪廓線的簡單 3D SurfaceGrid 。SurfaceGrid 允許將數據可視化為 3D 表面,并可用于表示、測量和檢查數據及其方差。
本教程中使用調色板著色來根據數據的值以不同的顏色表示數據。 建議先簡要了解一下我們的熱圖教程 ,其中解釋了調色板著色,然后再繼續本教程。
在本教程中,我們預定義了一些變量,以便于使用和清晰。 在 Form 或 MainWindow 類中定義以下變量,如下所示。
////// 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;
// Set View3D as active view and set Y-axis range. _chart.ActiveView = ActiveView.View3D; _chart.View3D.YAxisPrimary3D.SetRange(-50, 100);
// Create a new SurfaceGrid instance as SurfaceGridSeries3D. _surfaceGrid = new SurfaceGridSeries3D(_chart.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary);
// 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;
// Create ValueRangePalette for coloring SurfaceGrid's data. ValueRangePalette palette = CreatePalette(_surfaceGrid); _surfaceGrid.ContourPalette = palette;
// Define WireFrameType and ContourLineType for SurfaceGrid. _surfaceGrid.WireframeType = SurfaceWireframeType3D.WireframePalettedByY; _surfaceGrid.ContourLineType = ContourLineType3D.ColorLineByY; _surfaceGrid.ContourLineWidth = 2;
// 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(); }
如果您對該圖表控件感興趣,歡迎加入圖表控件QQ交流群:740060302
如果你想了解LightningChart.NET正版價格,歡迎查看產品介紹或
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn