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 || [];
	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: '80',
			left: '80',
			bottom: '30'
		},
		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;
}
