智慧园区前端大屏
linwe
2024-11-04 015854c3952f95d88b8080ea410b35e41cf39bdb
src/views/survey/components/box/dataContent.vue
@@ -23,13 +23,12 @@
function getStatistic() {
    getRescueTeamStatistic().then(res => {
        let xaxis_data = []
        res.data.data.forEach(element => {
            xaxis_data.push(element.type)
        });
        let yaxis_data = []
        res.data.data.forEach(element => {
            xaxis_data.push(element.type)
            yaxis_data.push(element.num)
        });
        myEcharts.setOption({
            tooltip: {
                trigger: 'axis',
@@ -37,15 +36,32 @@
                    type: 'shadow'
                }
            },
            xAxis: {
                data: xaxis_data
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            yAxis: {},
            xAxis: [
                {
                    type: 'category',
                    data: xaxis_data,
                    axisTick: {
                        alignWithLabel: true
                    }
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: 'Direct',
                    type: 'bar',
                    data: yaxis_data,
                    barWidth: '30%'
                    barWidth: '30%',
                    data: yaxis_data
                }
            ]
        })