/**
 * @author  daya
 * @createDate  2021/11/15 16:50
 * 备注:************
 **/
import { defaultColor, defaultFontSize } from '../../../../charts'
export const fontStyle = {
  color: defaultColor,
  fontSize: defaultFontSize
}
const seriesStyle = {
  type: 'bar',
  data: []
}
const seriesStyle1 = {
  ...seriesStyle,
  type: 'bar',
  barMaxWidth: '33%',
  barWidth: '30%',
  itemStyle: {
    barBorderRadius: 3
  },
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000))
}
const seriesStyle2 = {
  type: 'bar',
  barMaxWidth: '33%',
  barWidth: '30%',
  itemStyle: {
    barBorderRadius: 3
  },
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  label: {
    show: true,
    position: 'insideRight',
    distance: -60,
    ...fontStyle,
    formatter: params => params.data + '%'
  }
}
const seriesStyle3 = {
  barMaxWidth: '20%',
  borderRadius: [0, 0, 0, 0],
  barWidth: 20,
  data: [],
  type: 'bar'
}
const seriesStyle4 = {
  ...seriesStyle3,
  showBackground: true,
  backgroundStyle: {
    color: 'rgba(255, 255, 255, .1)',
    borderWidth: 4,
    borderColor: 'rgba(255, 255, 255, .1)'
  }
}
const seriesStyle5 = {
  ...seriesStyle1,
  name: 'test',
  type: 'bar',
  data: [],
  showBackground: true,
  barMaxWidth: '50%',
  barWidth: 20,
  barGap: '1%',
  color: [
    {
      type: 'linear',
      x: 0,
      y: 0,
      x2: 0,
      y2: 1,
      colorStops: [{ offset: 0, color: '#00FFFC' }, { offset: 1, color: '#002363' }]
    }],
  itemStyle: {
    color: '#40B7D9'
  },
  backgroundStyle: {
    color: 'rgba(0, 35, 99, 1)',
    borderWidth: 4,
    borderColor: 'rgba(0, 35, 99, 1)'
  }
}
const seriesStyle6 = {
  type: 'bar',
  barMaxWidth: '30%',
  barWidth: 15,
  stack: '旅游类',
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000))
}
const seriesStyle7 = {
  barMaxWidth: '30%',
  borderRadius: [55, 55, 0, 0],
  barWidth: 10,
  data: [],
  type: 'bar',
  itemStyle: {
    label: {
      show: true,
      position: 'top',
      // 数值样式
      textStyle: {
        color: defaultColor,
        fontSize: defaultFontSize
      }
    },
    barBorderRadius: [20, 20, 0, 0]
  }
}
const seriesStyle8 = {
  type: 'bar',
  barMaxWidth: '24%',
  barWidth: 12,
  stack: '出行方式分析',
  data: []
}
const seriesStyle9 = {
  ...seriesStyle,
  'barGap': '0'
}
const seriesStyle10 = [
  {
    name: 'Direct',
    type: 'bar',
    emphasis: {
      focus: 'series'
    },
    markLine: {
      lineStyle: {
        type: 'dashed'
      },
      data: [[{ type: 'min' }, { type: 'max' }]]
    },
    data: [320, 332, 301, 334, 390, 330, 320]
  },
  {
    name: 'Email',
    type: 'bar',
    stack: 'Ad',
    emphasis: {
      focus: 'series'
    },
    data: [120, 132, 101, 134, 90, 230, 210]
  },
  {
    name: 'Union Ads',
    type: 'bar',
    stack: 'Ad',
    emphasis: {
      focus: 'series'
    },
    data: [220, 182, 191, 234, 290, 330, 310]
  },
  {
    name: 'Video Ads',
    type: 'bar',
    stack: 'Ad',
    emphasis: {
      focus: 'series'
    },
    data: [150, 232, 201, 154, 190, 330, 410]
  },
  {
    name: 'Search Engine',
    type: 'bar',
    data: [],
    emphasis: {
      focus: 'series'
    }
  },
  {
    name: 'Baidu',
    type: 'bar',
    barWidth: 5,
    stack: 'Search Engine',
    emphasis: {
      focus: 'series'
    },
    data: []
  },
  {
    name: 'Google',
    type: 'bar',
    stack: 'Search Engine',
    emphasis: {
      focus: 'series'
    },
    data: []
  },
  {
    name: 'Bing',
    type: 'bar',
    stack: 'SearchEngine',
    emphasis: {
      focus: 'series'
    },
    data: []
  },
  {
    name: 'Others',
    type: 'bar',
    stack: 'SearchEngine',
    emphasis: {
      focus: 'series'
    },
    data: []
  }
]
const seriesStyle11 = {
  ...seriesStyle3,
  showBackground: true,
  barMaxWidth: '25%',
  barWidth: 20,
  backgroundStyle: {
    color: 'rgba(255, 255, 255, 0.05)',
    borderWidth: 1,
    borderColor: 'rgba(255, 255, 255, 0.05)'
  }
}
const seriesStyle12 = {
  type: 'bar',
  barMaxWidth: '33%',
  barWidth: '30%',
  itemStyle: {
    barBorderRadius: 3
  },
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  label: {
    show: true,
    position: 'top',
    distance: 0,
    ...fontStyle,
    formatter: params => {
      return params.data + '\n' + params.name.substring(5, 7)
    }
  }
}
const seriesStyle13 = {
  type: 'bar',
  barMaxWidth: '33%',
  barWidth: '30%',
  itemStyle: {
    barBorderRadius: 3
  },
  data: Array(4).fill(0).map(item => Math.round(Math.random() * 100000)),
  label: {
    show: true,
    position: 'top',
    distance: 0,
    ...fontStyle,
    formatter: params => {
      return params.data + '\n' + params.name.substring(5, 7)
    }
  }
}
const seriesStyle14 = {
  barMaxWidth: '15%',
  borderRadius: [0, 0, 0, 0],
  barWidth: 15,
  data: [],
  type: 'bar',
  showBackground: true,
  backgroundStyle: {
    color: 'rgba(255, 255, 255, .1)',
    borderWidth: 4,
    borderColor: 'rgba(255, 255, 255, .1)'
  }
}
const seriesStyle15 = {
  barMaxWidth: '15%',
  borderRadius: [0, 0, 0, 0],
  barWidth: 15,
  data: [],
  type: 'bar',
  showBackground: true,
  backgroundStyle: {
    color: 'rgba(255, 255, 255, .2)',
    borderWidth: 0,
    borderColor: 'rgba(255, 255, 255, .1)'
  }
}

const seriesStyle16 = {
  barMaxWidth: '20%',
  itemStyle: {
    barBorderRadius: 5
  },
  barWidth: 20,
  data: [],
  type: 'bar',
  showBackground: false
}

const seriesStyle31 = {
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  type: 'bar',
  showBackground: true,
  barWidth: 6,
  backgroundStyle: {
    color: 'rgba(255, 255, 255, .1)',
    borderWidth: 0,
    borderColor: 'rgba(255, 255, 255, .1)'
  }
}
const seriesStyle32 = {
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  type: 'bar',
  showBackground: false,
  barWidth: 12

}
const seriesStyle33 = {
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  type: 'bar',
  showBackground: false,
  stack: 'total',
  barWidth: 12

}
const seriesStyle34 = {
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  type: 'bar',
  itemStyle: {
    emphasis: {
    },
    normal: {
      barBorderRadius: 6

    }
  },
  markPoint: {
    label: {
      color: '#fff',
      formatter: function (params) {
        return params.value + '人'
      }
    },
    data: [
      { type: 'max', name: 'Max' }
    ]
  },
  showBackground: false,
  barWidth: 20

}
const seriesStyle41 = {

  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  type: 'bar',
  showBackground: true,
  barWidth: 6,
  barGap: '100%',
  barCategoryGap: '50%',
  itemStyle: {
    barBorderRadius: 0
  },
  backgroundStyle: {
    color: 'rgba(255, 255, 255, .1)',
    borderWidth: 0,
    borderColor: 'rgba(255, 255, 255, .1)'
  }
}

const seriesStyle42 = {
  data: Array(5).fill(0).map(item => Math.round(Math.random() * 100000)),
  type: 'bar',
  showBackground: true,
  barWidth: 8,
  barGap: '100%',
  // barCategoryGap: '5%',
  itemStyle: {
    barBorderRadius: 0
  },
  backgroundStyle: {
    color: 'rgba(255, 255, 255, .1)',
    borderWidth: 0,
    borderColor: 'rgba(255, 255, 255, .1)'
  }
}

export const barSeries = {
  seriesStyle1,
  seriesStyle2,
  seriesStyle3,
  seriesStyle4,
  seriesStyle5,
  seriesStyle6,
  seriesStyle7,
  seriesStyle8,
  seriesStyle9,
  seriesStyle10,
  seriesStyle11,
  seriesStyle12,
  seriesStyle13,
  seriesStyle14,
  seriesStyle31,
  seriesStyle41,
  seriesStyle15,
  seriesStyle16,
  seriesStyle32,
  seriesStyle33,
  seriesStyle42,
  seriesStyle34

}
// 导出
export default barSeries
