echats 饼状图

 var option = {
        title: {
            text: '原因饼状图',
            x: 'center',
            y: 'top',
            textStyle: {
                fontSize: 20
                // color:'#629bb9'
            }
        },

        legend: {
            // y: 'bottom',
            bottom:'30',
            data: ['阿姨', '阿尔','阿三','阿斯']
        },
        series : [
            {
                type: 'pie',
                radius : '50%',
                center: ['50%', '40%'],
                // selectedMode: 'single',
                labelLine : {
                    normal : {
                        length : 1,
                        length2 :1
                    }
                },
                data:[
                    {
                        value:1548,
                        name: '阿三'

                    },
                    {value:535, name: '啊四'},
                    {value:510, name: '啊呜'},
                    {value:735, name: '阿六'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                     },
                    normal:{
                        color:function(params) {
                            var colorList = [
                                '#018d81', '#f1c40f', '#95a5a6', '#ff6384', '#36a2eb', '#FE8463'
                            ];

                            return colorList[params.dataIndex];
                         }
                    }
              }

            }
        ]
    };

 

posted on 2019-04-17 14:12  slfGJ  阅读(210)  评论(0编辑  收藏  举报

导航