/**
 * @author  daya
 * @createDate  2021/11/13 22:35
 * 备注:公共tooltip,让每个图表自选
 **/
import {tooltipStyle} from '../../../charts'
let toolStyle = {
  trigger: 'axis',
  ...tooltipStyle
}
let commonTooltip = {
  tooltipStyle: {
    ...toolStyle
  },
  tooltipStyle1: {
    ...toolStyle,
    formatter: params => {
      let item = params[0]
      return `${item.name}<br>${item.data}`
    }
  },
  tooltipStyle2: {
    ...toolStyle,
    formatter: params => {
      let item = params[0]
      return `${item.name}<br>${item.data}人哈哈哈`
    }
  },
  tooltipStyle3: {
    ...toolStyle,
    trigger: 'item',
    formatter: '{a} <br/>{b} : {c} ({d}%)'
  },
  tooltipStyle4: {
    ...toolStyle,
    trigger: 'axis',
    axisPointer: {
      type: 'shadow'
    }
  }
}
export const tooltip = {
  ...commonTooltip
}
export default tooltip
