alibaba / BizGoblin

基于F2 React 移动端可视化图表库

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

confused data

MuYunyun opened this issue · comments

const data = [
  { amount: 20, ratio: 0.1, memo: '学习', const: 'const' },
  { amount: 100, ratio: 0.5, memo: '睡觉', const: 'const' },
  { amount: 10, ratio: 0.05, memo: '吃饭', const: 'const' },
  { amount: 30, ratio: 0.15, memo: '讲礼貌', const: 'const' },
  { amount: 10, ratio: 0.05, memo: '其他', const: 'const' },
  { amount: 20, ratio: 0.1, memo: '运动', const: 'const' },
  { amount: 10, ratio: 0.05, memo: '暂无备注', const: 'const' }
]

In the demo, the const key seems needless, is there any reason to add it?

If so, users must to do an extra convert from origin data.

function convertData(data) {
  return data.map(value => {
    return {
      ...value,
      const: 'const'
    }
  })
}