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

const { source } = dataJson;

export const option = {
  dataset: source,
  dataStyle:{
    backgroud: '#FFFFFF00',
    marginTop: 10,
    marginLeft: 20,
    listMarginTop: 0,

    dotColor: '#C9FFC7',
    dotSize: 12,
    dotMarginLeft: 10,
    dotMarginRight: 10,

    titleWidth: 80,
    titleHeight: 20,
    titleFontcolor: '#CBE6CD',
    titleFontsize: 16,

    contentWidth: 250,
    contentFontcolor: '#FFFFFF',
    contentFontsize: 16,
    contentAlign: 'left',
  }
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = HuoQingDetailInfoConfig.key
  public attr = { ...chartInitConfig, w: 320, h: 220, zIndex: -1 }
  public chartConfig = cloneDeep(HuoQingDetailInfoConfig)
  public option = cloneDeep(option)
  public filter = "return res.result;"
}