123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617 |
- $(function(){
- init();
- })
- function init(){
- var myColor = ['#1089E7', '#F57474', '#56D0E3', '#F8B448', '#8B78F6'];
- //各医院门诊人次
- var histogramChart1 = echarts.init(document.getElementById('histogramChart1'));
- histogramChart1.setOption({
- grid: {
- top: '20%',
- left: '32%'
- },
- xAxis: {
- show: false
- },
- yAxis: [{
- show: true,
- data: ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
- inverse: true,
- axisLine: {
- show: false
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisLabel: {
- color: '#fff',
- formatter: (value, index) => {
- return [
- `{lg|${index+1}} ` + '{title|' + value + '} '
- ].join('\n')
- },
- rich: {
- lg: {
- backgroundColor: '#339911',
- color: '#fff',
- borderRadius: 15,
- // padding: 5,
- align: 'center',
- width: 15,
- height: 15
- },
- }
- },
- }, {
- show: true,
- inverse: true,
- data: [4000, 3000, 2000, 1000],
- axisLabel: {
- textStyle: {
- fontSize: 12,
- color: '#fff',
- },
- },
- axisLine: {
- show: false
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- }],
- series: [{
- name: '条',
- type: 'bar',
- yAxisIndex: 0,
- data: [40, 30, 20, 10],
- barWidth: 10,
- itemStyle: {
- normal: {
- barBorderRadius: 20,
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- }
- },
- label: {
- normal: {
- show: true,
- position: 'inside',
- formatter: '{c}%'
- }
- },
- }, {
- name: '框',
- type: 'bar',
- yAxisIndex: 1,
- barGap: '-100%',
- data: [100, 100, 100, 100],
- barWidth: 15,
- itemStyle: {
- normal: {
- color: 'none',
- borderColor: '#00c1de',
- borderWidth: 3,
- barBorderRadius: 15,
- }
- }
- }, ]
- })
- //各医院住院人次
- var histogramChart2 = echarts.init(document.getElementById('histogramChart2'));
- histogramChart2.setOption({
- grid: {
- top: '20%',
- left: '32%'
- },
- xAxis: {
- show: false
- },
- yAxis: [{
- show: true,
- data: ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
- inverse: true,
- axisLine: {
- show: false
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisLabel: {
- color: '#fff',
- formatter: (value, index) => {
- return [
- `{lg|${index+1}} ` + '{title|' + value + '} '
- ].join('\n')
- },
- rich: {
- lg: {
- backgroundColor: '#339911',
- color: '#fff',
- borderRadius: 15,
- // padding: 5,
- align: 'center',
- width: 15,
- height: 15
- },
- }
- },
- }, {
- show: true,
- inverse: true,
- data: [2200, 2400, 2600, 2800],
- axisLabel: {
- textStyle: {
- fontSize: 12,
- color: '#fff',
- },
- },
- axisLine: {
- show: false
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- }],
- series: [{
- name: '条',
- type: 'bar',
- yAxisIndex: 0,
- data: [22, 24, 26, 28],
- barWidth: 10,
- itemStyle: {
- normal: {
- barBorderRadius: 20,
- color: function(params) {
- var num = myColor.length;
- return myColor[params.dataIndex % num]
- },
- }
- },
- label: {
- normal: {
- show: true,
- position: 'inside',
- formatter: '{c}%'
- }
- },
- }, {
- name: '框',
- type: 'bar',
- yAxisIndex: 1,
- barGap: '-100%',
- data: [100, 100, 100, 100],
- barWidth: 15,
- itemStyle: {
- normal: {
- color: 'none',
- borderColor: '#00c1de',
- borderWidth: 3,
- barBorderRadius: 15,
- }
- }
- }, ]
- })
- //手术工作量
- var pieChart1 = echarts.init(document.getElementById('pieChart1'));
- pieChart1.setOption({
- color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
- tooltip : {
- trigger: 'item',
- formatter: "{a}<br/>{b}<br/>{c}台"
- },
- calculable : true,
- series : [
- {
- name:'手术工作量',
- type:'pie',
- radius : [30, 110],
- center : ['50%', '50%'],
- roseType : 'area',
- x: '50%',
- max: 40,
- sort : 'ascending',
- data:[
- {value:10, name:'厦门第一医院'},
- {value:5, name:'厦门中山医院'},
- {value:15, name:'厦门中医院'},
- {value:25, name:'厦门第五医院'},
- ]
- }
- ]
- })
- //医疗费用
- var lineChart1 = echarts.init(document.getElementById('lineChart1'));
- lineChart1.setOption( {
- color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
- tooltip : {
- trigger: 'item',
- formatter: "{a}<br/>{b}<br/>{c}元"
- },
- legend: {
- data:['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
- y: 'bottom',
- x:'center',
- textStyle:{
- color:'#fff',
- fontSize:12
- }
- },
- grid:{
- left: '5%',
- right: '5%',
- bottom: '10%',
- containLabel: true
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- boundaryGap : false,
- data : ['周一','周二','周三','周四','周五','周六','周日'],
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- axisLabel : {
- interval:0,
- rotate:40,
- textStyle: {
- color: '#fff',
- fontSize:13
- }
- }
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- splitLine: {
- "show": false
- },
- axisLabel: {
- textStyle: {
- color: '#fff'
- },
- formatter: function (value) {
- return value + "元"
- },
- },
- }
- ],
- series : [
- {
- name:'厦门第一医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[10, 12, 21, 54, 260, 830, 710]
- },
- {
- name:'厦门中山医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[30, 182, 434, 791, 390, 30, 10]
- },
- {
- name:'厦门中医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[1320, 1132, 601, 234, 120, 90, 20]
- },
- {
- name:'厦门第五医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[320, 132, 61, 34, 20, 9, 2]
- }
- ]
- })
- //体检人次
- var lineChart2 = echarts.init(document.getElementById('lineChart2'));
- lineChart2.setOption( {
- color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
- tooltip : {
- trigger: 'item',
- formatter: "{a}<br/>{b}<br/>{c}人"
- },
- legend: {
- data:['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
- y: 'bottom',
- x:'center',
- textStyle:{
- color:'#fff',
- fontSize:12
- }
- },
- grid:{
- left: '5%',
- right: '5%',
- bottom: '10%',
- containLabel: true
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- boundaryGap : false,
- data : ['周一','周二','周三','周四','周五','周六','周日'],
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- axisLabel : {
- interval:0,
- rotate:40,
- textStyle: {
- color: '#fff',
- fontSize:13
- }
- }
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- splitLine: {
- "show": false
- },
- axisLabel: {
- textStyle: {
- color: '#fff'
- },
- formatter: function (value) {
- return value + "人"
- },
- },
- }
- ],
- series : [
- {
- name:'厦门第一医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[120, 122, 221, 524, 460, 530, 610]
- },
- {
- name:'厦门中山医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[130, 682, 534, 691, 490, 130, 110]
- },
- {
- name:'厦门中医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[320, 132, 161, 134, 112, 190, 120]
- },
- {
- name:'厦门第五医院',
- type:'line',
- smooth:true,
- itemStyle: {normal: {areaStyle: {type: 'default'}}},
- data:[320, 132, 461, 34, 202, 93, 222]
- }
- ]
- })
- //床位数量分布
- var pieChart2 = echarts.init(document.getElementById('pieChart2'));
- pieChart2.setOption({
- color:["#87cefa","#ff7f50","#32cd32","#da70d6",],
- tooltip : {
- trigger: 'item',
- formatter: "{a}<br/>{b}<br/>{c}床"
- },
- calculable : true,
- series : [
- {
- name:'床位数量分布',
- type:'pie',
- radius : [30, 110],
- center : ['45%', '50%'],
- roseType : 'area',
- x: '50%',
- max: 40,
- sort : 'ascending',
- data:[
- {value:700, name:'厦门第一医院'},
- {value:500, name:'厦门中山医院'},
- {value:105, name:'厦门中医院'},
- {value:250, name:'厦门第五医院'},
- ]
- }
- ]
- })
- //药占比
- var histogramChart3 = echarts.init(document.getElementById('histogramChart3'));
- histogramChart3.setOption( {
- color:['#87cefa'],
- grid:{
- left: '5%',
- right: '5%',
- bottom: '5%',
- containLabel: true
- },
- tooltip : {
- trigger: 'item',
- formatter: "{a}<br/>{b}<br/>{c}%"
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- data : ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- axisLabel : {
- interval:0,
- rotate:40,
- textStyle: {
- color: '#fff',
- fontSize:13
- }
- }
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- splitLine: {
- "show": false
- },
- axisLabel: {
- textStyle: {
- color: '#fff'
- },
- formatter: function (value) {
- return value + "%"
- },
- },
- }
- ],
- series : [
- {
- name:'药占比',
- type:'bar',
- barWidth:30,
- data:[60,80,70,50],
- },
- ]
- });
- //平均住院天数
- var histogramChart4 = echarts.init(document.getElementById('histogramChart4'));
- histogramChart4.setOption( {
- color:['#87cefa'],
- grid:{
- left: '5%',
- right: '5%',
- bottom: '5%',
- containLabel: true
- },
- tooltip : {
- trigger: 'item',
- formatter: "{a}<br/>{b}<br/>{c}天"
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- data : ['厦门第一医院','厦门中山医院','厦门中医院','厦门第五医院',],
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- axisLabel : {
- interval:0,
- rotate:40,
- textStyle: {
- color: '#fff',
- fontSize:13
- }
- }
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLine:{
- lineStyle:{
- color: '#87cefa'
- },
- },
- splitLine: {
- "show": false
- },
- axisLabel: {
- textStyle: {
- color: '#fff'
- },
- formatter: function (value) {
- return value + "天"
- },
- },
- }
- ],
- series : [
- {
- name:'平均住院天数',
- type:'bar',
- barWidth:30,
- data:[6,8,7,5],
- },
- ]
- });
- }
|