$(function () { DrLine() }) function DrLine(){ require.config({ paths: { echarts: '/Echarts/asset/js/echarts', 'echarts/chart/line': '/Echarts/asset/js/echarts-map' } }); option = { tooltip: { show:true, trigger: 'axis' }, grid: { x: 30, y: 30, x2: 50, y2: 30 }, xAxis: [ { type: 'category', boundaryGap: false, axisTick: {show: false}, data: xAxisLabel, axisLabel: { show: true, interval: 5 // {number} } } ], yAxis: [ { type: 'value', splitNumber:20, axisLabel: { formatter: '{value}' }, splitArea: { show: true } } ], series: [ { name: 'Air Temperature', type: 'line', symbol: 'none', itemStyle: { normal: { color: '#FFFF01', lineStyle: { shadowColor: 'rgba(0,0,0,0.4)' } } }, data: airtData }, { name: 'Surface temperature', type: 'line', symbol:'none', itemStyle: { normal: { color: '#FE0000', lineStyle: { shadowColor: 'rgba(0,0,0,0.4)' } } }, data: rstData } ] }; require( [ 'echarts', 'echarts/chart/line' ], function (ec) { var myChart = ec.init(document.getElementById('main')); myChart.setOption(option); } )}