dev express 15.2图表绘制性能问题(dotnet绘图表)

dev express 15.2

绘制曲线

  • 前端代码
dotnet 复制代码
<dxc:ChartControl Grid.Row="1">
    <dxc:XYDiagram2D EnableAxisXNavigation="True">
        <dxc:LineSeries2D x:Name="series" CrosshairLabelPattern="{}{A} : {V:F2}"/>
    </dxc:XYDiagram2D>
</dxc:ChartControl>
  • 后端代码
dotnet 复制代码
Dispatcher.BeginInvoke(new Action(() =>
{
    Random random = new Random();
    series.Points.BeginInit();
    series.Points.Clear();
    for (int i = 0; i < 100000; i++)
        series.Points.Add(new SeriesPoint((double)i, random.NextDouble()));
    series.Points.EndInit();
}), DispatcherPriority.Background);

执行的结果图标很卡,一样的代码和dev express的demo性能差距很大

窗口不要最大化,窗口太大显示效率明显降低,devexpress demo最大化之后也存在这个问题。

ScottPlot

dotnet中绘图可以使用scottplot,基于opengl比livechart的基于skia效率高很多

nuget安装scottplot.wpf

  • 前端代码
dotnet 复制代码
xmlns:sp="clr-namespace:ScottPlot;assembly=ScottPlot.WPF"
...
<sp:WpfPlot Grid.Row="1" Name="series"></sp:WpfPlot>
  • 后端代码
dotnet 复制代码
Random random = new Random();
double[] pointCollection = new double[1000000];
Parallel.For(0, 1, (i) =>
{
    for (int j = 0; j < pointCollection.Length; j++)
        pointCollection[j] = random.NextDouble();
});
series.Plot.AddSignal(pointCollection);
Crosshair = series.Plot.AddCrosshair(0, 0);
series.Plot.SetAxisLimitsY(0, 1);
series.Plot.XAxis.SetBoundary(0, pointCollection.Length);
series.Plot.YAxis.LockLimits(true);
series.Refresh();
//MouseMove Event-----------------------------------------------------
(double coordinateX, double coordinateY) = series.GetMouseCoordinates();
Crosshair.X = coordinateX;
Crosshair.Y = coordinateY;
series.Refresh();

scichart

https://www.scichart.com/example/wpf-chart/wpf-line-chart-example/

有免费的版本可以在网上下载

相关推荐
Dumbness1 天前
一个手机号验证码登录接口的五个坑:无限发码、无限试码,传个数字就让 Express 进程退出
node.js·express
星光开发者9 天前
基于springboot智慧草场牛羊管理系统-计算机毕设【课程设计】50360
vue.js·spring boot·后端·mysql·php·课程设计·express
vx_Biye_Design13 天前
django房屋租赁推荐系统78455-计算机课程设计、毕业设计
vue.js·spring boot·后端·python·django·课程设计·express
vx_Biye_Design17 天前
PHP中医养生馆预约系统60841-计算机课程设计、毕业设计
vue.js·spring boot·后端·mysql·php·课程设计·express
夏幻灵18 天前
Express 静态资源托管详解:从本地 HTML 到 express.static()
前端·html·express
毕业设计70320 天前
(免费领源码)基于node的学生公寓管理系统06412- java、PHP、python、C#、小程序、大数据、单片机、网络工程等)
vue.js·mysql·node.js·maven·mybatis·express·b/s
Wx-bishekaifayuan21 天前
springboot桂味美食分享系统40540-计算机课程设计、毕业设计
spring boot·后端·python·django·课程设计·express·旅游
Wx-bishekaifayuan23 天前
express皖美特色农产品网售系统53118-计算机课程设计、毕业设计
人工智能·spring boot·后端·python·课程设计·express·旅游
Wx-bishekaifayuan23 天前
springboot汉中旅游服务平台41442-计算机课程设计、毕业设计
spring boot·后端·python·django·课程设计·express·旅游
Wx-bishekaifayuan24 天前
springboot公考微信小程序35511-计算机课程设计、毕业设计
spring boot·后端·python·django·课程设计·express·旅游