lightningChart: 以代碼形式創(chuàng)建圖表
22. 處理模式
當(dāng)您在代碼中創(chuàng)建圖表時(shí),不再需要該圖表,請(qǐng)調(diào)用
chart. Dispose();
釋放圖表及其所有對(duì)象的內(nèi)存,如系列,標(biāo)記,調(diào)色板步驟...
如果您即時(shí)創(chuàng)建對(duì)象,并希望在退出應(yīng)用程序或處理之前釋放其內(nèi)存
整個(gè)圖表[with chart . Dispose()],從被添加到的集合中刪除對(duì)象,然后為對(duì)象調(diào)用Dispose()。
例如。從chart . View X Y. Point Line Series集合中處理一個(gè)系列:
//做清理...刪除和處理3個(gè)步驟
_chart. Begin Update();
List list Series To Be Removed = new List ();
List Series To Be Removed . Add(_chart . View X Y .Point Line Series [1]);
List Series To Be Removed . Add(_chart . View X Y . Point Line Series [3]);
List Series To Be Removed . Add(_chart . View X Y . Point Line Series [4]);
foreach(Point Line Series p l s in list Series To Be Removed)
{
_chart . View X Y . Point Line Series . Remove(PLS);
pls.Dispose();
}
_chart.EndUpdate();
當(dāng)不再需要LightingChart的對(duì)象時(shí),及時(shí)處理它們以防止內(nèi)存泄漏是明智的選擇。
23. 對(duì)象模型說明
23.1在其他對(duì)象之間共享對(duì)象
LightningChart對(duì)象模型是有目錄可循的。每個(gè)分類都有其主對(duì)象和子對(duì)象列表。有了目錄的幫助,子對(duì)象能夠?qū)崟r(shí)通知主對(duì)象它的變化,以便主對(duì)象可以分別對(duì)其進(jìn)行響應(yīng),在達(dá)到根節(jié)點(diǎn),也就是LightningChartUltimate本身之前,主對(duì)象能夠?qū)τ谧陨淼淖兓M(jìn)行了解,因此知道應(yīng)該如何應(yīng)對(duì)。
對(duì)象還參考了他們的非管理對(duì)象,如GPU資源、屏幕或閃爍的問題。
在同一個(gè)圖表或其他圖表實(shí)例中的其他對(duì)象之間共享對(duì)象是被禁止的。
示例1的使用錯(cuò)誤:
AnnotationXY annotation1 = new Annotation();
chart.ViewXY.Annotations.Add(annotation1);
AnnotationXY annotation2 = new Annotation();
annotation2.Fill = annotation1.Fill;
chart.ViewXY.Annotations.Add(annotation2);
這是錯(cuò)誤的,因?yàn)橄嗤腇ill對(duì)象不能在多個(gè)對(duì)象之間共享。
正確的方法:僅復(fù)制屬性(如果它們是ValueType)(例如,整數(shù),雙倍,彩色)
示例2使用錯(cuò)誤:
SeriesEventMarker marker = new SeriesEventMarker();
chart.ViewXY.PointLineSeries [0] .SeriesEventMarkers.Add(標(biāo)記);
chart.ViewXY.PointLineSeries [1] .SeriesEventMarkers.Add(標(biāo)記);
不應(yīng)將相同的對(duì)象添加到多個(gè)集合的集合中。
正確方法:為兩個(gè)系列創(chuàng)建自己的標(biāo)記。
使用您的可執(zhí)行文件,生成Arction dlls。然后使用您的可執(zhí)行文件生成全局程序集緩存或其他文件夾。在這些文件夾中,.NET程序集解析系統(tǒng)能夠找到上述的的Arction dlls。
LightningChart同樣也支持ClickOnce部署
WinForms:
•Arction.WinForms.Charting.LightningChartUltimate.dll
•Arction.Licensing.dll
•Arction.DirectX.dll
•Arction.RenderingDefinitions.dll
•Arction.RenderingEngine.dll
•Arction.RenderingEngine9.dll
•Arction.RenderingEngine11.dll
•Arction.DirectXInit.dll
•Arction.DirectXFiles.dll
如果使用SignalTools的話:
•Arction.WinForms.SignalProcessing.SignalTools.dll
•Arction.MathCore.dll
WPF:
•Arction.Wpf.Charting.LightningChartUltimate.dll(如果使用不可綁定的WPF圖表)
•Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll(如果使用半可綁定的WPF
圖表)
•Arction.Wpf.BindableCharting.LightningChartUltimate.dll(如果使用完全可綁定的WPF圖表)
•Arction.Licensing.dll
•Arction.DirectX.dll
•Arction.RenderingDefinitions.dll
•Arction.RenderingEngine.dll
•Arction.RenderingEngine9.dll
•Arction.RenderingEngine11.dll
•Arction.DirectXInit.dll
•Arction.DirectXFiles.dll
如果使用SignalTools的話
•Arction.Wpf.SignalProcessing.SignalTools.dll
•Arction.MathCore.dll266
一定記住要為所有組件分配靜態(tài)的Set Deployment Key。否則的話,圖表就會(huì)進(jìn)入試用模式,而且使用期限只有30天。有關(guān)許可證密鑰管理的部分內(nèi)容,請(qǐng)參閱部分4。
京ICP備09015132號(hào)-996 | 違法和不良信息舉報(bào)電話:4006561155
© Copyright 2000-2026 北京哲想軟件有限公司版權(quán)所有 | 地址:北京市海淀區(qū)西三環(huán)北路50號(hào)豪柏大廈C2座11層1105室
北京哲想軟件集團(tuán)旗下網(wǎng)站:哲想軟件 | 哲想動(dòng)畫