echarts(字体样式颜色等控制)

var moneysitu = echarts.init(document.getElementById('moneysitu'));
var optionmoneysitu = {
    title : {
        text: '基金情况',
        subtext: '',
        x:'left'
    },
    tooltip : {
        trigger: 'item',
        show:false,
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        //orient : 'vertical',
        x : 'left',
        y : 'bottom',
        data:['新增概算','已付定金','资金结余','已收定金']
    },
    toolbox: {
        show : false,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {
                show: true,
                type: ['pie', 'funnel']
            },
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : false,
    series : [
        {
            name:'访问来源',
            type:'pie',
            selectedMode: 'single',
            radius : [0, 40],
            color:['#ff9232'],
            // for funnel
            x: '50%',
            width: '100%',
            funnelAlign: 'right',
            //max: 1548,
            itemStyle : {
                normal : {
                    label : {
                        position : 'inner'
                    },
                    labelLine : {
                        show : false
                    }
                }
            },
            label: {
                normal: {
                    show: true,
                    position: 'center',
                    //formatter:'{c}\n{d}%'
                    formatter:function(){
                        return '2017\n年度基金情况\n(亿元)'
                    },
                    textStyle:{
                        fontSize:10,
                        color:'#000'
                    }
                }
            },
            data:[
                {value:335, name:''}
            ]
        },
        {
            name:'',
            type:'pie',
            radius : [40, 60],
            // for funnel
            x: '60%',
            width: '35%',
            color:['rgb(70,194,225)','rgb(255,112,112)','rgb(255,198,84)','rgb(196,234,221)'],
            funnelAlign: 'left',
            //max: 1048,
            label: {
                normal: {
                    show: true,
                    position: 'outer',
                    formatter:'{b}\n{d}%',
                    color:'#000'
                }
            },
            labelLine: {
                normal: {
                    show: true,
                    length:0,

                }
            },
            data:[
                {value:335, name:'新增概算'},
                {value:310, name:'已付定金'},
                {value:234, name:'资金结余'},
                {value:135, name:'已收定金'}
            ]
        }
    ]
};
moneysitu.setOption(optionmoneysitu);

猜你喜欢

转载自blog.csdn.net/qq_39237755/article/details/79248380