zoukankan      html  css  js  c++  java
  • Echarts自适应浏览器大小

    var myChart = echarts.init(document.getElementById('sitesChar'));
    var option = {
        title : {
            text: 'Nodejs站点服务器分布',
            subtext: '平台组',
            x:'center'
        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient : 'vertical',
            x : 'left',
            data: _ips
        },
        toolbox: {
            show : true,
            feature : {
                mark : {show: false},
                dataView : {show: true, readOnly: false},
                magicType : {
                    show: false,
                    type: ['pie', 'funnel'],
                    option: {
                        funnel: {
                            x: '25%',
                             '50%',
                            funnelAlign: 'left'
                            //max: 1548
                        }
                    }
                },
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        calculable : true,
        series : [
            {
                name:'服务器IP:站点数',
                type:'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data: _data
            }
        ]
    };
    
    // 为echarts对象加载数据
    myChart.setOption(option);
    // 加上这一句即可
    window.onresize = myChart.resize;
    

      

  • 相关阅读:
    基于Spring的集群会话共享方案-spring session
    Tensorflow 模型线上部署
    Dijkstra算法
    BFS和DFS
    图的基本概念
    排序5
    排序4
    排序3
    排序2
    排序1
  • 原文地址:https://www.cnblogs.com/henuyuxiang/p/6215094.html
Copyright © 2011-2022 走看看