智慧园区前端大屏
src/views/survey/components/box/dataContent.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-11-04 16:32:04
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-20 19:01:15
 * @LastEditTime: 2024-11-27 15:44:25
 * @FilePath: \bigScreen\src\views\survey\components\box\dataContent.vue
 * @Description:
 *
@@ -17,7 +17,9 @@
let $echarts = inject("echarts")
const curEcharts = ref(null)
let myEcharts = reactive(null)
let myEcharts = reactive({
  chart: ''
})
const echartsColors = ['#1E90FF', '#36A2EB', '#FFD700', '#FFA500', '#228B22', '#8FBC8F']
@@ -30,7 +32,7 @@
      yaxis_data.push(element.num)
    })
    myEcharts.setOption({
    myEcharts.chart.setOption({
      tooltip: {
        trigger: "axis",
        axisPointer: {
@@ -71,12 +73,10 @@
            interval: 0, //设置为 1,表示『隔一个标签显示一个标签』
            margin: 15,
            rotate: 45, //调整数值改变倾斜的幅度(范围-90到90)
            textStyle: {
              color: "#fff",
              fontStyle: "normal",
              fontFamily: "微软雅黑",
              fontSize: 12,
            },
            color: "#fff",
            fontStyle: "normal",
            fontFamily: "微软雅黑",
            fontSize: 12,
          },
        },
      ],
@@ -125,12 +125,12 @@
}
nextTick(() => {
  myEcharts = $echarts.init(curEcharts.value)
  myEcharts.chart = $echarts.init(curEcharts.value)
  getStatistic()
})
const echartsResize = () => {
  myEcharts && myEcharts.resize()
  myEcharts.chart && myEcharts.chart.resize()
}
useEchartsResize(echartsResize)