echart实例

option = {
    color:['#959595','#F16D12','#3D86C9'],
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器,坐标轴触发有效
            type : 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
        }
    },
    legend: {
        right:'0',
        top:'38%',
        orient: 'vertical',
        data:['其他','英文','中文']
    },
    grid: {
        top:'4%',
        left: '3%',
        right: '12%',
        bottom: '5%',
        containLabel: true
    },
    xAxis : [
        {
            // splitLine: {show:false},
            type : 'category',
            data : ["军事学", "教育学", "管理软件文献", "法学", "历史学", "电子图书", "艺术学", "文学", "工学", "经济学"],
            //如果中文没显示全,可设置为斜体,角度可改变
             axisLabel:{                         
                interval:0,                         
                rotate:45,                         
                margin:4,                         
                textStyle:{                             
                    color:"#222",                         
                }                     
            }
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [

        {
            barWidth:30,
            name:'其他',
            type:'bar',
            stack: '广告',
            data:[33,23,45,23,55,67,89,35,24,12]
        },
        {
            name:'英文',
            type:'bar',
            stack: '广告',
            data:[67,56,43,32,45,23,56,33,56,32]
        },
        {
            name:'中文',
            type:'bar',
            stack: '广告',
            data:[11,45,67,89,43,23,67,88,54,33]
        }
    ]
};

你可能感兴趣的:(echart)