var myChart = echarts.init(document.getElementById('main1'));
myChart.setOption({
title : {
text : ""
},
tooltip : {
trigger : 'axis',
showDelay : 0,
axisPointer : {
type : 'shadow'
}
},
legend: {
data:['药费', '检查','治疗','材料','手术','其他']
},
toolbox: {
show : true,
orient:"vertical",
feature : {
mark : {show: true},
dataView : {show: true, readOnly: true},
magicType : {show: true, type: [ 'stack', 'tiled']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [
{
axisPointer : {
type : 'shadow'
},
splitLine:{
show:false
},
type : 'category',
data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
}
],
yAxis : [
{
axisLabel : {
formatter : '{value} '
},
splitLine:{
show:false
},
type : 'value'
}
],
series : [
{
name:'药费',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[320, 302, 301, 334, 390, 330, 320]
},
{
name:'检查',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[120, 132, 101, 134, 90, 230, 210]
},
{
name:'治疗',
type:'bar',
stack: '总量',
itemStyle : { normal:{label : {show: true, position: 'insideRight'}}},
data:[220, 182, 191, 234, 290, 330, 310]
},
{
name:'材料',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
data:[150, 212, 201, 154, 190, 330, 410]
},
{
name:'手术',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'}, color:"#63869E"}},
data:[820, 832, 901, 934, 1290, 1330, 1320]
},
{
name:'其他',
type:'bar',
stack: '总量',
itemStyle : { normal: {label : {show: true, position: 'insideRight'},color:"#FF6600"}},
data:[120, 132,101, 134, 190, 130, 120]
}
]
});
<div class="row">
<div class="col-lg-4 col-md-4">div>
<div class="col-lg-8 col-md-8">
<div class="chart" id="main1" >div>
div>
div>
div>