/**
 * @author  daya
 * @createDate  2021/11/15 10:51
 * 备注:公共legend,让每个图表自选
 **/
import { defaultColor, defaultFontSize, labelStyle, fontSize } from '../../../charts'
export const fontStyle = {
  color: defaultColor,
  fontSize: defaultFontSize
}
let commonLegend = {
  legendStyle: {
    show: false
  },
  legendStyle1: {
    show: true,
    itemWidth: 12,
    itemHeight: 12,
    itemGap: 18,
    icon: 'circle',
    textStyle: {
      ...fontStyle
    }
  },
  legendStyle2: {
    top: '8%',
    right: '5%',
    textStyle: {
      ...labelStyle
    }
  },
  legendStyle3: {
    orient: 'vertical',
    left: 'left',
    textStyle: {
      ...fontStyle
    }
  },
  legendStyle4: {
    top: '5%',
    left: 'center',
    textStyle: {
      color: defaultColor,
      fontSize: defaultFontSize
    }
  },
  legendStyle5: {
    left: 'center',
    top: 'bottom',
    data: [
      'rose1',
      'rose2',
      'rose3',
      'rose4',
      'rose5',
      'rose6',
      'rose7',
      'rose8'
    ]
  },
  legendStyle6: {
    top: 'bottom',
    textStyle: {
      ...fontStyle
    }
  },
  legendStyle7: {
    type: 'scroll',
    orient: 'horizontal',
    top: 10,
    right: 0,
    data: [],
    textStyle: {
      ...fontStyle
    }
  },
  legendStyle8: {
    bottom: 10,
    left: 'center',
    data: [],
    textStyle: {
      ...fontStyle
    }
  },
  legendStyle9: {
    data: [],
    textStyle: {
      ...fontStyle
    }
  },
  legendStyle10: {
    show: false
  },
  legendStyle11: {
    top: '0%',
    left: 'center',
    textStyle: {
      color: defaultColor,
      fontSize: defaultFontSize
    }
  },
  legendStyle12: {
    icon: 'rect',
    top: '8%',
    right: '5%',
    itemWidth: 15,
    itemHeight: 15,
    textStyle: {
      ...labelStyle
    }
  },
  legendStyle13: {
    show: true,
    itemWidth: 6,
    itemHeight: 6,
    itemGap: 18,
    icon: 'rect',
    top: '0%',
    left: '0%',
    textStyle: {
      ...fontStyle
    }
  },
  legendStyle31: {
    icon: 'rect',
    top: '0%',
    align: 'left',
    left: '0%',
    itemWidth: 6,
    itemHeight: 6,
    itemGap: 22,
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 5],
      fontSize: fontSize(16),
      color: '#fff',
      lineHeight: 16,
      fontWeight: 500
    }
  },
  legendStyle32: {
    icon: 'diamond',
    top: '10%',
    align: 'left',
    orient: 'vertical',
    right: '0%',
    itemWidth: 11,
    itemHeight: 11,
    itemGap: 70,

    textStyle: {
      ...labelStyle,
      ...fontStyle,
      padding: [0, 0, 0, 5],
      // fontSize: 16,
      color: '#fff',
      lineHeight: 16,
      fontWeight: 500
    }
  },
  legendStyle33: {
    icon: 'diamond',
    top: '0%',
    // align: 'left',
    orient: 'vertical',
    right: '0%',
    itemWidth: 11,
    itemHeight: 11,
    itemGap: 20,
    formatter: '{span|{c}}',
    // formatter: (name) => {
    //   return `{label|${name}}` + '{c}'
    // },
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 5],
      fontSize: fontSize(16),
      color: '#fff',
      lineHeight: 16,
      fontWeight: 500
      // rich: {
      //   label: {
      //     fontSize: 18,
      //     fontWeight: 400
      //   },
      //   span: {
      //     fontSize: 43
      //   }
      // }
    }
  },
  legendStyle34: {
    icon: 'diamond',
    bottom: '0%',
    left: '0%',
    itemWidth: 11,
    itemHeight: 11,
    itemGap: 30,
    formatter: (name) => {
      return name
    },
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 5],
      fontSize: fontSize(16),
      color: '#fff',
      lineHeight: 16,
      fontWeight: 500
    }
  },
  legendStyle35: {
    top: '5%',
    align: 'left',
    left: 'center',
    itemWidth: 25,
    itemHeight: 13,
    itemGap: 6,
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 5],
      fontSize: fontSize(16),
      color: '#fff',
      lineHeight: 16,
      fontWeight: 500
    }
  },
  legendStyle36: {
    top: '5px',
    align: 'left',
    left: 'center',
    itemWidth: 25,
    itemHeight: 13,
    itemGap: 12,
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 5],
      fontSize: fontSize(16),
      color: '#fff',
      lineHeight: 16,
      fontWeight: 500
    }
  },
  legendStyle37: {
    top: '0px',
    align: 'left',
    left: 'center',
    itemWidth: 20,
    itemHeight: 12,
    itemGap: 12,
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 3],
      fontSize: fontSize(14),
      color: '#fff',
      lineHeight: 14,
      fontWeight: 500
    }
  },
  legendStyle38: {

    top: '15px',
    align: 'left',
    left: 'center',
    itemWidth: 20,
    itemHeight: 12,
    itemGap: 12,
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 3],
      fontSize: fontSize(12),
      color: '#fff',
      lineHeight: 12,
      fontWeight: 500
    }
  },
  legendStyle39: {
    top: '0px',
    align: 'left',
    left: 'center',

    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 3],
      fontSize: fontSize(12),
      color: '#fff',
      lineHeight: 14,
      fontWeight: 500
    }
  },
  legendStyle41: {
    icon: 'rect',
    top: '0%',
    align: 'left',
    left: '0%',
    itemWidth: 6,
    itemHeight: 6,
    itemGap: 22,
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 5],
      fontSize: fontSize(14),
      color: '#fff',
      lineHeight: 14
    }
  },
  legendStyle42: {
    icon: 'rect',
    top: '0%',
    align: 'left',
    left: '0%',
    itemWidth: 6,
    itemHeight: 6,
    itemGap: 22,
    textStyle: {
      ...labelStyle,
      padding: [0, 0, 0, 5],
      fontSize: fontSize(14),
      color: '#fff',
      lineHeight: 14
    }
  }
}
export const legend = {
  ...commonLegend
}
export default legend
