Flutter图表库fl_chart的使用解析(二)-折线图,金九银十

MacBook-Pro:~ xun$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64, locale
zh-Hans)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
[!] Xcode - develop for iOS and macOS
! CocoaPods 1.9.1 out of date (1.10.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side’s plugin
code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see
https://guides.cocoapods.org/using/getting-started.html#installation for
instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.55.2)
[✓] Connected device (2 available)

一 基本集成

折线图是一个 Widget,和普通 Widget一样声明即可:

LineChart(
sampleData(),
),

LineChart的构造参数是一个LineChartData,其属性如下:

属性名称 描述 默认值
lineBarsData 图表要展示的线的数组,数组的每一位代表一条线。 []
betweenBarsData 填充2条图表线之间的区域 []
titlesData 坐标,可以设置四个方向的标题 FlTitlesData()
axisTitleData 标题 FlAxisTitleData()
extraLinesData 额外的水平和垂直线的图形细节
lineTouchData 触摸交互详细信息 LineTouchDa
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值