首页 > 其他分享 >大屏数据可视化项目需要注意什么问题?

大屏数据可视化项目需要注意什么问题?

时间:2022-12-16 01:33:25浏览次数:36  
标签:false name show color value var 可视化 注意 大屏




样式什么的都没什么太大变化,

<script>
    $(function() {
        function apiFn() {
            this.hostname = ""
        }
        apiFn.prototype = {
            Init:function() {
                this.findCount()
                this.otherDataFn()
                this.baseInfo()
                this.questionFn()
                this.publicityFn()
                this.threeTasksFn()
                this.departmentFn()
                this.guideFn()
                this.policyFn()
                this.coverageFn()
                this.yearsNumFn()
                this.contentFn()
                this.publicNumFn()
                setInterval(function() {
                    numInit()
                },6000)
            },
            findCount:function() {

            },
            // 其他数据展示
            otherDataFn:function() {
                $(".daysData").addClass("counter-value").text("304")
                $(".weekData").addClass("counter-value").text("2044")
                $(".monthData").addClass("counter-value").text("909")
                $(".someThing").addClass("counter-value").text("980")
                $(".policyData").addClass("counter-value").text("200")
            },
            // 基础信息
            baseInfo:function() {


                var baseChart = echarts.init(document.getElementById('baseId'));
                var charts = [
                    {name: "测试1", num: 200},
                    {name: "测试2", num: 300},
                    {name: "测试3", num: 400},
                    {name: "测试4", num: 500},
                    {name: "测试5", num: 300},
                ]
                var color = ['rgba(100,255,249', 'rgba(100,255,249', 'rgba(100,255,249', 'rgba(100,255,249', 'rgba(100,255,249']

                let lineY = []
                for (var i = 0; i < charts.length; i++) {
                var x = i
                if (x > color.length - 1) {
                    x = color.length - 1
                }
                var data = {
                    name: charts[i].name,
                    color: color[x] + ')',
                    value: charts[i].num,
                    itemStyle: {
                    normal: {
                        show: true,
                        color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                        offset: 0,
                        color: color[x] + ', 0.3)'
                        }, {
                        offset: 1,
                        color: color[x] + ', 1)'
                        }], false),
                        barBorderRadius: 10
                    },
                    emphasis: {
                        shadowBlur: 15,
                        shadowColor: 'rgba(0, 0, 0, 0.1)'
                    }
                    }
                }
                lineY.push(data)
                }
                var option= {
                title: {
                    show: false
                },
                grid: {
                    // borderWidth: 1,
                    top: '10%',
                    left: '30%',
                    right: '20%',
                    bottom: '3%'
                },
                color: color,
                yAxis: [{
                    type: 'category',
                    inverse: true,
                    axisTick: {
                    show: false
                    },
                    axisLine: {
                    show: false
                    },
                    axisLabel: {
                    show: false,
                    inside: false
                    },
                    data: charts.name
                }, {
                    type: 'category',
                    inverse: true,
                    axisLine: {
                    show: false
                    },
                    axisTick: {
                    show: false
                    },
                    axisLabel: {
                    show: true,
                    inside: false,
                    textStyle: {
                        color: '#38E1E1',
                        fontSize: '8',
                    },
                    formatter: function (val,index) {
                        return `${charts[index].num}`
                    }
                    },
                    splitArea: {
                    show: false
                    },
                    splitLine: {
                    show: false
                    },
                    data: charts
                }],
                xAxis: {
                    // type: 'value',
                    axisTick: {
                    show: false
                    },
                    axisLine: {
                    show: false
                    },
                    splitLine: {
                    show: false
                    },
                    axisLabel: {
                    show: false
                    }
                },
                series: [{
                    name: '',
                    type: 'bar',
                    zlevel: 2,
                    barWidth: '5px',
                    data: lineY,
                    animationDuration: 1500,
                    label: {
                    normal: {
                        color: 'white',
                        show: true,
                        position: [-65, -2],
                        textStyle: {
                        fontSize: 8
                        },
                        formatter: function (a, b) {
                            return a.name
                        }
                    }
                    }
                }],
                animationEasing: 'cubicOut'
                }
                baseChart.setOption(option)
                setInterval(function() {
                    baseChart.clear()
                    baseChart.setOption(option)
                },40000)
            },
            // 问题反馈类型占比
            questionFn:function() {
                var numArr = [
                    {name: '测试11', value: 300},
                    {name: '测试22', value: 500},
                    {name: '测试33', value: 400},
                    {name: '测试44', value: 350},
                    {name: '测试55', value: 363},
                    {name: '测试66', value: 800},
                ]
                // for(var i = 0; i < data.list.length; i++) {
                //     numArr.push({name: data.list[i].name,value: data.list[i].num})
                // }
                var datas = numArr
                var questionChart = echarts.init(document.getElementById('questionId'));
                var option = {
                    title: {
                        left: 'center'
                    },
                    tooltip: {
                        trigger: 'item',
                        formatter: '{a} <br/>{b} : {c} ({d}%)'
                    },
                    color:['#2E8CFF', '#FD9133','#37D2D4','#19CA88','#858FF8'],
                    legend: {
                        itemWidth: 11,// 标志图形的长度
                        itemHeight: 11,// 标志图形的宽度
                        orient: 'vertical',
                        // left: 'right',
                        top: '15%',
                        x: '50%',
                        data: datas,
                        textStyle: { //图例文字的样式
                            color: '#fff',
                            fontSize: 8
                        },
                    },
                    series: [
                        {
                            name: '问题反馈',
                            type: 'pie',
                            radius: '75%',
                            center: ['20%', '50%'],
                            animationDuration: 2500,
                            data: datas,
                            label: {
                                normal: {
                                    position: 'inner',
                                    show : false
                                }
                            }
                        }
                    ]
                };
                questionChart.setOption(option)
                setInterval(function() {
                    questionChart.clear()
                    questionChart.setOption(option)
                },8000)
            },
            // 党务公开
            publicityFn:function() {
                var dataArr = [
                    {name: '测试11', value: 300},
                    {name: '测试22', value: 500},
                    {name: '测试33', value: 400},
                    {name: '测试44', value: 350},
                    {name: '测试55', value: 363},
                    {name: '测试66', value: 800},
                ]
                // for(var i = 0; i < res.list.length; i++) {
                //     dataArr.push({name: res.list[i].name, value: res.list[i].num})
                // }

                var publicitChart = echarts.init(document.getElementById('publicityId'));
                var data = dataArr
                var option = {
                    color: ['#38EB70', '#F7E16C', '#0EFCFF', '#FD9133', '#4D92F2'],
                    tooltip: {
                        trigger: 'item',
                        formatter: '{a} <br/>{b} : {c} ({d}%)'
                    },
                    legend: {
                        itemWidth: 12,// 标志图形的长度
                        itemHeight: 12,// 标志图形的宽度
                        orient: 'vertical',
                        // left: 'right',
                        top: '5%',
                        bottom: '50%',
                        x: '45%',
                        textStyle: {
                            color: '#fff',
                            fontSize: 8,

                        },
                        data: data,
                    },
                    series: [
                        // 主要展示层的
                        {
                            radius: ['70%', '90%'],
                            center: ['25%', '50%'],
                            type: 'pie',
                            label: {
                                normal: {
                                    position: 'inner',
                                    show : false
                                }
                            },
                            name: "XX公开数量",
                            data: data,
                        },
                        // 边框的设置
                        {
                            radius: ['50%', '55%'],
                            center: ['25%', '50%'],
                            type: 'pie',
                            label: {
                                normal: {
                                    show: false
                                },
                                emphasis: {
                                    show: false
                                }
                            },
                            labelLine: {
                                normal: {
                                    show: false
                                },
                                emphasis: {
                                    show: false
                                }
                            },
                            animation: false,
                            tooltip: {
                                show: false
                            },
                            data: [{
                                value: 1,
                                itemStyle: {
                                    color: "rgba(250,250,250,0.3)",
                                },
                            }],
                        }
                    ]
                };
                publicitChart.setOption(option)
                setInterval(function() {
                    publicitChart.clear()
                    publicitChart.setOption(option)
                },6000)
            },
            // 三务公开数量
            threeTasksFn:function() {
                let names = "666666";
                if(6 - names.length > 0) {
                    for(g = 0; g < 6 - names.length; g++) {
                        $(".main_top_middle_num_list"+(6 - g)).text('0')
                    }
                }
                for(var j = 0; j < names.length; j++) {
                    $(".main_top_middle_num_list"+(names.length - j)).text(names.substr(j,1))
                }
                var dataArr = [
                    {name: '测试11', value: 300},
                    {name: '测试22', value: 500},
                    {name: '测试33', value: 400},
                    {name: '测试44', value: 350},
                    {name: '测试55', value: 363},
                    {name: '测试66', value: 800},
                ]
                for(var i = 1; i < dataArr.length; i++) {
                    $(".main_top_left_c_l_n"+i).addClass("counter-value").text(dataArr[i].value)
                }
                var threeTasksChart = echarts.init(document.getElementById('threeTasksId'));
                var data = dataArr
                var option = {
                    color: ['#38EB70', '#2E8CFF', '#0EFCFF', '#858FF8', '#FD9133','#F7E270'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        itemWidth: 15,// 标志图形的长度
                        itemHeight: 15,// 标志图形的宽度
                        orient: 'vertical',
                        // left: 'right',
                        top: '10%',
                        bottom: '50%',
                        x: '50%',
                        textStyle: {
                            color: '#fff',
                            fontSize: 8,

                        },
                        data: data
                    },
                    series :
                        {
                            name:'三务公开数量',
                            type:'pie',
                            animationDuration: 1500,
                            radius: ['70%', '90%'],
                            center: ['25%', '50%'],
                            roseType : 'radius',
                            label: {
                                normal: {
                                    position: 'inner',
                                    show : false
                                }
                            },
                            data:data
                        }
                };
                threeTasksChart.setOption(option)
                setInterval(function() {
                    threeTasksChart.clear()
                    threeTasksChart.setOption(option)
                },4000)
            },
            // 各部门苏木镇嘎查村公开占比
            departmentFn:function() {
                var dataArr = [
                    {name: '测试11', value: 300},
                    {name: '测试22', value: 500},
                    {name: '测试33', value: 400},
                    {name: '测试44', value: 350},
                    {name: '测试55', value: 363},
                ]
                    // 中间滚动数据展示
                    for(var j = 0; j < dataArr.length; j++) {
                        $(".main_list_title_num"+(j+1)).addClass("counter-value").text(dataArr[j].value)
                        $(".main_list_title"+(j+1)).text(dataArr[j].name)
                    }
                var departmentChart = echarts.init(document.getElementById('departmentId'));
                var data = dataArr
                var option = {
                    color: ['#FD9133', '#47F6A2', '#37D2D4', '#3493FF'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    legend: {
                        itemWidth: 15,// 标志图形的长度
                        itemHeight: 15,// 标志图形的宽度
                        orient: 'vertical',
                        // left: 'right',
                        top: '30%',
                        bottom: '50%',
                        x: '5%',
                        textStyle: {
                            color: '#fff',
                            fontSize: 8,

                        },
                        data: data,
                    },
                    series: [
                        {
                            name: 'XXXX公开占比',
                            type: 'pie',
                            radius: ['50%', '70%'],
                            center: ['78%', '52%'],
                            labelLine: {
                                normal: {
                                    length: 12,
                                    lineStyle: {
                                        type: 'solid',
                                        color: '#0EFCFF'
                                    }
                                }

                            },
                            label: {
                                normal: {
                                    formatter: (params)=>{
                                        return params.name
                                    },
                                    borderWidth: 0,
                                    borderRadius: 4,
                                    padding: [0,0],
                                    height: 20,
                                    fontSize: 8,
                                    align: 'center',
                                    color: '#0EFCFF',
                                }
                            },
                            data: data
                        },
                        {
                            color: '#0EFCFF',
                            type: 'pie',
                            radius: ['55', '56'],
                            center: ['78%', '52%'],
                            data: [100],
                            label: {
                                show: false
                            }
                        },
                        {
                            type: 'pie',
                            radius: ['25', '26'],
                            center: ['78%', '52%'],
                            data: [100],
                            label: {
                                show: false
                            }
                        }
                    ]
                };
                departmentChart.setOption(option)
                setInterval(function() {
                    departmentChart.clear()
                    departmentChart.setOption(option)
                },12000)
            },
            // 办事指南
            guideFn:function() {
                $(".main_bottom_t_l_main").jCarouselLite({
                    vertical: true,
                    hoverPause:true,
                    visible: 4,
                    auto: 1000,
                    speed: 500
                });
            },
            // 政策解读
            policyFn:function() {
                $(".main_bottom_t_l_main2").jCarouselLite({
                    vertical: true,
                    hoverPause:true,
                    visible: 4,
                    auto: 1000,
                    speed: 500
                });
            },
            // 主要关注内容区域占比
            coverageFn:function() {
                var resArr = [
                    {name: '测试11', value: 300},
                    {name: '测试22', value: 500},
                    {name: '测试33', value: 400},
                    {name: '测试44', value: 350},
                    {name: '测试55', value: 363},
                    {name: '测试66', value: 800},
                ]
                var indicatorArr = []
                var numArr = []
                for(var i = 0; i < resArr.length; i++) {
                    indicatorArr.push({name: resArr[i].name,max: 900})
                    numArr.push(resArr[i].value)
                }
                var data = [
                    {
                        value: numArr,
                    }
                ]
                var coverageChart = echarts.init(document.getElementById('coverageId'));
                var option = {
                    legend: {
                        show: true,
                        icon: "circle",
                        bottom: 30,
                        center: 0,
                        itemWidth: 14,
                        itemHeight: 14,
                        itemGap: 21,
                        orient: "horizontal",
                        data: ['a', 'b'],
                        textStyle: {
                            fontSize: '70%',
                            color: '#0EFCFF'
                        },
                    },

                    radar: {
                        // shape: 'circle',
                        radius: '70%',
                        triggerEvent: true,
                        // type: 'default',
                        name: {
                            textStyle: {
                                color: '#39DCF4',
                                fontSize: '10',
                                // borderRadius: 3,
                                padding: [10, 10]
                            }
                        },
                        nameGap: '2',
                        indicator: indicatorArr,
                        splitArea: {
                            areaStyle: {
                                color: 'rgba(255,255,255,0)'
                            }
                        },
                        axisLine: { //指向外圈文本的分隔线样式
                            lineStyle: {
                                color: 'rgba(255,255,255,.2)'
                            }
                        },
                        splitLine: {
                            lineStyle: {
                                width: 1,
                                color: 'rgba(255,255,255,.2)'
                            }
                        },

                    },
                    series: [{
                        name: 'XXX区域占比',
                        type: 'radar',
                        animationDuration: 2000,
                        areaStyle: {
                            normal: {
                                color: {
                                    type: 'linear',
                                    opacity: 1,
                                    x: 0,
                                    y: 0,
                                    x2: 0,
                                    y2: 1,
                                    color: '#2EEFAD'
                                }
                            }
                        },
                        symbolSize: 0,
                        lineStyle: {
                            normal: {
                                // color: 'rgba(252,211,3, 1)',
                                width: 0
                            }
                        },
                        data: data
                    }]
                };
                coverageChart.setOption(option)
                setInterval(function() {
                    coverageChart.clear()
                    coverageChart.setOption(option)
                },10000)
            },
            // 本年公开数量
            yearsNumFn:function() {
                var resArr = [
                    {name: '测试11', value: 30},
                    {name: '测试22', value: 50},
                    {name: '测试33', value: 40},
                    {name: '测试44', value: 35},
                    {name: '测试55', value: 36},
                    {name: '测试66', value: 80},
                ]
                var nameArr = []
                var caiArr = []
                var cunArr = []
                var danArr = []
                var junArr = []
                var zhenArr = []
                for(var i = 0; i < resArr.length; i++) {
                    nameArr.push(resArr[i].name)
                    caiArr.push(resArr[i].value)
                    cunArr.push(resArr[i].value)
                    danArr.push(resArr[i].value)
                    junArr.push(resArr[i].value)
                    zhenArr.push(resArr[i].value)
                }
                var yearsNumChart = echarts.init(document.getElementById('yearsNumId'));
                var spNum = 5,_max=100;
                var y_data = nameArr.reverse();
                var _datamax = [100,100,100,100,100,100,100,100,100,100,100,100],
                    _data1 = caiArr.reverse(),
                    _data2 = cunArr.reverse(),
                    _data3 = danArr.reverse();
                    _data4 = junArr.reverse();
                    _data5 = zhenArr.reverse();
                var fomatter_fn = function(v) {
                    return (v.value / _max * 100).toFixed(0)
                }
                var _label = {
                    normal: {
                        show: true,
                        position: 'inside',
                        formatter: fomatter_fn,
                        textStyle: {
                            color: '#fff',
                            fontSize: 8
                        }
                    }
                };
                var option = {
                    grid: {
                        containLabel: true,
                        left: 0,
                        top: 0,
                        right: 0,
                        bottom: 0
                    },
                    tooltip: {
                        show: true,
                        backgroundColor: '#fff',
                        borderColor: '#ddd',
                        borderWidth: 1,
                        textStyle: {
                            color: '#3c3c3c',
                            fontSize: 16
                        },
                        extraCssText: 'box-shadow: 0 0 5px rgba(0, 0, 0, 0.1)'
                    },
                    xAxis: {
                        splitNumber: spNum,
                        interval: _max / spNum,
                        max: _max,
                        axisLabel: {
                            show: false,
                            formatter: function(v) {
                                var _v = (v / _max * 100).toFixed(0);
                                return _v == 0 ? _v : _v + '%';
                            }
                        },
                        axisLine: {
                            show: false
                        },
                        axisTick: {
                            show: false
                        },
                        splitLine: {
                            show: false
                        }

                    },
                    yAxis: [{
                        data: y_data,
                        axisLabel: {
                            fontSize: 8,
                            color: 'rgba(255,255,255,.7)'

                        },
                        axisLine: {
                            show: false
                        },
                        axisTick: {
                            show: false
                        },
                        splitLine: {
                            show: false
                        }
                    }, {
                        show: false,
                        data: y_data,
                        axisLine: {
                            show: false
                        }
                    }],
                    series: [{
                        type: 'bar',
                        name: '财务',
                        stack: '2',
                        label: _label,
                        legendHoverLink: false,
                        barWidth: 7,
                        itemStyle: {
                            normal: {
                                color: '#FD9133'
                            },
                            emphasis: {
                                color: '#FD9133'
                            }
                        },
                        data: _data1
                    }, {
                        type: 'bar',
                        name: '村务',
                        stack: '2',
                        legendHoverLink: false,
                        barWidth: 20,
                        label: _label,
                        itemStyle: {
                            normal: {
                                color: '#2E8CFF'
                            },
                            emphasis: {
                                color: '#2E8CFF'
                            }
                        },
                        data: _data2
                    }, {
                        type: 'bar',
                        stack: '2',
                        name: '党务',
                        legendHoverLink: false,
                        barWidth: 20,
                        label: _label,
                        itemStyle: {
                            normal: {
                                color: '#37D2D4'
                            },
                            emphasis: {
                                color: '#37D2D4'
                            }
                        },
                        data: _data3
                    }, {
                        type: 'bar',
                        stack: '2',
                        name: '居务',
                        legendHoverLink: false,
                        barWidth: 20,
                        label: _label,
                        itemStyle: {
                            normal: {
                                color: '#19CA88'
                            },
                            emphasis: {
                                color: '#19CA88'
                            }
                        },
                        data: _data4
                    }, {
                        type: 'bar',
                        stack: '2',
                        name: '政务',
                        legendHoverLink: false,
                        barWidth: 20,
                        label: _label,
                        itemStyle: {
                            normal: {
                                color: '#0EFCFF'
                            },
                            emphasis: {
                                color: '#0EFCFF'
                            }
                        },
                        data: _data5
                    }]
                };
                yearsNumChart.setOption(option)
                setInterval(function() {
                    yearsNumChart.clear()
                    yearsNumChart.setOption(option)
                },120000)
            },
            // 关注内容区域占比
            contentFn:function() {
                var resArr = [
                    {name: '测试11', value: 30},
                    {name: '测试22', value: 50},
                    {name: '测试55', value: 33},
                    {name: '测试66', value: 80},
                ]
                var nameArr = []
                var caiArr = []
                var cunArr = []
                var danArr = []
                var junArr = []
                var zhenArr = []
                for(var i = 0; i < resArr.length; i++) {
                    nameArr.push(resArr[i].name)
                    caiArr.push(resArr[i].value)
                    cunArr.push(resArr[i].value)
                    danArr.push(resArr[i].value)
                    junArr.push(resArr[i].value)
                    zhenArr.push(resArr[i].value)
                }

                var contentChart = echarts.init(document.getElementById('contentId'));
                var option = {
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        x: '35%',
                        y: '0%',
                        data: ["财务","村务","党务","居务","政务"],
                        textStyle: {
                            color: "#fff",
                            fontSize: 8
                        },
                        itemWidth: 10,
                        itemHeight: 10,
                    },
                    calculable: true,
                    xAxis: [
                        {
                            type: 'category',
                            data: nameArr,
                            axisLabel: {
                                interval: 0,
                                textStyle: {
                                    fontSize: 8,
                                    color: 'rgba(255,255,255,.7)',
                                }
                            },
                            "axisTick": {       //y轴刻度线
                                "show": false
                            },
                            "axisLine": {       //y轴
                                "show": false,
                            },
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            scale: true,
                            name: '单位:%',
                            nameTextStyle: {
                                color: 'rgba(255,255,255,.7)',
                                fontSize: 8
                            },
                            max: 100,
                            min: 0,
                            boundaryGap: [0.2, 0.2],
                            "axisTick": {       //y轴刻度线
                                "show": false
                            },
                            "axisLine": {       //y轴
                                "show": false,
                            },
                            axisLabel: {
                                textStyle: {
                                    color: 'rgba(255,255,255,.8)',
                                    fontSize: 8
                                    // opacity: 0.1,
                                }
                            },
                            splitLine: {  //决定是否显示坐标中网格
                                show: true,
                                lineStyle: {
                                    color: ['#fff'],
                                    opacity: 0.2
                                }
                            },
                        },
                        {
                            type: 'value',
                            scale: true,
                            show: false,
                            // name: "销量额(万元)",
                            nameTextStyle: {
                                color: 'rgba(255,255,255,.2)',
                            },
                            max: 1,
                            min: 0,
                            boundaryGap: [0.2, 0.2],
                            "axisTick": {       //y轴刻度线
                                "show": false
                            },
                            "axisLine": {       //y轴
                                "show": false,
                            },
                            axisLabel: {
                                textStyle: {
                                    color: 'rgba(255,255,255,.2)',
                                    // opacity: 0.1,
                                }
                            },
                            splitLine: {  //决定是否显示坐标中网格
                                show: true,
                                lineStyle: {
                                    color: ['#fff'],
                                    opacity: 0.2
                                }
                            },

                        }
                    ],
                    color: ['#0EFCFF', '#FD9133'],
                    grid: {
                        left: '5%',
                        right: '1%',
                        top: '25%',
                        bottom: '15%'
                        // containLabel: true
                    },
                    series: [
                        {
                            barWidth: '10%',
                            name: '财务',
                            type: 'bar',
                            data: caiArr,
                        },
                        {
                            animationDuration: 2500,
                            barWidth: '20%',
                            name: '村务',
                            type: 'bar',
                            data: cunArr,
                        },
                        {
                            animationDuration: 2500,
                            barWidth: '20%',
                            name: '党务',
                            type: 'bar',
                            data: danArr,
                        },
                        {
                            animationDuration: 2500,
                            barWidth: '20%',
                            name: '居务',
                            type: 'bar',
                            data: junArr,
                        },
                        {
                            animationDuration: 2500,
                            barWidth: '20%',
                            name: '政务',
                            type: 'bar',
                            data: zhenArr,
                        }
                    ]
                };
                contentChart.setOption(option)
                setInterval(function() {
                    contentChart.clear()
                    contentChart.setOption(option)
                },90000)
            },
            // 巡察
            publicNumFn:function() {
                var resArr = [
                    {name: '测试11', value: 300},
                    {name: '测试22', value: 500},
                    {name: '测试33', value: 400},
                    {name: '测试44', value: 350},
                    {name: '测试55', value: 363},
                    {name: '测试66', value: 800},
                ]
                var xunArr = []
                var jingArr = []
                var dateArr = []
                for(var i = 0; i < resArr.length; i++) {
                    xunArr.push(resArr[i].value)
                    jingArr.push(resArr[i].value)
                    dateArr.push(resArr[i].name)
                }
                var publicNumChart = echarts.init(document.getElementById('publicNumId'));
                var option = {
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        x: '35%',
                        y: '0%',
                        data: ['巡察', '警示'],
                        textStyle: {
                            color: "#fff",
                            fontSize: 8
                        },
                        itemWidth: 10,
                        itemHeight: 10,
                    },
                    calculable: true,
                    xAxis: [
                        {
                            type: 'category',
                            data: dateArr,
                            axisLabel: {
                                interval: 0,
                                textStyle: {
                                    fontSize: 8,
                                    color: 'rgba(255,255,255,.7)',
                                }
                            },
                            "axisTick": {       //y轴刻度线
                                "show": false
                            },
                            "axisLine": {       //y轴
                                "show": false,
                            },
                        }
                    ],
                    yAxis: [
                        {
                            type: 'value',
                            scale: true,
                            name: '单位:%',
                            nameTextStyle: {
                                color: 'rgba(255,255,255,.7)',
                                fontSize: 8
                            },
                            max: 1000,
                            min: 0,
                            boundaryGap: [0.2, 0.2],
                            "axisTick": {       //y轴刻度线
                                "show": false
                            },
                            "axisLine": {       //y轴
                                "show": false,
                            },
                            axisLabel: {
                                textStyle: {
                                    color: 'rgba(255,255,255,.8)',
                                    fontSize: 8
                                    // opacity: 0.1,
                                }
                            },
                            splitLine: {  //决定是否显示坐标中网格
                                show: true,
                                lineStyle: {
                                    color: ['#fff'],
                                    opacity: 0.2
                                }
                            },
                        },
                        {
                            type: 'value',
                            scale: true,
                            show: false,
                            // name: "销量额(万元)",
                            nameTextStyle: {
                                color: 'rgba(255,255,255,.2)',
                            },
                            max: 1,
                            min: 0,
                            boundaryGap: [0.2, 0.2],
                            "axisTick": {       //y轴刻度线
                                "show": false
                            },
                            "axisLine": {       //y轴
                                "show": false,
                            },
                            axisLabel: {
                                textStyle: {
                                    color: 'rgba(255,255,255,.2)',
                                    // opacity: 0.1,
                                }
                            },
                            splitLine: {  //决定是否显示坐标中网格
                                show: true,
                                lineStyle: {
                                    color: ['#fff'],
                                    opacity: 0.2
                                }
                            },

                        }
                    ],
                    color: ['#2E8CFF', '#38EB70'],
                    grid: {
                        left: '5%',
                        right: '1%',
                        top: '25%',
                        bottom: '15%'
                        // containLabel: true
                    },
                    series: [
                        {
                            animationDuration: 2500,
                            barWidth: '20%',
                            name: '巡察',
                            type: 'bar',
                            data: xunArr,
                        },
                        {
                            barWidth: '20%',
                            name: '警示',
                            type: 'bar',
                            data: jingArr,
                        }
                    ],
                    animationEasing: 'cubicOut'
                };
                publicNumChart.setOption(option)
                setInterval(function() {
                    publicNumChart.clear()
                    publicNumChart.setOption(option)
                },60000)
            }

        }
        var start = new apiFn()
        start.Init()
    })
</script>
自适应好像是有一点点小问题,整体很好,美观、大方,动态显示数据。

标签:false,name,show,color,value,var,可视化,注意,大屏
From: https://www.cnblogs.com/jycom/p/16986370.html

相关文章

  • 低代码 系列 —— 可视化编辑器3
    可视化编辑器3这是可视化编辑器的最后一篇,本篇主要实现​​属性区​​​和组件的​​放大和缩小​​​,最后附上​​所有代码​​。属性区:即对编辑区的组件进行编辑,例如编辑......
  • 数据看板可视化
    前言这段时间一直在做可视化,在我的项目中有一部分是电力巡检的数据可视化。其中的数据看板比较简单,我将其单独抽离出来形成一个demo,为保密demo中数据非真实数据。先看效果......
  • 瓴羊Quick BI 填报组件让数据分析和可视化呈现轻而易举
    当前,发布了有关应用行业软件的年度报告,里面表示,市场规模在不断扩大,增速也有所提升。瓴羊、帆软等国产的BI商家都在积极成长以满足相关需求。但是BI工具的规划应用只是实现对......
  • docker registry(私库)搭建,使用,WEB可视化管理部署
    DockerRegistry是Docker官方一个镜像,可以用来储存和分发Docker镜像。目前比较流行的两个镜像私库是DockerRegistry,HarBor其中HarBor最合适企业级应用,提供良好的WEB界......
  • 纯外贸小白做跨境电商,应该注意哪些呢?
    做跨境电商需要注意什么?米贸搜整理如下,希望能帮到你。近年来,跨境电商的发展逐渐进入人们的视野。大量商家开始向跨境电商业务转型,选择抓住这个机会将自己的品牌引进国外。但......
  • 多维时序 | MATLAB实现Attention-LSTM(注意力机制长短期记忆神经网络)多输入单输出
    多维时序|MATLAB实现Attention-LSTM(注意力机制长短期记忆神经网络)多输入单输出目录​​多维时序|MATLAB实现Attention-LSTM(注意力机制长短期记忆神经网络)多输入单输......
  • 信管专业对口工作岗位薪资 数据统计与可视化案例(爬虫+数据预处理+数据可视化)
    案例简介:本项目是一个针对数据统计与可视化课程的Presentation大作业项目1.数据采集智联招聘爬虫,截止于2022.12.15可正常使用。爬取网站(可以先自己搜一下关键词看看是......
  • Redis 官方可视化工具--RedisInsight
    一、RedisInsight简介RedisInsight是一个直观高效的RedisGUI管理工具,它可以对Redis的内存、连接数、命中率以及正常运行时间进行监控,并且可以在界面上使用CLI和连......
  • uniapp打包配置注意事项
    1.使用原生安卓api要在app权限配置中勾选对应功能  2.打包前要在app模块配置中勾选对应模块 ......
  • 乘坐电梯注意事项
    原标题:擅开电梯门致岳父踏空坠亡当事人:开门是想检查据微信公众号贵州广播电视台“百姓关注”10月8日报道,前几天,一则女婿擅自拧开电梯门,老丈人坠落8米电梯井身亡的视频在网上......