import { ComponentDescription } from '@vtj/engine';
const components: ComponentDescription = {
  name: 'XChartPie',
  title: '饼图',
  groupId: 'ui',
  categoryId: 'chart',
  package: '@vtj/ui',
  childIncludes: false,
  props: [
    {
      name: 'width',
      defaultValue: '100%',
      setters: 'InputSetter'
    },
    {
      name: 'height',
      defaultValue: '400px',
      setters: 'InputSetter'
    },
    {
      name: 'option',
      defaultValue: undefined,
      setters: 'JSONSetter'
    },
    {
      name: 'dimensions',
      label: '维度',
      title: 'dimensions',
      defaultValue: undefined,
      setters: ['JSONSetter']
    },
    {
      name: 'source',
      title: '函数类型需要返回数据，支持async',
      defaultValue: undefined,
      setters: ['JSONSetter', 'FunctionSetter']
    },
    {
      name: 'optionFactory',
      label: '构建函数',
      title: '自定义函数optionFactory构建echarts option',
      defaultValue: undefined,
      setters: ['FunctionSetter']
    }
  ],
  snippet: {
    props: {
      option: {
        title: {
          text: '饼图样例'
        }
      },
      dimensions: ['product', 'value'],
      source: [
        {
          product: 'Matcha Latte',
          value: 100
        },
        {
          product: 'Milk Tea',
          value: 100
        },
        {
          product: 'Cheese Cocoa',
          value: 100
        },
        {
          product: 'Walnut Brownie',
          value: 100
        }
      ]
    }
  }
};

export default components;
