打造自己的树莓派监控系统3--canvas.js绘制数据
发布日期:2022-03-18 18:19:19
浏览次数:5
分类:技术文章
本文共 943 字,大约阅读时间需要 3 分钟。
系列文章:
- 文章1:
- 文章2:
- 文章3:
- GitHub仓库:
介绍
前面2篇文章都是使用matplotlib画图的,但当数据量较多时matplotlib的显示和交互性不让我满意,所以我使用canvas.js绘图。
canvasjs介绍:JavaScript Charts & Graphs with 10x better performance and a simple API. Integrates easily with popular JS Frameworks like AngularJS, etc. Library comes with 30 different types of charts including line, column, bar, area, spline, pie, doughnut, stacked charts, etc. It supports various interactive features like tooltips, zooming, panning, animation, events, drilldown, exporting and can easily be integrated with various server side technologies like PHP, Ruby, Python, , Node.JS, Java, etc. To top it all off, it can easily render thousands of data-points without any performance lag.使用canvas.js
flask代码:
@app.route('/', methods=['GET'])def main(): temperature = get_temperature() mem, MemTotal = get_mem() return render_template('index.html', temperature=temperature, mem=mem, MemTotal=MemTotal)
HTML核心代码:
效果图如下:
转载地址:https://zhang0peter.blog.csdn.net/article/details/84819958 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
第一次来,支持一个
[***.219.124.196]2024年04月18日 03时55分47秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
JavaScript学习总结(一)——JavaScript基础
2021-07-01
JavaScript学习总结(二)——逻辑Not运算符详解
2021-07-01
JavaScript学习总结(四)——逻辑OR运算符详解
2021-07-01
JavaScript学习总结(七)——JavaScript函数(function)
2021-07-01
JavaScript学习总结(八)——JavaScript数组
2021-07-01
JavaScript学习总结(九)——Javascript面向(基于)对象编程
2021-07-01
Spring IoC 容器
2021-07-01
Spring Beans 自动装配
2021-07-01
Spring BeanFactory 容器
2021-07-01
Spring ApplicationContext 容器
2021-07-01
Spring Bean 定义
2021-07-01
Spring Bean 作用域
2021-07-01
Spring Bean 生命周期
2021-07-01
Spring Bean 后置处理器
2021-07-01
Spring Bean 定义继承
2021-07-01
Spring 基于构造函数的依赖注入
2021-07-01
Spring 基于设值函数的依赖注入
2021-07-01
Spring 注入内部 Beans
2021-07-01
Spring 注入集合
2021-07-01
Spring 自动装配 ‘byName’
2021-07-01