import * as echarts from "echarts";

const getBarChart = (nameList, valueList, isPer) => {
  const option = {
    title: { text: '' },
    // legend: {
    //   icon: 'circle',
    //   orient: 'vertical',      // 纵向排列
    //   right: 0,                // 贴右边
    //   top: 'center',           // 垂直居中
    //   align: 'left',           // 文字在图标左侧
    //   data: ['中国', '美国']
    // },
    radar: {
      radius: '50%',          // 关键：缩小整个雷达
      indicator: [
        { name: '能源', max: 6500 },
        { name: '集成电路', max: 16000 },
        { name: '人工智能', max: 30000 },
        { name: '通信网络', max: 38000 },
        { name: '量子科技', max: 52000 },
        { name: '生物科技', max: 25000 }
      ],
      axisName: {
        formatter: '{value}',
        color: 'rgba(59, 65, 75, 1)',
        fontSize: 16,
        fontWeight: 700
      }
    },
    series: [
      {
        name: 'Budget vs spending',
        type: 'radar',
        data: [
          {
            value: [4200, 3000, 20000, 35000, 50000, 18000],
            name: '中国',
            areaStyle: { color: 'rgba(10, 87, 166, 0.2)' }
          },
          {
            value: [5000, 14000, 28000, 26000, 42000, 21000],
            name: '美国',
            areaStyle: { color: 'rgba(206, 79, 81, 0.2)' }
          },

        ]
      }
    ]
  }
  return option
}

export default getBarChart