index.config.ts 1.1 KB
import { isLightboxMode } from '@/utils/env'

const data = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
const seriesList = [
  { value: 120, name: '123', itemStyle: { color: '#5470c6' } },
  { value: 150, name: '456', itemStyle: { color: '#5470c6' } },
  { value: 40, name: '789', itemStyle: { color: '#5470c6' } },
  { value: 139, name: '111', itemStyle: { color: '#5470c6' } },
  { value: 130, name: '222', itemStyle: { color: '#5470c6' } },
  { value: 125, name: '333', itemStyle: { color: '#5470c6' } },
  { value: 110, name: '444', itemStyle: { color: '#5470c6' } },
]
export const defaultOption = {
  color: ['#3398DB'],
  tooltip: {
    // 提示框
    trigger: 'item',
    confine: true,
    axisPointer: {
      type: 'shadow',
    },
  },
  xAxis: {
    type: 'category',
    data: isLightboxMode() ? [] : data,
    axisTick: {
      alignWithLabel: true,
    },
  },
  grid: {
    top: '10%',
    left: '10%',
    bottom: '10%',
  },
  yAxis: {
    type: 'value',
  },
  series: [
    {
      name: '',
      type: 'bar',
      barWidth: '60%',
      data: isLightboxMode () ? [] : seriesList,
    },
  ],
}