export const legendMap = {
  expInMoneyData: '充值金额',
  orderCountData: '充值笔数',
  outMoneyData: '提现金额',
  cashCountData: '提现数量',
  modifyCoinSubData: '手工减少余额数',
  modifyCoinAddData: '手工新增余额数',
  modifyIncomeSubData: '手工减少收益数',
  modifyIncomeAddData: '手工新增收益数'
};

export const legendData = Object.values(legendMap);

export const seriesData = {
  name: '',
  itemStyle: {
    normal: {
      lineStyle: {
        width: 2
      }
    }
  },
  smooth: true,
  type: 'line',
  data: [],
  animationDuration: 2800,
  animationEasing: 'cubicInOut'
};

export const echartsConfig = {
  xAxis: {
    data: [],
    boundaryGap: false,
    axisTick: {
      show: false
    }
  },
  grid: {
    left: 10,
    right: 10,
    bottom: 20,
    top: 50,
    containLabel: true
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross'
    },
    padding: [5, 10]
  },
  yAxis: [
    {
      type: "value",
      // splitNumber: 4, //设置坐标轴的分割段数
      splitLine: {
        //去除网格线
        show: false,
      },
      axisLine: {
        //y轴线的颜色以及宽度
        show: true,
        lineStyle: {
          color: "#BDBDBD",
          width: 1,
          type: "solid",
        },
      },
      axisLabel: {
        // 设置y轴的文字的样式
        textStyle: {
          show: true,
          color: "#BDBDBD",
          fontSize: "12",
        },
      },
    },
    {
      type: "value",
      splitLine: {
        //去除网格线
        show: false,
      },
      axisLine: {
        //y轴线的颜色以及宽度
        show: true,
        lineStyle: {
          color: "#BDBDBD",
          width: 1,
          type: "solid",
        },
      },
      // splitNumber: 6, //设置坐标轴的分割段数
      axisLabel: {
        formatter: function (v) {
          return v.toFixed(1); //0表示保留小数为0位，1表示1位，2表示2位
        },
      },
    },
  ],
  /* yAxis: {
    axisTick: {
      show: false
    }
  }, */
  legend: {
    data: legendData,
    top: '0px'
  },
  series: []
};

export const generateRandomNumbers = ()=> {
  function getRandomInt(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
  }
  let randomNumbers = [];
  for (let i = 0; i < 7; i++) {
    randomNumbers.push(getRandomInt(100, 300));
  }
  return randomNumbers;
}

