import * as echarts from 'echarts';
export function setOptions(){
	let option = {
		tooltip: {
			trigger: 'item'
		},
		legend: {
			bottom: '15%',
			right: '5%',
			orient: 'vertical',
			itemWidth: 8,
			itemHeight: 8,
			textStyle: {
				color: "#fff",
				fontSize: 10
			}
		},
		series: [{
			name: '货物类型',
			type: 'pie',
			radius: ['45%', '70%'],
			center: ['40%', '50%'],
			avoidLabelOverlap: false,
			label: {
				show: false,
				position: 'center'
			},
			emphasis: {
				label: { show: false }
			},
			labelLine: { show: false },
			data: [{ value: 108, name: '砂石' },
				   { value: 735, name: '水泥' },
				   { value: 580, name: '干散货' },
				   { value: 484, name: '大理石' },
				   { value: 300, name: '有机盐' },
			]
		}]
	};
	return option;
}
export function setLineOptions(){
	let option = {
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				crossStyle: {
					color: '#999'
				}
			}
		},
		xAxis: {
			type: 'category',
			axisLabel: {
				color: '#d6d6d6',
				fontSize: 12
			},
			data: ["12-21","12-22","12-23","12-24","12-25","12-26","12-27"]
		},
		grid: {
			top: '6%',
			left: '1%',
			right: '4%',
			bottom: '1%',
			containLabel: true
		},
		yAxis: {
			type: 'value',
			axisLabel: {
				fontSize: 12,
				color:"#fff",
				showMaxLabel: true
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: ['#5a5a5a']
				}
			}
		},
		series: [{
			data: [125,586,458,364,210,586,751],
			type: 'line',
			smooth: true
		}]
	};
	return option;
}
export function setBarOptions(){
	let option = {
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross',
				crossStyle: {
					color: '#999'
				}
			}
		},
		grid: {
			top: '6%',
			left: '2%',
			right: '2%',
			bottom: '1%',
			containLabel: true
		},
		xAxis: {
			type: 'category',
			axisLabel: {
				color: '#d6d6d6',
				fontSize: 12
			},
			data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
		},
		yAxis: {
			type: 'value',
			axisLabel: {
				fontSize: 12,
				color:"#fff",
				showMaxLabel: true
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: ['#5a5a5a']
				}
			}
		},
		series: [{
			data: [120, 240, 150, 80, 70, 110, 130, 150, 80, 70, 110, 130],
			type: 'bar',
			itemStyle: {
				color: new echarts.graphic.LinearGradient(
					0, 0, 1, 0, [{
							offset: 0,
							color: '#5940ff'
						},
						{
							offset: 1,
							color: '#a38cff'
						}
					]
				),
			}
		}]
	};
	return option;
}