echarts图自适应

var myChart2 = echarts.init(document.getElementById('img_2'));
option2 = {
    title: {
        text: '存量中各学历段情况',
        x:'center'
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        y: '30',
        data:name
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    tooltip: {
        trigger: 'item',
        formatter: "{a} 
{b}: {c} ({d}%)" }, series: [ { name: '学历占比', type: 'pie', radius: [0, '40%'], data:zt }, ] }; myChart2.setOption(option2); var myChart3 = echarts.init(document.getElementById('img_3')); option3 = { title: { text: '正常卡量中各学历段情况', x:'center' }, legend: { orient: 'vertical', x: 'left', y: '30', data:name }, tooltip: { trigger: 'item', formatter: "{a}
{b}: {c} ({d}%)" }, series: [ { name: '学历占比', type: 'pie', radius: [0, '40%'], data:zc }, ] }; myChart3.setOption(option3); var resizeTimer = null; $(window).bind('resize', function () { if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function () { var reset = myChart2.resize; reset(); var reset1 = myChart3.resize; reset1(); }, 100); });

你可能感兴趣的:(echarts图自适应)