antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

g2-extensions-indicator #5760

hustcc posted onGitHub

AntV Open Source Contribution Plan(可选)

  • 我同意将这个 Issue 参与 OSCP 计划

Issue 类型

中级任务

任务介绍

对于数组数据,可以使用 line、interval、point 等 mark 去可视化,对于完成度百分比数据,我们可以使用 gauge、liquid 等去可视化。

import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  autoFit: true,
});

chart
  .liquid()
  .data(0.3)
  .style({
    outlineBorder: 4,
    outlineDistance: 8,
    waveLength: 128,
  });

chart.render();

而对于单个数据指标的显示,缺少一个指标卡的组件可视化,当然也确实可以使用 html 去实现,只不过为了保证 G2 覆盖全面,可以在 g2-extentions 中增加一个 @antv/g2-extension-indicator 的包。

使用方式和 API

chart
  .indicator()
  .data(1234.56)
  .title({
    title
  })
  .style({
    formatter: (d) => `羊 ${d}`
  });

实现注意点:

  • 对于画布的大小下,自动指标居中显示

参考说明

样式设计参考:

image

https://procomponents.ant.design/components/statistic-card#%E6%80%BB%E5%88%86%E4%B8%BB%E6%AC%A1%E5%85%B3%E7%B3%BB


pitaokkk认领

posted by pitaokkk over 1 year ago

pitaokkk认领

需要什么帮助吗?

posted by hustcc over 1 year ago

暂时没问题 我周日之前可以赶出来

posted by pitaokkk over 1 year ago

谢谢~

posted by pitaokkk over 1 year ago

我这边临时有些事情 要延迟一些时间

posted by pitaokkk over 1 year ago

非常抱歉 麻烦您unassign我 最近事情有点多 担心耽误您们的进度

posted by pitaokkk over 1 year ago

@pitaokkk 没关系,这个本身也不紧急,按照你的时间即可。或者我先去掉,等你好了在认领。

posted by hustcc over 1 year ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests