图形

一个基于图论的 Flutter 数据可视化库。

用法

安装

pub.dev

基本示例

graphic.Chart(
  data: [
    { 'genre': 'Sports', 'sold': 275 },
    { 'genre': 'Strategy', 'sold': 115 },
    { 'genre': 'Action', 'sold': 120 },
    { 'genre': 'Shooter', 'sold': 350 },
    { 'genre': 'Other', 'sold': 150 },
  ],
  scales: {
    'genre': graphic.CatScale(
      accessor: (map) => map['genre'] as String,
    ),
    'sold': graphic.LinearScale(
      accessor: (map) => map['sold'] as num,
      nice: true,
    )
  },
  geoms: [graphic.IntervalGeom(
    position: graphic.PositionAttr(field: 'genre*sold'),
  )],
  axes: {
    'genre': graphic.Defaults.horizontalAxis,
    'sold': graphic.Defaults.verticalAxis,
  },
)

文档

如果您曾经使用过基于图形语法的可视化库,例如 AntV , ggplot2,您应该对这些概念非常熟悉。

文档尚未编写,但通过参考 示例应用,我相信您足够聪明来构建您的图表:)

GitHub

https://github.com/entronad/graphic