/***
 * 接口数量 和 接口占比 统一由这个方法调用
 */
function countAndPercent(year){
	if(year == null){
		year = new Date().getFullYear();
	}
	$.post("/visualization/countAndPercent",{
		year:year
	},function (res) {
		console.log(res);
		//渲染接口数量
		if(res.count.length > 0){
			$(".data1").remove();
			let tmpl = "";
			for(let i=0;i<res.count.length;i++){
				if (i==0){
					tmpl += "<div class='data1 data_left'><div class='qiu'>";
				}else{
					tmpl += "<div class='data1'><div class='qiu'>";
				}
				tmpl += "<p>"+res.count[i].count+"个</p>";
				tmpl += "</div>";
				tmpl += "<span>"+res.count[i].shareType+"</span></div>";
			}
			$(".con_sk").append(tmpl);
		}
		//渲染接口占比
		jkzb(res.percent);
	});
}

/***
 * 获取市接口调用频次top5和top20 统一由这个方法调用
 */
function getCityFrequency(){
	$.post("/visualization/getCityFrequency",function (res) {
		sjk1(res.top5);
		sjk2(res.top20);
	});
}

/***
 * 获取省接口调用频次top5和top20 统一由这个方法调用
 */
function getProvinceFrequency(){
	$.post("/visualization/getProvinceFrequency",function (res) {
		shjk1(res.top5);
		shjk2(res.top20);
	});
}

/***
 * 获取归集和接口排名 统一由这个方法调用
 */
function imputationDataAndInterfaceRanking() {
	$.post("/visualization/getImputationDataAndInterfaceRanking",function (res) {
		jkgj(res.data);
		jkgj2(res.interface);
	});
}

/***
 * 获取归集数据分析 由这个方法调用
 */
function imputationDataList(year) {
	if(year == null){
		year = new Date().getFullYear();
	}
	$.post("/visualization/getImputationDataList",{
		year:year
	},function (res) {
		gjsj(res);
	});
}

function getFaultInterfaceCount() {
	$.post("/visualization/getFaultInterfaceCount",function (res) {
		$("#faultInterfaceCount").text(res);
	});
}

// 接口占比
function jkzb(percent) {
	let trafficWay = [];
	let jsArr = [];
	let html = "";
	let classArr = ['sgj','sgx','sgj2','sgx'];
	//把JSON格式处理为JSONArray并渲染
	if(percent.length>0){
		//渲染饼图
		for(let i=0;i<percent.length;i++){
			let js = {};
			js.name = percent[i].shareType;
			js.value = percent[i].count;
			jsArr.push(js);
			//组装页面元素
			html += '<div class="'+classArr[i]+' jkzb_list">';
			html += '<h3><i></i>'+percent[i].shareType+'</h3>';
			html += '<p><span>'+percent[i].count+'</span><span>'+percent[i].percent+'%</span></p>';
			html += '</div>';
		}
		trafficWay = jsArr;
		//渲染页面数据
		$(".jkzb_list").remove();
		$(".jkzb_txt").append(html);
	}else{
		let html = '<div class="sgj jkzb_list">' +
		'	<h3><i></i>市归集</h3>' +
		'	<p><span>0</span><span>0%</span></p>' +
		'</div>' +
		'<div class="sgx jkzb_list">' +
		'	<h3><i></i>市共享</h3>' +
		'	<p><span>0</span><span>0%</span></p>' +
		'</div>' +
		'<div class="sgj2 jkzb_list">' +
		'	<h3><i></i>省归集</h3>' +
		'	<p><span>0</span><span>0%</span></p>' +
		'</div>' +
		'<div class="sgx jkzb_list">' +
		'	<h3><i></i>省共享</h3>' +
		'	<p><span>0</span><span>0%</span></p>' +
		'</div>';
		//渲染页面数据
		$(".jkzb_list").remove();
		$(".jkzb_txt").append(html);
	}
	// 基于准备好的dom，初始化echarts实例
	var tootipTimer = null;
	var myChart1 = echarts.init(document.getElementById('jkzb'));
	var img = "data:image/png;base64,[encoded data, 8780 characters]"
	var nameArray = trafficWay.map(item => {
		return item.name
	})
	var data = [];
	var color = ['#ff3000', '#00cfff', '#006ced', '#ffe000', '#ffa800', '#ff5b00', '#ff3000', '#ff3000']
	var size = 120
	var left = 60
	for (var i = 0; i < trafficWay.length; i++) {
		data.push({
			value: trafficWay[i].value,
			name: trafficWay[i].name,
			itemStyle: {
				normal: {
					borderWidth: 5,
					shadowBlur: 20,
					borderColor: color[i],
					shadowColor: color[i]
				}
			}
		});
	}
	var seriesOption = [{
		name: '',
		type: 'pie',
		clockWise: false,
		// 适配给你写好了
		radius: [72, 76],
		width: size,
		height: size,
		center: ['51%', '50%'],
		left: left,
		top: "center",
		hoverAnimation: false,
		itemStyle: {
			normal: {
				label: {
					show: false,
					position: 'outside',
					color: '#ddd',
					formatter: function (params) {
						var percent = 0;
						var total = 0;
						for (var i = 0; i < trafficWay.length; i++) {
							total += trafficWay[i].value;
						}
						percent = ((params.value / total) * 100).toFixed(0);
						if (params.name !== '') {
							return '接口占比：' + params.name + '\n' + '\n' + '占百分比：' + percent + '%';
						} else {
							return '';
						}
					},
				},
			}
		},
		data: data
	}];
	option = {
		// backgroundColor: '#01132e',
		color: color,
		graphic: {
			elements: [{
				type: "image",
				z: 3,
				style: {
					image: img,
					width: size,
					height: size
				},
				left: left,
				top: 'center',
			}]
		},
		legend: [{
			// icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`,
			orient: 'vertical',
			// x: 'left',
			data: nameArray.slice(4, 8),
			left: '10%',
			top: 'center',
			itemWidth: 15,
			align: 'left',
			textStyle: {
				color: "#fff"
			},
			itemGap: 20
		},
			{
				// icon: `path://M881.387 297.813c38.08 65.387 57.28 136.747 57.28 214.187s-19.094 148.8-57.28 214.187c-38.187 65.28-89.92 117.12-155.2 155.2S589.44 938.667 512 938.667s-148.8-19.094-214.187-57.28c-65.28-38.08-117.013-89.814-155.306-155.307C104.427 660.8 85.333 589.44 85.333 512c0-77.333 19.094-148.693 57.28-214.187 38.08-65.28 89.814-117.013 155.307-155.306C363.2 104.533 434.56 85.333 512 85.333c77.333 0 148.693 19.094 214.187 57.28 65.28 38.187 117.013 89.92 155.2 155.2z m-217.707-47.36C617.387 223.467 566.827 209.92 512 209.92s-105.387 13.547-151.68 40.533-82.987 63.68-109.973 109.974c-26.987 46.293-40.534 96.853-40.534 151.68s13.547 105.386 40.534 151.68c26.986 46.293 63.68 82.986 109.973 109.973 46.293 26.987 96.853 40.533 151.68 40.533s105.387-13.546 151.68-40.533c46.293-26.987 82.987-63.68 109.973-109.973 26.987-46.294 40.534-96.854 40.534-151.68s-13.547-105.387-40.534-151.68c-27.093-46.294-63.786-82.987-109.973-109.974z`,
				orient: 'vertical',
				// x: 'left',
				data: nameArray.slice(0, 4),
				left: '10%',
				top: 'center',
				itemWidth: 15, show: false,
				align: 'left',
				textStyle: {
					color: "#fff"
				},
				itemGap: 20
			}],
		tooltip: {
			show: true
		},
		toolbox: {
			show: false
		},
		series: seriesOption
	}
	if (option) {
		myChart1.setOption(option);
	}
	// 可调用clearLoop方法，清除定时器
	tootipTimer && tootipTimer.clearLoop();
	tootipTimer = null;
	// 调用轮播的方法
	tootipTimer = tools.loopShowTooltip(myChart1, option, {
		interval: 2000, // 轮播间隔时间
		loopSeries: true // 是否开启轮播循环
	});
}

// 归集数据排名
function jkgj(res) {
	//处理数据为数组
	let jsArr = [];
	if(res.length > 0){
		for(let i=0;i<res.length;i++){
			let js = {};
			js.name = res[i].deptName;
			js.value = res[i].count;
			jsArr.push(js);
		}
	}
	let myChart22 = echarts.init(document.getElementById('jkgj'));
	let data = jsArr;
	let xAxisData = data.map(item => item.name)
	let seriesData = data.map(item => item.value)
	let maxSeriesData = []
	const MAX = Math.max(...seriesData)
	for (let i = 0; i < seriesData.length; i++) {
		maxSeriesData.push(MAX)
	}
	let barLinearColors = [
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#EB3B5A"},
			{offset: 1, color: "#FE9C5A"}
		]),
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#FA8231"},
			{offset: 1, color: "#FFD14C"}
		]),
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#F7B731"},
			{offset: 1, color: "#FFEE96"}
		]),
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#395CFE"},
			{offset: 1, color: "#2EC7CF"}
		])
	]
	function rankBarColor(cData) {
		let tempData = []
		cData.forEach((item, index) => {
			tempData.push({
				value: item,
				itemStyle: {
					color: index > 3 ? barLinearColors[3] : barLinearColors[index]
				}
			})
		})
		return tempData
	}
	var option = {
		tooltip: {
			// backgroundColor: 'rgba(50,50,50,.3)',
			textStyle: {
				color: '#fff'
			}
		},
		grid: {
			left: "-10%",
			right: "2%",
			width: "100%",
			bottom: "0%",
			top: "5%",
			containLabel: true
		},
		xAxis: {
			type: "value",
			splitLine: {show: false},
			axisLabel: {show: false},
			axisTick: {show: false},
			axisLine: {show: false}
		},
		yAxis: [
			{
				type: "category",
				inverse: true,
				axisLine: {show: false},
				axisTick: {show: false},
				data: xAxisData,
				axisLabel: {
					rich: {
						nt1: {
							color: "#fff",
							backgroundColor: '#EB3B5A',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						},
						nt2: {
							color: "#fff",
							backgroundColor: '#FA8231',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						},
						nt3: {
							color: "#fff",
							backgroundColor: '#F7B731',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						},
						nt: {
							color: "#fff",
							backgroundColor: '#00a9c8',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						}
					},
					formatter: function (value, index) {
						let idx = index + 1
						if (idx <= 3) {
							return ["{nt" + idx + "|" + idx + "}"].join("\n");
						} else {
							return ["{nt|" + idx + "}"].join("\n");
						}
					}
				}
			},
			{//名称
				type: 'category',
				offset: -10,
				position: "left",
				axisLine: {show: false},
				axisTick: {show: false},
				axisLabel: {
					color: '#fff',
					align: "left",
					verticalAlign: "bottom",
					lineHeight: 30,
					fontSize: 12
				},
				data: xAxisData
			},
		],
		series: [
			{
				zlevel: 1,
				type: "bar",
				barWidth: 13,
				data: rankBarColor(seriesData),
				itemStyle: {
					normal: {
						barBorderRadius: 30
					}
				},
				label: {
					show: true,
					fontSize: 12,
					color: "#fff"
				}
			},
			{
				type: "bar",
				barWidth: 13,
				barGap: "-100%",
				itemStyle: {
					normal: {
						barBorderRadius: 30,
						color: 'rgba(27, 17, 134, 0.0)'
					}
				},
				data: maxSeriesData
			}
		]
	};
	if (option) {
		myChart22.setOption(option);
	}
}

// 归集接口排名
function jkgj2(res) {
	//处理数据为数组
	let jsArr = [];
	if(res.length > 0){
		for(let i=0;i<res.length;i++){
			let js = {};
			js.name = res[i].deptName;
			js.value = res[i].count;
			jsArr.push(js);
		}
	}
	var myChart33 = echarts.init(document.getElementById('jkgj2'));
	let data = jsArr;
	let xAxisData = data.map(item => item.name)
	let seriesData = data.map(item => item.value)
	let maxSeriesData = []
	const MAX = Math.max(...seriesData)
	for (let i = 0; i < seriesData.length; i++) {
		maxSeriesData.push(MAX)
	}
	let barLinearColors = [
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#EB3B5A"},
			{offset: 1, color: "#FE9C5A"}
		]),
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#FA8231"},
			{offset: 1, color: "#FFD14C"}
		]),
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#F7B731"},
			{offset: 1, color: "#FFEE96"}
		]),
		new echarts.graphic.LinearGradient(0, 1, 1, 1, [
			{offset: 0, color: "#395CFE"},
			{offset: 1, color: "#2EC7CF"}
		])
	]

	function rankBarColor(cData) {
		let tempData = []
		cData.forEach((item, index) => {
			tempData.push({
				value: item,
				itemStyle: {
					color: index > 3 ? barLinearColors[3] : barLinearColors[index]
				}
			})
		})
		return tempData
	}

	var option = {
		tooltip: {
			// backgroundColor: 'rgba(50,50,50,.3)',
			textStyle: {
				color: '#fff'
			}
		},
		grid: {
			left: "-10%",
			right: "2%",
			width: "100%",
			bottom: "0%",
			top: "5%",
			containLabel: true
		},
		xAxis: {
			type: "value",
			splitLine: {show: false},
			axisLabel: {show: false},
			axisTick: {show: false},
			axisLine: {show: false}
		},
		yAxis: [
			{
				type: "category",
				inverse: true,
				axisLine: {show: false},
				axisTick: {show: false},
				data: xAxisData,
				axisLabel: {
					rich: {
						nt1: {
							color: "#fff",
							backgroundColor: '#EB3B5A',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						},
						nt2: {
							color: "#fff",
							backgroundColor: '#FA8231',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						},
						nt3: {
							color: "#fff",
							backgroundColor: '#F7B731',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						},
						nt: {
							color: "#fff",
							backgroundColor: '#00a9c8',
							width: 16,
							height: 16,
							fontSize: 12,
							align: "center",
							borderRadius: 100,
							padding: [0, 1, 2, 1]
						}
					},
					formatter: function (value, index) {
						let idx = index + 1
						if (idx <= 3) {
							return ["{nt" + idx + "|" + idx + "}"].join("\n");
						} else {
							return ["{nt|" + idx + "}"].join("\n");
						}
					}
				}
			},
			{//名称
				type: 'category',
				offset: -10,
				position: "left",
				axisLine: {show: false},
				axisTick: {show: false},
				axisLabel: {
					color: '#fff',
					align: "left",
					verticalAlign: "bottom",
					lineHeight: 30,
					fontSize: 12
				},
				data: xAxisData
			},
		],
		series: [
			{
				zlevel: 1,
				type: "bar",
				barWidth: 13,
				data: rankBarColor(seriesData),
				itemStyle: {
					normal: {
						barBorderRadius: 30
					}
				},
				label: {
					show: true,
					fontSize: 12,
					color: "#fff"
				}
			},
			{
				type: "bar",
				barWidth: 13,
				barGap: "-100%",
				itemStyle: {
					normal: {
						barBorderRadius: 30,
						color: 'rgba(27, 17, 134, 0.0)'
					}
				},
				data: maxSeriesData
			}
		]
	};


	myChart33.setOption(option);
	myChart33.resize(
		{
			width: 430,
			height: 421
		}
	);

}


// 省接口调用频次top5
function shjk1(res) {
	//将数据处理为三个数组，一个用于展示图例，一个用于渲染图表，一个用于美化
	let legend = [];
	let data = [];
	let fakeData = [];
	if(res.length > 0){
		for(let i=0;i<res.length;i++){
			legend.push(res[i].deptName);
			let js = {};
			js.name = res[i].deptName;
			js.value = res[i].count;
			data.push(js);
			js.name = res[i].deptName;
			js.value = res[i].count + 10;
			fakeData.push(js);
		}
	}
	// 基于准备好的dom，初始化echarts实例
	var myChart44 = echarts.init(document.getElementById('shjk_div1'));
	option = {
		//backgroundColor: '#010f23',
		title: {
			text: '省接口调用频次Top5',
			subtext: '',
			link: '',
			target: 'blank',
			x: 'center',
			top: '20',
			textStyle: {
				color: '#FFF',
				fontSize: 12,
			}
		},
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b} : {c}"
		},
		legend: {
			data: legend,
			x: 'center',
			y: '92%',
			textStyle: {
				color: '#FFF',
				fontSize: '10'
			}, itemWidth: 4, itemHeight: 4
		},
		color: ['#00a1e5', '#23c768', '#e5ce10', '#ff7e00', '#fe0000', '#c2c1bd',],
		series: [
			{
				name: '省接口调用频次',
				type: 'funnel',
				left: 'center',
				width: '70%',
				sort: 'ascending',
				label: {
					normal: {
						formatter: '{b}',
					},

				},
				labelLine: {
					normal: {
						show: true,
						length: 30
					}
				},
				itemStyle: {
					normal: {
						opacity: 0.3
					}
				},
				tooltip: {
					show: false
				},
				//虚影 假数据 为了好看
				data: fakeData
			},
			{
				name: '省接口调用频次',
				type: 'funnel',
				left: 'center',
				width: '70%',
				maxSize: '70%',
				sort: 'ascending',
				label: {
					normal: {
						position: 'inside',
						formatter: '{c}',
						textStyle: {
							color: '#fff',
							fontSize: 14,
						}
					},
					emphasis: {
						position: 'inside',
						formatter: '{b}: {c}%'
					}
				},
				itemStyle: {
					normal: {
						opacity: 8,
						borderColor: 'rgba(12, 13, 43, .9)',
						borderWidth: 3,
						shadowBlur: 5,
						shadowOffsetX: 0,
						shadowOffsetY: 5,
						shadowColor: 'rgba(0, 0, 0, .6)'
					}
				},
				data: data
			}
		]
	};
	if (option) {
		myChart44.setOption(option);
	}
}

// 省接口调用频次排名
function shjk2(res) {
	//将数据处理为两个数组
	let legend = [];
	let data = [];
	if(res.length > 0){
		for(let i=0;i<res.length;i++){
			legend.push(res[i].deptName);
			data.push(res[i].count);
		}
	}
	// 基于准备好的dom，初始化echarts实例
	let tootipTimer = null;
	let myChart45 = echarts.init(document.getElementById('shjk_div2'));
	let dataX = legend; //名称
	let dataY = data; //数据
	let zoomShow;
	if (dataY.length > 15) {
		zoomShow = true;
	} else {
		zoomShow = false;
	}
	var option = {
		// backgroundColor: '#010f23',
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'shadow',
			},
		},
		grid: {
			top: '10%',
			right: '5%',
			left: '5%',
			bottom: '23%',
		},
		xAxis: [
			{
				type: 'category',
				data: dataX,
				axisLine: {
					lineStyle: {
						color: 'rgba(66, 192, 255, .3)',
					},
				},
				axisLabel: {
					interval: 0,
					margin: 10,
					color: '#fff',
					textStyle: {
						fontSize: 11,
					},
					rotate: '45',
				},
				axisTick: {//刻度
					show: false,
				},
			},
		],
		yAxis: [
			{
				axisLabel: {
					padding: [3, 0, 0, 0],
					formatter: '{value}',
					color: 'rgba(95, 187, 235, 1)',
					textStyle: {
						fontSize: 12,
					},
				},
				axisTick: {
					show: true,
				},
				axisLine: {
					lineStyle: {
						color: 'rgba(66, 192, 255, .3)',
					},
				},
				splitLine: {
					lineStyle: {
						color: 'rgba(255,255,255,0)',
					},
				},
			},
		],
		dataZoom: [//滚动条
			{
				show: zoomShow,
				type: 'slider',
				realtime: true,
				startValue: 0,
				endValue: 15,
				xAxisIndex: [0],
				bottom: '10',
				left: '30',
				height: 5,
				borderColor: 'rgba(0,0,0,0)',
				textStyle: {
					color: '#fff',
				},
			},
		],
		series: [
			{
				type: 'bar',
				data: dataY,
				barWidth: '12',
				itemStyle: {
					normal: {
						color: new echarts.graphic.LinearGradient(
							0,
							0,
							0,
							1,
							[
								{
									offset: 0,
									color: 'rgba(5, 64, 250, 1)', // 0% 处的颜色
								},
								{
									offset: 0.98,
									color: 'rgba(5, 213, 255, 0)', // 100% 处的颜色
								},
							],
							false
						),
						shadowColor: 'rgba(1, 34, 62, 1)',
						shadowBlur: 4,
						barBorderRadius: [10, 10, 0, 0]

					},
				},
				label: {
					normal: {
						show: true,
						lineHeight: 10,
						formatter: '{c}',
						position: 'top',
						textStyle: {
							color: '#fff',
							fontSize: 10,
						},
					},
				},
			},
		],
	};
	if (option) {
		myChart45.setOption(option);
	}
	// 可调用clearLoop方法，清除定时器
	tootipTimer && tootipTimer.clearLoop();
	tootipTimer = null;
	// 调用轮播的方法
	tootipTimer = tools.loopShowTooltip(myChart45, option, {
		interval: 2000, // 轮播间隔时间
		loopSeries: true // 是否开启轮播循环
	});
}

// 市接口调用频次top5
function sjk1(res) {
	//将数据处理为三个数组，一个用于展示图例，一个用于渲染图表，一个用于美化
	let legend = [];
	let data = [];
	let fakeData = [];
	if(res.length > 0){
		for(let i=0;i<res.length;i++){
			legend.push(res[i].deptName);
			let js = {};
			js.name = res[i].deptName;
			js.value = res[i].count;
			data.push(js);
			js.name = res[i].deptName;
			js.value = res[i].count + 10;
			fakeData.push(js);
		}
	}
	// 基于准备好的dom，初始化echarts实例
	var myChart55 = echarts.init(document.getElementById('sjk_div1'));
	option = {
		//backgroundColor: '#010f23',
		title: {
			text: '市接口调用频次Top5',
			subtext: '',
			link: '',
			target: 'blank',
			x: 'center',
			top: '20',
			textStyle: {
				color: '#FFF',
				fontSize: 12,
			}
		},
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b} : {c}"
		},
		legend: {
			data: legend,
			x: 'center',
			y: '92%',
			textStyle: {
				color: '#FFF',
				fontSize: '10'
			}, itemWidth: 4, itemHeight: 4
		},
		color: ['#00a1e5', '#23c768', '#e5ce10', '#ff7e00', '#fe0000', '#c2c1bd',],
		series: [
			{
				name: '市接口调用频次',
				type: 'funnel',
				left: 'center',
				width: '60%',
				sort: 'ascending',
				label: {
					normal: {
						formatter: '{b}',
					},

				},
				labelLine: {
					normal: {
						show: true,
						length: 30
					}
				},
				itemStyle: {
					normal: {
						opacity: 0.3
					}
				},
				tooltip: {
					show: false
				},
				//虚影（假数据，为了好看）
				data: fakeData
			},
			{
				name: '市接口调用频次',
				type: 'funnel',
				left: 'center',
				width: '70%',
				maxSize: '70%',
				sort: 'ascending',
				label: {
					normal: {
						position: 'inside',
						formatter: '{c}',
						textStyle: {
							color: '#fff',
							fontSize: 14,
						}
					},
					emphasis: {
						position: 'inside',
						formatter: '{b}: {c}%'
					}
				},
				itemStyle: {
					normal: {
						opacity: 8,
						borderColor: 'rgba(12, 13, 43, .9)',
						borderWidth: 3,
						shadowBlur: 5,
						shadowOffsetX: 0,
						shadowOffsetY: 5,
						shadowColor: 'rgba(0, 0, 0, .6)'
					}
				},
				data: data
			}
		]
	};
	if (option) {
		myChart55.setOption(option);
	}
}

// 市接口调用频次排名
function sjk2(res) {
	//将数据处理为两个数组
	let legend = [];
	let data = [];
	if(res.length > 0){
		for(let i=0;i<res.length;i++){
			legend.push(res[i].deptName);
			data.push(res[i].count);
		}
	}
	var tootipTimer = null;
	// 基于准备好的dom，初始化echarts实例
	var myChart56 = echarts.init(document.getElementById('sjk_div2'));
	let dataX = legend; //名称
	let dataY = data; //数据
	let zoomShow = false;
	if (dataY.length > 15) {
		zoomShow = true;
	} else {
		zoomShow = false;
	}
	var option = {
		// backgroundColor: '#010f23',
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'shadow',
			},
		},
		grid: {
			top: '10%',
			right: '5%',
			left: '5%',
			bottom: '23%',
		},
		xAxis: [
			{
				type: 'category',
				data: dataX,
				axisLine: {
					lineStyle: {
						color: 'rgba(66, 192, 255, .3)',
					},
				},
				axisLabel: {
					interval: 0,
					margin: 10,
					color: '#fff',
					textStyle: {
						fontSize: 11,
					},
					rotate: '45',
				},
				axisTick: {//刻度
					show: false,
				},
			},
		],
		yAxis: [
			{
				axisLabel: {
					padding: [3, 0, 0, 0],
					formatter: '{value}',
					color: 'rgba(95, 187, 235, 1)',
					textStyle: {
						fontSize: 12,
					},
				},
				axisTick: {
					show: true,
				},
				axisLine: {
					lineStyle: {
						color: 'rgba(66, 192, 255, .3)',
					},
				},
				splitLine: {
					lineStyle: {
						color: 'rgba(255,255,255,0)',
					},
				},
			},
		],
		dataZoom: [//滚动条
			{
				show: zoomShow,
				type: 'slider',
				realtime: true,
				startValue: 0,
				endValue: 15,
				xAxisIndex: [0],
				bottom: '10',
				left: '30',
				height: 5,
				borderColor: 'rgba(0,0,0,0)',
				textStyle: {
					color: '#fff',
				},
			},
		],
		series: [
			{
				type: 'bar',
				data: dataY,
				barWidth: '12',
				itemStyle: {
					normal: {
						color: new echarts.graphic.LinearGradient(
							0,
							0,
							0,
							1,
							[
								{
									offset: 0,
									color: 'rgba(5, 64, 250, 1)', // 0% 处的颜色
								},
								{
									offset: 0.98,
									color: 'rgba(5, 213, 255, 0)', // 100% 处的颜色
								},
							],
							false
						),
						shadowColor: 'rgba(1, 34, 62, 1)',
						shadowBlur: 4,
						barBorderRadius: [10, 10, 0, 0]

					},
				},
				label: {
					normal: {
						show: true,
						lineHeight: 10,
						formatter: '{c}',
						position: 'top',
						textStyle: {
							color: '#fff',
							fontSize: 10,
						},
					},
				},
			},
		],
	};
	if (option) {
		myChart56.setOption(option);
	}
	// 可调用clearLoop方法，清除定时器
	tootipTimer && tootipTimer.clearLoop();
	tootipTimer = null;
	// 调用轮播的方法
	tootipTimer = tools.loopShowTooltip(myChart56, option, {
		interval: 2500, // 轮播间隔时间
		loopSeries: true // 是否开启轮播循环
	});
}


// 归集数据分析
function gjsj(res) {
	//将数据处理为数组
	let title = ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'];
	let _data = [];
	let _coords = [];
	if(res.length > 0){
		for(let i=0;i<res.length;i++){
			_data.push(res[i]);
			let element = [];
			element.push(title[i]);
			element.push(res[i]);
			_coords.push(element);
		}
	}

	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById('gjsj'));
	var img = [
		'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABRCAYAAABFTSEIAAAACXBIWXMAAAsSAAALEgHS3X78AAAEp0lEQVR42u3cz4sjRRTA8W9Vd3Vn8mMmjj9WQWSRZQ+CsH+B7MnDIgiCd0E8CYJ/gOAIelo8ehUP/gF6WLw5/gMueFP2sIcF0dHd2Z1kknR11fOQZJJJMtlZd03H7HtQpNOTnpn+8Lrm1etmjIig8e/DKoECKqACKqCGAiqgAiqghgIqoAIqoIYCKqACKqCGAiqgAiqghgIqoAJudKTr+osZMNPvBUQBHwHsPF9fB9R0DeHMOQ6T6WOrhEzXBM4swDOL0M6CrArRVoq3t2dGUIb9fTvatg8ZZup1PDBgzPmy98mey6qfzjLz2WaWjEUZKEvGyi9nWyneMOvGIyFQo2Sbg4MUSChpU9IeTTUpJdsEajPZOJeJG5uBZj7rLLduWS5dGm6XNLEELOFUFj54ACJCaychkpDSASK3bwsXL0YgVpWJKwM0iy9Zy8HdGru7jvt3Pbu7w0wES7drTwAbjTHMGCsQcIAnYTC1/wRx0wEnl27JNgZI8HQ6Kc1mQq83RNzaMjPzXqDbjTQaJRFLxIyyMSxAXEkWrhrQzAAmo5HOjCQf7jflILxOkohL+aUPgV4vEGNJo+E5PAy02+UIMEwBxo0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2Ia0Fn6PuK35sS0rLXJviGOAdgOe5szKXzKNre8I9mXaPZFObAsZPyhfHnKHubc24JNNOc+GY/fOE8besogrNXIJDqblwSaadrRmXoe7LF8cM4yeb2hTT7vUmS/cr827u512scSswSrypWUUhPyt5okjVVyqkUF4aMBIZnOWSsXBlJVFeBNB+msPzzTXt/Pbz5tbn0St9X6cDDNGUAQrOn3p2lOYlTzFxpdcr1k0xclOYV14jp1esm7jSlzyF10uT/OkMboimdDpXfR3dvz7vZvZ1Oj3a3QW6WFVVNClBnwwaRGGYgNN0YMsJAFhPlUysgioK0cvlxRb8FEfyBC+507mYGM9/G37OD4AubmxfDndbArTkCV7yNsADFDxBj9/Sy7mzw7MMhc9QeGvykbPDs7f0cj5BjwcoeBu4bKqHC4JbQOa9noHnWYge7WL2vHbnfJrbxdFlmSdoymySPXt+2wGwe62Pmz/cAvHedMRi/xKrg5uL+xnWZVm5voJZzE0s/KzKTcTZu3a7TdibjTB7e3vy+nBwG86r0G367xafd+DnthzwuZV4dy3i4caIF/EiXsSLEfEiXsSLeDEiXsSLeBEv4sWIeBEv4kW8GBEv4kW8iBcj4v0f4l+bPQ5YnMn04QAAAABJRU5ErkJggg==',
	]
	var data = [{
		/**_coords**/
		coords: _coords
	}]

	option = {
		// backgroundColor:'#011024',
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				label: {
					backgroundColor: '#0d3fb7'
				}
			}
		},
		grid: {
			top: '15%',
			left: '5%',
			right: '5%',
			bottom: '15%',
			containLabel: true
		},
		xAxis: [{
			type: 'category',
			axisLine: {
				show: true,
				color: '#0d3fb7'
			},
			axisLabel: {
				color: '#fff'
			},
			splitLine: {
				show: false
			},
			boundaryGap: true,
			/**title**/
			data: title,

		}],

		yAxis: [{
			type: 'value',
			min: 0,
			splitLine: {
				show: true,
				lineStyle: {
					color: 'rgba(255,255,255,0.1)'
				}
			},
			axisLine: {
				show: true,
			},
			axisLabel: {
				show: true,
				textStyle: {
					color: '#d1e6eb',

				},
			},
			axisTick: {
				show: false,
			},
		}],
		series: [{
			name: '归集数据分析',
			type: 'line',
			smooth: false, //是否平滑
			showAllSymbol: true,
			symbol: 'circle',
			symbolSize: 10,
			lineStyle: {
				normal: {
					color: "#0d3fb7",
					shadowColor: 'rgba(0, 0, 0, .3)',
					shadowBlur: 0,
					shadowOffsetY: 5,
					shadowOffsetX: 5,
				},
			},
			label: {
				show: true,
				position: 'top',
				textStyle: {
					color: '#fff'
				}
			},
			itemStyle: {
				color: "#0d3fb7",
				borderColor: "#fff",
				borderWidth: 3,
				shadowColor: 'rgba(0, 0, 0, .3)',
				shadowBlur: 0,
				shadowOffsetY: 2,
				shadowOffsetX: 2,
			},
			areaStyle: {
				normal: {
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
						offset: 0,
						color: 'rgba(108,80,243,0.3)'
					},
						{
							offset: 1,
							color: 'rgba(108,80,243,0)'
						}
					], false),
					shadowColor: 'rgba(108,80,243, 0.9)',
					shadowBlur: 20
				}
			},
			data: _data
		},
			{
				name: '滑行的光点',
				type: 'lines',
				coordinateSystem: 'cartesian2d',
				symbolSize: 30,
				polyline: true,
				effect: {
					show: true,
					trailLength: 0,
					symbol: "arrow",
					period: 10, //光点滑动速度
					symbolSize: 150,
					symbol: img[0]
				},
				lineStyle: {
					normal: {
						width: 1,
						opacity: 0.6,
						curveness: 0.2
					}
				},
				/**_data**/
				data: data
			}
		]
	};
	if (option) {
		myChart.setOption(option);
	}
}

