import * as echarts from "echarts";
const getColumnChart = (nameList, valueList, isPer) => {
  const colorList = ['#0958D9', '#0958D9']
  return {
    grid: {
      top: 30,
      height: 300,      // 关键：压矮整个图
      bottom: 40, // 给 X 轴文字留位置
      left: 40
    },
    xAxis: [
      {
        data: [
          "研发投入",
          "科技人才",
          "创新主体",
          "科学数据",
          "科研仪器",
        ],
        axisLabel: {
          color: "#84888F",
          fontSize: 16,

        },
        axisTick: {
          show: false
        },
        axisLine: {
          show: false
        }
      }
    ],
    yAxis: [
      {

        nameTextStyle: {
          color: "#8CB5E2"
        },
        splitLine: {
          show: true,
          lineStyle: {
            type: "dashed",
            color: "#E7F3FF"
          }
        },
        axisLabel: {
          color: "#84888F",
          fontSize: 14,
        }
      }
    ],
    graphic: [{                 // 右上角单位
      type: 'text',
      right: 20,
      top: 10,
      style: { text: '单位：次', font: '14px sans-serif', fill: '#666' }
    }],
    // 使用内部缩放（滚轮缩放、鼠标拖着左右滑动）
    dataZoom: [
      {
        type: "inside",
        minValueSpan: 6, // 最小展示数
        start: 0, // 开始展示位置（默认）
        end: 5 // 结束展示位置 （默认）
      }
    ],
    series: [
      {
        name: "hill",
        // 象柱形图
        type: "pictorialBar",
        // 同一系列的柱间距离
        barCategoryGap: "-60%",
        // 自定义svg 图标 (三角锥形的关键)
        symbol: "path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z",
        // 默认就把数值显示在顶部
        label: {
          show: true,
          position: 'top',
          distance: 4,                 // 与柱顶距离
          color: 'rgba(5, 95, 194, 1)',               // 字体颜色
          fontSize: 16
        },
        // 默认样式
        itemStyle: {
          label: {
            show: false
          },
          borderColor: "#4286D1",
          borderWidth: 0,
          color: {
            colorStops: [
              {
                offset: 0,
                color: "rgba(66,134,209, 1)"
              },
              {
                offset: 1,
                color: "rgba(66,134,209, 0)"
              }
            ]
          }
        },
        // 鼠标滑过样式
        emphasis: {
          label: {
            show: true,
            position: "top",
            color: "#12DCFF"
          },
          itemStyle: {
            borderColor: "#17cdfa",
            borderWidth: 2,
            color: {
              colorStops: [
                {
                  offset: 0,
                  color: "rgba(0,238,255, 0.09)"
                },
                {
                  offset: 1,
                  color: "rgba(23,205,250, 0.5)"
                }
              ]
            }
          }
        },
        data: [
          227,
          194,
          182,
          120,
          99,
        ],
        z: 10
      }
    ]
  }
}
export default getColumnChart