小小儁爺
2024-09-20 328adde6e667404fd3aaf388c6191c5b88e8da92
src/utils/myEcharts.js
@@ -371,7 +371,7 @@
    }
  }
  console.log(titlename,123);
  console.log(titlename, 123)
  // const valdata = [683, 500, 400, 300, 200]
  // const myColor = ['#FF0000', '#FF5511', '#FF8800', '#FFBB00', '#FFFF00']
@@ -3142,3 +3142,104 @@
  return option
}
export function all03(ydata, data) {
  const option = {
    backgroundColor: 'transparent',
    // tooltip: {
    //   formatter: '{b} ({c})'
    // },
    title: {
      text: '各车间当月完工数量',
      left: '50%',
      top: '0%',
      textAlign: 'center',
      textStyle: {
        // color: '#fff',
        color: '#00ffff',
        fontSize: '20',
        fontWeight: 'bolder'
      }
    },
    grid: {
      left: '8%',
      right: '8%',
      bottom: '10%',
      top: '15%',
      containLabel: true
    },
    xAxis: [{
      // gridIndex: 0,
      axisTick: {
        show: false
      },
      axisLabel: {
        show: false
      },
      splitLine: {
        show: false
      },
      axisLine: {
        show: false
      }
    }],
    yAxis: [{
      gridIndex: 0,
      interval: 0,
      // data: yAxisData.reverse(),
      data: ydata.reverse(),
      axisTick: {
        show: false
      },
      axisLabel: {
        show: true,
        textStyle: {
          fontSize: 18,
          color: colorX
        }
      },
      splitLine: {
        show: false
      },
      axisLine: {
        show: false
      }
    }],
    series: [
      {
        type: 'bar',
        xAxisIndex: 0,
        yAxisIndex: 0,
        barWidth: '45%',
        itemStyle: {
          normal: {
            barBorderRadius: 15,
            color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
              offset: 0,
              color: 'rgba(0,255,205,.6)'
            }, {
              offset: 0.8,
              color: 'rgba(41,134,207,1)'
            }], false)
          }
        },
        label: {
          normal: {
            show: true,
            position: 'right',
            textStyle: {
              color: colorX
            },
            fontSize: 18
          }
        },
        data: data.map(i => i.quantity).reverse()
      }
    ]
  }
  return option
}