123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617 |
- var fontSize = 0.0067 * window.screen.width;//字体13(默认)
- var fontSize1 = 0.0057 * window.screen.width;//字体11(默认)
- var fontSize2 = 0.00625 * window.screen.width;//字体12(默认)
- var leftChart1DataFormat = function(options) {
- var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
- item = parseInt(item.substring(5, 7)) + "月";
- return item;
- });
- var series0data = options.series[0].data || [];
- var series1data = options.series[1].data || [];
- var option = {
- "title": {
- "text": "门诊人次月趋势",
- "x": "center",
- textStyle: {
- color: '#b5e1fc',
- fontSize: 16,
- fontWeight: 'bold'
- }
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#fff'
- }
- },
- formatter: '{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%"
- },
- "grid": {
- top: '70',
- left: '75',
- bottom: '40'
- },
- legend: {
- data: ['门诊人次', '环比'],
- textStyle: {
- color: '#b5e1fc'
- },
- top: '40'
- },
- xAxis: [{
- type: 'category',
- data: xAxisData,
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize
- }
- }],
- yAxis: [{
- type: 'value',
- name: '门诊人次',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize
- }
- },
- {
- type: 'value',
- name: '环比',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false // 不显示坐标轴刻度
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e' // 坐标轴轴线颜色
- }
- },
- axisLabel: {
- color: '#b5e1fc', // 坐标轴刻度标签文本颜色
- fontSize: fontSize
- },
- show: true
- }
- ],
- series: [{
- name: '门诊人次',
- type: 'bar',
- "data": series0data,
- barWidth: 20,
- label: {
- normal: {
- show: true,
- position: 'top', // 在柱状图上方显示
- color: '#fff' // 柱状图上方显示的数值颜色
- }
- },
- itemStyle: {
- barBorderRadius: [8, 8, 0, 0],
- color: '#00e6f3'
- }
- },
- {
- name: '环比',
- type: 'line',
- yAxisIndex: 1,
- "data": series1data,
- itemStyle: {
- color: '#03fa6d'
- },
- markLine:{
- data:[
- {yAxis: 0, name: '环比'}
- ],
- label:{
- show: true,
- position: 'middle'
- },
- lineStyle:{
- color: '#ffffff'
- }
- }
- }
- ]
- }
- return option;
- },
- leftChart2DataFormat = function(options){
- var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
- item = parseInt(item.substring(5, 7)) + "月";
- return item;
- });
- var series0data = options.series[0].data || [];;
- var series1data = options.series[1].data || [];;
- var option = {
- "title": {
- "text": "住院人次月趋势",
- "x": "center",
- textStyle: {
- color: '#b5e1fc',
- fontSize: 16,
- fontWeight: 'bold'
- }
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#fff'
- }
- }
- },
- "grid": {
- top: '70',
- left: '70',
- bottom: '40'
- },
- legend: {
- data: ['住院人次', '环比'],
- textStyle: {
- color: '#b5e1fc'
- },
- top: '40'
- },
- xAxis: [{
- type: 'category',
- data: xAxisData,
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize
- }
- }],
- yAxis: [{
- type: 'value',
- name: '住院人次',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize
- }
- },
- {
- type: 'value',
- name: '环比',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false // 不显示坐标轴刻度
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e' // 坐标轴轴线颜色
- }
- },
- axisLabel: {
- color: '#b5e1fc', // 坐标轴刻度标签文本颜色
- fontSize: fontSize
- },
- show:true
- }
- ],
- series: [{
- name: '住院人次',
- type: 'bar',
- "data": series0data,
- barWidth: 20,
- label: {
- normal: {
- show: true,
- position: 'top', // 在柱状图上方显示
- color: '#fff' // 柱状图上方显示的数值颜色
- }
- },
- itemStyle: {
- barBorderRadius: [8, 8, 0, 0],
- color: '#ff616f'
- }
- },
- {
- name: '环比',
- type: 'line',
- yAxisIndex: 1,
- "data": series1data,
- itemStyle: {
- color: '#03fa6d'
- },
- markLine:{
- data:[
- {yAxis: 0, name: '环比'}
- ],
- label:{
- show: true,
- position: 'middle'
- },
- lineStyle:{
- color: '#ffffff'
- }
- }
- }
- ]
- }
- return option;
- },
- rightChart1DataFormat = function(options){
- var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
- item = parseInt(item.substring(5, 7)) + "月";
- return item;
- });
- var series0data = options.series[0].data || [];
- var series1data = options.series[1].data || [];
- var series2data = options.series[2].data || [];
- var series3data = options.series[3].data || []
- series2data = _.map(series2data,function(item,idx){
- return parseFloat(item)
- })
- console.error(JSON.stringify(series2data))
- var option = {
- "title": {
- "text": "门诊分类别月趋势",
- "x": "center",
- textStyle: {
- color: '#b5e1fc',
- fontSize: 16,
- fontWeight: 'bold'
- }
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#fff'
- }
- },
- formatter: function(value){
- var resStr = "";
- _.map(value,function(item,idx){
- if(idx==0){
- resStr+=item.axisValue+" <br /> ";
- }
- resStr+=item.seriesName+":"+item.data;
- if(idx==2 || idx==3){//环比值加%
- if(item.data!="--"){
- resStr+="%";
- }
- }
- resStr+=" <br /> ";
- })
- return resStr;
- }
- },
- "grid":{
- top: '80',
- left: '60',
- bottom: '30',
- right:'60'
- },
- legend: {
- data: ['普通号', '专家号', '普通号环比', '专家号环比'],
- textStyle: {
- color: '#b5e1fc'
- },
- top: '30',
- itemWidth: 10
- },
- xAxis: [{
- type: 'category',
- data: xAxisData,
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize
- }
- }],
- yAxis: [{
- type: 'value',
- name: '人次',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize2
- },
- splitNumber: 2
- },
- {
- type: 'value',
- name: '环比',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false // 不显示坐标轴刻度
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e' // 坐标轴轴线颜色
- }
- },
- axisLabel: {
- color: '#b5e1fc', // 坐标轴刻度标签文本颜色
- fontSize: fontSize2
- },
- show:true,
- splitNumber: 4
- }
- ],
- series: [{
- name: '普通号',
- type: 'bar',
- "data": series0data,
- barWidth: 20,
- label: {
- normal: {
- show: true,
- position: 'top', // 在柱状图上方显示
- color: '#fff', // 柱状图上方显示的数值颜色
- fontSize: fontSize1
- }
- },
- itemStyle: {
- barBorderRadius: [8, 8, 0, 0],
- color: '#00e6f3'
- }
- },
- {
- name: '专家号',
- type: 'bar',
- "data": series1data,
- barWidth: 20,
- label: {
- normal: {
- show: true,
- position: 'top', // 在柱状图上方显示
- color: '#fff', // 柱状图上方显示的数值颜色
- fontSize: fontSize1
- }
- },
- itemStyle: {
- barBorderRadius: [8, 8, 0, 0],
- color: '#fff71a'
- }
- },
- {
- name: '普通号环比',
- type: 'line',
- yAxisIndex: 1,
- "data": series2data,
- itemStyle: {
- color: '#03fa6d'
- }
- },
- {
- name: '专家号环比',
- type: 'line',
- yAxisIndex: 1,
- "data": series3data,
- itemStyle: {
- color: '#ff616f'
- },
- markLine:{
- data:[
- {yAxis: 0, name: '环比'}
- ],
- label:{
- show: true,
- position: 'middle'
- },
- lineStyle:{
- color: '#ffffff'
- }
- }
- },
- ]
- }
- return option;
- },
- rightChart2DataFormat = function(options){
- var xAxisData = _.map(options.xAxis[0].data, function(item, idx) {
- item = parseInt(item.substring(5, 7)) + "月";
- return item;
- });
- var series0data = options.series[0].data || [];;
- var series1data = options.series[1].data || [];;
- var option = {
- "title": {
- "text": "住院平均日数月趋势",
- "x": "center",
- textStyle: {
- color: '#b5e1fc',
- fontSize: 16,
- fontWeight: 'bold'
- }
- },
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#fff'
- }
- },
- formatter:'{b} <br /> {a0}: {c0}<br />{a1}: {c1}' + "%"
- },
- "grid": {
- top: '70',
- left: '60',
- bottom: '30'
- },
- legend: {
- data: ['住院平均床日数', '环比'],
- textStyle: {
- color: '#b5e1fc'
- },
- top: '30'
- },
- xAxis: [{
- type: 'category',
- data: xAxisData,
- axisPointer: {
- type: 'shadow'
- },
- axisTick: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize
- }
- }],
- yAxis: [{
- type: 'value',
- name: '天',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e'
- }
- },
- axisLabel: {
- color: '#b5e1fc',
- fontSize: fontSize2
- },
- splitNumber: 2
- },
- {
- type: 'value',
- name: '环比',
- nameTextStyle: {
- color: '#b5e1fc' // 坐标轴名称颜色
- },
- splitLine: {
- show: false // 不显示坐标轴刻度
- },
- axisLine: {
- lineStyle: {
- color: '#095f8e' // 坐标轴轴线颜色
- }
- },
- axisLabel: {
- color: '#b5e1fc', // 坐标轴刻度标签文本颜色
- fontSize: fontSize2
- },
- show:true,
- splitNumber: 4
- }
- ],
- series: [{
- name: '住院平均床日数',
- type: 'bar',
- "data": series0data,
- barWidth: 20,
- label: {
- normal: {
- show: true,
- position: 'top', // 在柱状图上方显示
- color: '#fff' // 柱状图上方显示的数值颜色
- }
- },
- itemStyle: {
- barBorderRadius: [8, 8, 0, 0],
- color: '#00e6f3'
- }
- },
- {
- name: '环比',
- type: 'line',
- yAxisIndex: 1,
- "data": series1data,
- itemStyle: {
- color: '#03fa6d'
- },
- markLine:{
- data:[
- {yAxis: 0, name: '环比'}
- ],
- label:{
- show: true,
- position: 'middle'
- },
- lineStyle:{
- color: '#ffffff'
- }
- }
- }
- ]
- }
- return option;
- }
|