index.config.ts 1 KB
import type { EChartsOption } from 'echarts'
import { isLightboxMode } from '@/utils/env'
export const defaultOption = (): EChartsOption => {
  return {
    tooltip: {
    },
    calculable: true,
    xAxis:
      {
        type: 'category',
        // prettier-ignore
        data: isLightboxMode() ? [] : ['Jan', 'Feb', 'Mar', 'Apr', 'May'],
      },

    legend: {
      top: '8%',
      left: 'center',
      data: [''],
    },

    grid: {
      top: '25%',
      left: '6%',
      right: '10%',
      bottom: '8%',
      containLabel: true,
    },
    yAxis:
      {
        type: 'value',
      },
    series: [
      {
        name: 'Rainfall',
        type: isLightboxMode() ? 'line' : 'bar',
        data: isLightboxMode()
          ? []
          : [
              25.6, 76.7, 42.0, 27.0, 23.2,
            ],
      },
      {
        name: 'Evaporation',
        type: 'bar',
        data: isLightboxMode()
          ? []
          : [
              28.7, 32.6, 70.7, 29.0, 26.4,
            ],
      },
    ],
  }
}