调用c#.net版LightningChart.dll实现波形图的调用
By
admin
at 2022-03-12 • 1人收藏 • 760人看过
前面文章中https://www.chengxu.xyz/t/535 介绍了使用web.view调用js版LightningChartjs展示波形图.
日前aardio对dotnet库进行了大幅度改进, 能够很简单的把所有dll内存加载实现绿色exe生成,
而且c#版lightningchart性能比js版要高许多, 下面我简单的对它进行测试.
不知道你们能不能用的试用版10.2.1 dll
Arction.WinForms.Charting.LightningChart.zip
import win.ui; /*DSG{{*/ var winform = win.form(text="aardio form";right=1103;bottom=629) winform.add() /*}}*/ import dotNet; var dll = dotNet.load("\Arction.WinForms.Charting.LightningChart.dll") var Chart = dll.import("Arction.WinForms.Charting"); var _chart = Chart.LightningChart(); dotNet.setParent(_chart,winform); _chart.BeginUpdate(); _chart.Name = "LightningChart Bars chart"; _chart.Title.Text = "aardio LightningChart demo - Vertical bars"; _chart.Dock = 5;//DockStyle.Fill; // Configure x-axis. _chart.ViewXY.XAxes.Item[0].ScrollMode = 0;//XAxisScrollMode.None; _chart.ViewXY.XAxes.Item[0].Visible = false; // Configure y-axis. _chart.ViewXY.YAxes.Item[0].SetRange(0, 60); var yValues = { 10, 20, 35, 50, 58, 45, 30, 25, 20, 5 }; import color var BarColors = { color.argb(19,145,188,255),//light blue color.argb(18,166,141,255),//green color.argb(10,255,153,255),//light green color.argb(69,219,69,255),//light green color.argb(254,204,0,255),//yellow color.argb(255,127,0,255),//orange color.argb(247,75,75,255),//redorange color.argb(211,51,132,255),//magenta color.argb(156,75,226,255),//purple color.argb(49,74,163,255)//blue }; for(bar=1;10;1){ var bs = Chart.SeriesXY.BarSeries(_chart.ViewXY, _chart.ViewXY.XAxes.Item[0], _chart.ViewXY.YAxes.Item[0]); bs.AddValue(bar-1,yValues[bar],"Data " + bar,false); bs.Fill.Color = BarColors[bar]; _chart.ViewXY.BarSeries.Add(bs); } _chart.EndUpdate(); winform.show(); win.loopMessage();
1 个回复 | 最后更新于 2022-03-06
admin
2022-03-13
#1
登录后方可回帖