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;
  • 相关阅读:
    jquery height
    正则表达式的一点奇怪
    this和call
    ajax views
    史上变态的模块
    在php中有什么用
    localhost访问不了
    $.extend abc
    $.extend
    和人沟通的一个要点
  • 原文地址:https://www.cnblogs.com/kevalin/p/4546813.html
Copyright © 2011-2022 走看看