当前位置:网站首页>Flutter Chart
Flutter Chart
2022-08-08 18:55:00 【51CTO】
最近要在一个flutter的应用上实现图表,在官方的库里找到了一个现成的chart library。
pub.dev的地址:
https://pub.flutter-io.cn/packages/charts_flutter
这个库应该是google官方自己实现的,github的地址是:
https://github.com/google/charts
他们有一个案例页面:
https://google.github.io/charts/flutter/gallery.html
使用前,请先在项目根目录下使用pub get进行安装:
接着在项目的pubspec.yaml中添加依赖:
之后,就可以在dart文件中使用了。
我在lib文件夹下新建了一个pie.dart 的文件:
这个文件实现了两个基本类,LinearSales是数据格式,SimplePieChart实现了一个简单的饼图。
在main.dart中引用了pie.dart,具体的实现使用了官方例子中的SimplePieChart的代码。
项目的git: https://gitee.com/stewart71/flutter_chart_example
以后如果用到其他chart,还会继续更新。
边栏推荐
- 第4讲:SQL语句之DDL类型的数据库定义语言
- How to add F4 Value Help trial version to the input parameters of the report in the ABAP report
- 面了个腾讯30k+出来的,他让我见识到什么叫精通MySQL调优
- 干货:从零设计高并发架构
- FastDFS distributed file system
- 达梦数据库 DmAPservice服务,启停影响 DMSERVER库服务吗?
- uniapp parent component uses prop to pass asynchronous data to child components
- CAD进阶练习(二)
- 我们想更换RDS数据库,从sqlserver 2016 web升级到 2017企业集群版,有专家咨询
- Fortinet new cloud native protection products launched amazon cloud platform of science and technology
猜你喜欢
随机推荐
DHCP服务初探
BP神经网络
OpenInfra Days China 2022即将开启,与 openEuler 共话开源技术
Michael Bronstein 系列长文:迈向几何深度学习(之三)——第一个几何神经网络模型
Laravel 5.8 Notes
Geometric g6 will carry harmonyos system, a comprehensive upgrade competitiveness of products
hdu2647 N!Again
FastDFS distributed file system
Which company is the best for futures account opening? It must be formal and safe
8月报考季,软考选科目避坑指南来啦
oracle视图v$active_session_history,dba_hist_active_session_history如何记录IP地址
Monaco-Editor 多人协作 编辑器
Redhat 7 Maria DB installation and configuration
SUSECON 北京议程上新丨8月16日相聚望京凯悦
堆排序(Heap Sort)实现
重读GPDB 和 TiDB 论文引发的 HTAP 数据库再思考
Monaco-Editor Multiplayer Collaboration Editor
C language elementary - structure
A Preliminary Study on Pannellum, a Lightweight Panorama Viewer
干货技巧|如何用3DsMax制作笔记本电脑









