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%',
                        width: '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;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM