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

const { source } = dataJson;

export const option = {
  dataset: source,
  dataStyle: {
    backgroud: '#FFFFFF00',
    marginTop: 100,
    marginLeft: 25,
    sortOrder: '0',

    unitTitle: '单位 / 平方米',
    unitName: 'm²',
    unitFontSize: 14,
    unitFontColor: '#738073',

    itemMarginTop: 15,
    itemHeight: 40,

    labelFontSize: 13,
    labelFontColor: '#9ab398',
    labelWidth: 100,
    labelAlign: 'center',

    valueFontSize: 16,
    valueFontColor: '#FFFFFF',

    lineBackgroud: '#000000',
    lineBorderWidth: 1,
    lineBorderColor: '#4D6647',
    lineHeight: 15,
    lineStartColor: '#0B4D2C',
    lineEndColor: '#4DFFB5',
  }
}

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