echarts Pie

. echarts.init (document.getElementById (ID)) the setOption ({ 
    the backgroundColor: '# 2c343c', // background color 
    textStyle: { 
        Color: 'RGBA (255, 255, 255, 0.3)', // text color 
        fontSize: 12 // text taken off 
    }, 
    title: { 
        text: 'equipment (ID:' + title + ')', // title 
        X: 'Center', // location 
        textStyle: { 
            Color: 'White', // title color 
            the fontSize: 13 is // header size 
        }, 
        padding: [ 20 is, 20 is, 20 is, 20 is] //By title as padding 
    }, 
    Series: [ 
        { 
            type: 'PIE', // designated as pie charts 
            RADIUS: '50% ', // pie size relative to the container 
            center: ['50%', ' 55% '], // pie position relative to the container [left and right, up and down] 
            label: { 
                Normal: { 
                    Formatter: "{B}: {D}%", // text type {a} => header, { b} => data of the name, {c} => data in value, {d} => percentage 
                }, 
            }, 
            data: data // data, consisting of the name and value 
        } 
    ] 
});

Reference Documents

Guess you like

Origin www.cnblogs.com/GetcharZp/p/12123630.html