import cloneDeep from 'lodash/cloneDeep'
import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { chartInitConfig } from '@/settings/designSetting'
import { WuRenJiFeiXingShuJuConfig } from './index'
import dataJson from './data.json'

const { source } = dataJson;

export const option = {
  dataset: source,
  dataStyle: {
    backgroud: '#FFFFFF00',
    margintop: 15,
    marginleft: 20,
    gap: 16,

    topMarginTop: 5,
    iconSize: 45,
    iconX: 12,
    iconY: 12,
    topWidth: 80,
    topHeight: 80,
    rectStrokeColor: '#00611A',
    rectFillColor: '#0A251E',
    gFillColor: '#4FE985',

    bottomFontColor1: '#A4F9AB',
    bottomFontSize1: 20,
    bottomFontColor2: '#FFFFFF',
    bottomFontSize2: 12,
    bottomFontColor3: '#FFFFFF',
    bottomFontSize3: 12,
    lineColor: '#A4F9AB',
    bottomMarginTop: 16,
    bottomWidth: 80,
    bottomHeight: 80 * 97 / 71,
  },
  dataStyleClone: {
    rectStrokeColor: '#00611A',
    rectFillColor: '#0A251E',
    gFillColor: '#4FE985',
  }
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = WuRenJiFeiXingShuJuConfig.key
  public attr = { ...chartInitConfig, w: 400, h: 240, zIndex: -1 }
  public chartConfig = cloneDeep(WuRenJiFeiXingShuJuConfig)
  public option = cloneDeep(option)
}
