$(document).ready(function () { function initLineEchart(id, xData, yData, yData2, yData3) { var echart = null var dom = document.getElementById(id); echart = echarts.init(dom); var option = { tooltip: { trigger: 'axis', }, legend: { right: '0', top: '2%', itemWidth: 12, itemHeight: 12, icon: 'circle', textStyle: { color: '#91ceff', fontSize: 18, paddingLeft: 5, } }, grid: { top: '15%', left: '3%', right: '0', bottom: '3%', containLabel: true }, xAxis: { type: "category", axisLine: { show: true, lineStyle: { color: "rgba(255,255,255,.6)", width: 1 } }, axisTick: { show: false }, axisLabel: { show: true, color: "#fff", fontSize: 20, }, splitLine: { show: false, lineStyle: { color: "rgba(255,255,255,.2)", } }, data: xData }, yAxis: [{ name: '(°C)', min: 0, max: 40, interval: 10, nameTextStyle: { color: 'rgba(145,206,255,.5)', fontSize: 18, padding: [0, 0, 5, -30] }, type: 'value', axisTick: { show: false }, axisLine: { show: false, }, axisLabel: { color: "#91ceff", //X轴文字颜色 fontSize: 18, }, splitLine: { show: true, lineStyle: { type: "dashed", color: "rgba(255,255,255,.3)", } }, }], series: [{ name: '粮高温', type: 'line', symbol: 'none', color: '#ffd12b', lineStyle: { width: 3 }, areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(255, 209, 43,0.3)' }, { offset: 1, color: 'rgba(255, 209, 43,0)' }, ]), }, label: { show: false, }, data: yData, }, { name: '粮均温', type: 'line', symbol: 'none', color: '#02afff', lineStyle: { width: 3 }, areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgba(2, 175, 255, .3)' }, { offset: 1, color: 'rgba(2, 175, 255,0)' }, ]), }, label: { show: false, }, data: yData2, }, { name: '粮低温', type: 'line', symbol: 'none', color: '#39ff02', lineStyle: { width: 3 }, areaStyle: { color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: 'rgb(97,154,82)' }, { offset: 1, color: 'rgba(2, 175, 255,0)' }, ]), }, label: { show: false, }, data: yData3, }] }; if (option && typeof option === "object") { echart.setOption(option, true); } } var linexData = ['01', '02', '03', '04', '05', '06', '07']; var lineyData = [22, 23, 23, 23, 24, 25, 28]; var lineyData2 = [16.5, 17.5, 18, 16.5, 18, 19, 21]; var lineyData3 = [11, 12, 13, 10, 12, 13, 14]; initLineEchart('lineChart1', linexData, lineyData, lineyData2, lineyData3) initLineEchart('lineChart2', linexData, lineyData, lineyData2, lineyData3) initLineEchart('lineChart3', linexData, lineyData, lineyData2, lineyData3) initLineEchart('lineChart4', linexData, lineyData, lineyData2, lineyData3) initLineEchart('lineChart5', linexData, lineyData, lineyData2, lineyData3) initLineEchart('lineChart6', linexData, lineyData, lineyData2, lineyData3) var swiper = new Swiper('.m-swiperl2 .swiper', { slidesPerView: 1, // autoplay: { // delay: 2500, // disableOnInteraction: false, // }, // loop: true, pagination: { el: '.g-swbtnl .swiper-pagination', type: 'fraction', }, navigation: { nextEl: '.g-swbtnl .swiper-button-next', prevEl: '.g-swbtnl .swiper-button-prev', }, }); });