真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

python中怎么利用Element顯示柱狀圖

今天就跟大家聊聊有關(guān)python中怎么利用Element顯示柱狀圖,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。

目前創(chuàng)新互聯(lián)公司已為數(shù)千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、網(wǎng)站空間、網(wǎng)站改版維護(hù)、企業(yè)網(wǎng)站設(shè)計(jì)、羅莊網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

1.前端HTML和CSS


    
        
            
                
                    告警事件TOP 5
                
                                     
                
                                                                                           設(shè)備類型告警TOP 5                                                                                                   

2.前端JS


    new Vue({
        el: '#app',
        data: {
            fullscreenLoading: false
        },
        mounted() {
            // 頁面加載就獲取所有模板
            this.init()
        },
        methods: {
            init() {
                this.fullscreenLoading = true;
                axios.get(site_url + "top5_data/").then(res => {
                    if (res.data.result) {
                        this.fullscreenLoading = false;
                        this.chart1 = echarts.init(document.getElementById('chart1'));
                        this.chart1.setOption({
                            tooltip : {
                                trigger: 'axis',
                                axisPointer : {            // 坐標(biāo)軸指示器,坐標(biāo)軸觸發(fā)有效
                                    type : 'shadow'        // 默認(rèn)為直線,可選為:'line' | 'shadow'
                                }
                            },
                            grid: {
                                left: '3%',
                                right: '4%',
                                bottom: '3%',
                                containLabel: true
                            },
                            xAxis : [
                                {
                                    type : 'value'
                                }
                            ],
                            yAxis : [
                                {
                                    type : 'category',
                                    data : res.data.data.top5_title_res.title_list,
                                    axisTick: {
                                        alignWithLabel: true
                                    }
                                }
                            ],
                            series : [
                                {
                                    name:'數(shù)量',
                                    type:'bar',
                                    barWidth: '40%',
                                    data: res.data.data.top5_title_res.count_list
                                }
                            ]
                        });

                        this.chart2 = echarts.init(document.getElementById('chart2'));
                        this.chart2.setOption({
                            tooltip : {
                                trigger: 'axis',
                                axisPointer : {            // 坐標(biāo)軸指示器,坐標(biāo)軸觸發(fā)有效
                                    type : 'shadow'        // 默認(rèn)為直線,可選為:'line' | 'shadow'
                                }
                            },
                            grid: {
                                left: '3%',
                                right: '4%',
                                bottom: '3%',
                                containLabel: true
                            },
                            xAxis : [
                                {
                                    type : 'value'
                                }
                            ],
                            yAxis : [
                                {
                                    type : 'category',
                                    data : res.data.data.top5_device_type_res.type_list,
                                    axisTick: {
                                        alignWithLabel: true
                                    }
                                }
                            ],
                            series : [
                                {
                                    name:'數(shù)量',
                                    type:'bar',
                                    barWidth: '40%',
                                    data: res.data.data.top5_device_type_res.count_list
                                }
                            ]
                        });
                    } else {
                        this.fullscreenLoading = false;
                        this.$message.error('請(qǐng)求失敗')
                    }
                },'json');
            }
        }
    })

3.Django代碼

top5_data/接口返回?cái)?shù)據(jù)

{
    "top5_title_res": {
        "count_list": [18268, 18273, 18309, 30361, 30398],
        "title_list": [
            "1.18.6.11發(fā)生進(jìn)程端口告警",
            "1.18.6.20發(fā)生進(jìn)程端口告警",
            "1.18.6.13發(fā)生進(jìn)程端口告警",
            "1.18.6.18發(fā)生進(jìn)程端口告警",
            "1.18.6.9發(fā)生進(jìn)程端口告警"
        ]
    },
    "top5_device_type_res": {
        "type_list": ["中央處理器", "內(nèi)存", "硬盤", "基本警報(bào)", "端口"],
        "count_list": [16029, 24217, 51166, 140975, 170223]
    }
}

實(shí)現(xiàn)效果

python中怎么利用Element顯示柱狀圖

python中怎么利用Element顯示柱狀圖

看完上述內(nèi)容,你們對(duì)python中怎么利用Element顯示柱狀圖有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。


當(dāng)前題目:python中怎么利用Element顯示柱狀圖
標(biāo)題URL:http://weahome.cn/article/gsgpeo.html

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部