export const options = {
  grid: {
    top: "5%",
    bottom: "5%",
    left: "3%",
    right: "3%",
    containLabel: true,
  },
  xAxis: {
    type: "category",
    data: [],
    axisLabel: {
      fontSize: 24,
    },
  },
  yAxis: {
    type: "value",
    axisLabel: {
      fontSize: 24,
    },
    minInterval: 1,
  },
  series: [
    {
      data: [],
      type: "bar",
      showBackground: true,
      backgroundStyle: {
        color: "rgba(180, 180, 180, 0.2)",
      },
    },
  ],
};

export default function setup(echartInstance, timeArr, dataArr) {
  const options = { ...options };
  options.xAxis.data = timeArr;
  options.series[0].data = dataArr;
  echartInstance.setOption(options);
}
