翻譯|使用教程|編輯:凌霄漢|2022-03-09 11:02:17.810|閱讀 427 次
概述:本文主要介紹如何使用LightningChart 創(chuàng)建3D SurfaceGrid 圖表。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
Arction Ltd從事高性能的大數(shù)據(jù)可視化研發(fā)近15年,其下產(chǎn)品LightningChart處于行業(yè)絕對領(lǐng)先水平,本使用教程將會(huì)帶您學(xué)會(huì)如何使用LightningChart .NET進(jìn)行數(shù)據(jù)可視化展示。
LightningChart提供了兩種不同的方式將數(shù)據(jù)表示為 3D 表面 - SurfaceGridSeries3D和SurfaceMeshSeries3D。
在 SurfaceGridSeries3D 中,節(jié)點(diǎn)在 X 和 Z 維度上等距分布,而在SurfaceMeshSeries3D中,節(jié)點(diǎn)可以在 3D 空間中自由定位。
本教程展示了如何使用LightningChart SurfaceGridSeries3D創(chuàng)建帶有線框和輪廓線的簡單 3D SurfaceGrid 。SurfaceGrid 允許將數(shù)據(jù)可視化為 3D 表面,并可用于表示、測量和檢查數(shù)據(jù)及其方差。
本教程中使用調(diào)色板著色來根據(jù)數(shù)據(jù)的值以不同的顏色表示數(shù)據(jù)。 建議先簡要了解一下我們的熱圖教程 ,其中解釋了調(diào)色板著色,然后再繼續(xù)本教程。
在本教程中,我們預(yù)定義了一些變量,以便于使用和清晰。 在 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正版價(jià)格,歡迎查看產(chǎn)品介紹或
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@ke049m.cn