翻譯|使用教程|編輯:楊鵬連|2021-03-16 10:33:52.523|閱讀 267 次
概述:本文主要介紹了高性能圖表控件LightningChart 中Datagrid的Pasar datos deview閃電圖問題解答。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
LightningChart.NET完全由GPU加速,并且性能經過優化,可用于實時顯示海量數據-超過10億個數據點。 LightningChart包括廣泛的2D,高級3D,Polar,Smith,3D餅/甜甜圈,地理地圖和GIS圖表以及適用于科學,工程,醫學,航空,貿易,能源和其他領域的體繪制功能。
LightningChart.NET現已加入在線訂購,SignalTools , 12 months, WPF版本原價4105元,現價只需3499元,現在搶購立享優惠!立即購買>>
問題:Datagrid的Pasar datos deview閃電圖
在DataGrid上查看墨西哥的地圖,在LightningChart上查看地圖?否,您可以通過vb.net上的agradeceríasi me dan un ejemplo來查看自己的名字。
回復:Datagridview的Pasar datos de a Lightningchart
例如,僅通過在for循環中讀取DataGridView單元的值,并將它們分配為SeriesPoint X和Y值,就應該可以做到這一點。當前,在VisualBasic .Net中我們沒有關于此的示例。但是,我可以在此處附上一個用WinForms完成的小示例,它應該使您知道如何完成此操作。
_chart = new LightningChartUltimate(); _chart.BeginUpdate(); _chart.Parent = splitContainer1.Panel2; _chart.Dock = DockStyle.Fill; FreeformPointLineSeries pls = new FreeformPointLineSeries(_chart.ViewXY, _chart.ViewXY.XAxes[0], _chart.ViewXY.YAxes[0]); pls.LineStyle.Color = Color.LimeGreen; pls.PointsVisible = true; _chart.ViewXY.FreeformPointLineSeries.Add(pls); _chart.EndUpdate(); private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (_chart != null) { List<SeriesPoint> points = new List<SeriesPoint>(); double d1, d2; for (int i = 0; i < dataGridView1.Rows.Count; i++) { if (dataGridView1.Rows[i].Cells[0].Value != null && dataGridView1.Rows[i].Cells[1].Value != null) { if (double.TryParse(dataGridView1.Rows[i].Cells[0].Value.ToString(), out d1) && double.TryParse(dataGridView1.Rows[i].Cells[1].Value.ToString(), out d2)) { SeriesPoint pnt = new SeriesPoint(); pnt.X = d1; pnt.Y = d2; points.Add(pnt); } } } _chart.ViewXY.FreeformPointLineSeries[0].Points = points.ToArray(); _chart.ViewXY.FreeformPointLineSeries[0].InvalidateData(); } }在此示例中,我們創建一個FreeformPointLineSeries,它從DataGridView獲取其數據值(每行都有X和Y值的兩列)。每次用戶在網格中更改/添加值時,CellValueChanged事件中的值都會更新。基本上,這僅需要一些null檢查和值解析。請注意,每次創建新的數據點列表都不是最有效的方法,最好只更改與值已更改的單元格相對應的數據點的X / Y值。
希望這會有所幫助。
Y en el caso delGráfico3D?Cómoseria嗎?
完全相同的邏輯也適用于3D圖形。唯一的區別是分配新數據點時使用的是PointLineSeries3D而不是FreeformPointLineseries,使用SeriesPoint3D而不是SeriesPoint。這意味著您必須為數據點分配三個值(X,Y,Z)。因此,很有可能在DataGridView中應該有第三列。
現有的阿爾及利亞優先權要求控制數據網格視圖有問題嗎?no he podido crear elgráfico3D:'(,,quizássea la forma de llenar el datagrid,tal vez el origen de los datos,como se ingresan los datos,等等
無法說出無法創建3D圖表的確切原因是什么。您可能缺少一些屬性設置,例如將ActiveView設置為View3D。這是相同的WinForms測試項目,現在已轉換為使用3D圖。
_chart = new LightningChartUltimate(); _chart.BeginUpdate(); _chart.Parent = splitContainer1.Panel2; _chart.Dock = DockStyle.Fill; _chart.ActiveView = ActiveView.View3D; PointLineSeries3D pls = new PointLineSeries3D(_chart.View3D, Axis3DBinding.Primary, Axis3DBinding.Primary, Axis3DBinding.Primary); pls.LineStyle.Color = Color.Yellow; pls.PointsVisible = true; pls.PointStyle.Shape3D = PointShape3D.Sphere; pls.Material.DiffuseColor = Color.Red; _chart.View3D.PointLineSeries3D.Add(pls); _chart.EndUpdate(); private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (_chart != null) { List<SeriesPoint3D> points = new List<SeriesPoint3D>(); double d1, d2, d3; for (int i = 0; i < dataGridView1.Rows.Count; i++) { if (dataGridView1.Rows[i].Cells[0].Value != null && dataGridView1.Rows[i].Cells[1].Value != null && dataGridView1.Rows[i].Cells[2].Value != null) { if (double.TryParse(dataGridView1.Rows[i].Cells[0].Value.ToString(), out d1) && double.TryParse(dataGridView1.Rows[i].Cells[1].Value.ToString(), out d2) && double.TryParse(dataGridView1.Rows[i].Cells[2].Value.ToString(), out d3)) { SeriesPoint3D pnt = new SeriesPoint3D(); pnt.X = d1; pnt.Y = d2; pnt.Z = d3; points.Add(pnt); } } } _chart.View3D.PointLineSeries3D[0].Points = points.ToArray(); _chart.View3D.PointLineSeries3D[0].InvalidateData(); } }關于讀取/填充數據。LightningChart主要是可視化組件,它本身沒有接口可連接到MySQL或Oracle等數據庫。從技術上講,LightningChart不在乎如何將數據提供給圖表,但通常來說,從某些特定來源讀取數據的功能有限。我們的演示應用程序具有“大數據打開速度測試”的示例,該示例顯示了如何保存和讀取我們的文件格式。但是,“數據庫”有無限的可能性,我們無法在庫中將它們全部涵蓋。因此,用戶應開發自己的例程以從其具有的任何來源讀取數據,以便將數據添加到圖表。數據源或從中讀取數據的方法完全不會影響圖表本身。
如果對此有任何疑問,請以獲取更多信息。
想要購買LightningChart正版授權,或了解更多產品信息請點擊
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: