function func(x) { if(x<30) return 10013*x + 90804 else if(x>35) return 250403*Math.pow(Math.E,-0.008*x) else return null } function generateData() { let data = []; for (let i = 0; i <= 370; i += 1) { data.push([i, func(i)]); } return data; } option = { backgroundColor:"#ffffff", tooltip: { trigger: 'xAxis', // 若需要使用默认的『显示』『隐藏』触发规则,则可以去掉trigger的配置 axisPointer: { type: 'cross', show: true }, formatter: '{a}{b}{c}' // 默认触发规则中散点展示的内容,{a}标题;{b}X坐标;{c}Y坐标 }, legend: { data: [{name:'actual number',textStyle: {color:"#85bed9"}}, {name:'prediict number',textStyle: {color:"#bf74a1"}}], orient: 'vertical', top:"85px", right: '14%', borderWidth:2, textStyle: { fontSize: '25px', fontWeight: 700 }, color: ['#85bed9', '#bf74a1'], }, grid: { show:true, left:100, bottom:100, borderColor: "black", borderWidth:3 }, xAxis: [ { max:370, name:"Date", nameGap: 30, // y轴name与横纵坐标轴线的间距 nameLocation: "middle", // y轴name处于y轴的什么位置 nameTextStyle:{ "fontSize": 25 }, type: 'category', axisLabel: { interval:30, show: true, textStyle: { color: '#000000', "fontSize": 18 }, }, axisLine: { show: true } } ], yAxis: [ { type: 'value', name: 'Number of reported results', nameGap: 80, // y轴name与横纵坐标轴线的间距 nameLocation: "middle", // y轴name处于y轴的什么位置 "nameTextStyle":{ "fontSize":25 } , max: 320000, axisLabel: { show: true, textStyle: { color: '#', "fontSize": 18 }, }, axisLine: { show: true } }, ], series: [ { name: 'actual number', "nameTextStyle":{"fontSize":25} , type: 'scatter', data: [ 80630, 101503, 91477, 107134, 153880, 137586, 132726, 169484, 205880, 209609, 222197, 220950, 280622, 243964, 273727, 241489, 269929, 258038, 276404, 302348, 331844, 296968, 313220, 294687, 341314, 351663, 361908, 358176, 359679, 319698, 311018, 288228, 336236, 305372, 304830, 278826, 269885, 277471, 261521, 287836, 289721, 342003, 265238, 282327, 273306, 278731, 306356, 277576, 250674, 255907, 248363, 250413, 251094, 240137, 257304, 240018, 203730, 229895, 218595, 218595, 207473, 201799, 208884, 226349, 192049, 179436, 185406, 202855, 217856, 169071, 179830, 156311, 154987, 173636, 160161, 156785, 169066, 150197, 149507, 165468, 173696, 149070, 158139, 135219, 144648, 155079, 124532, 129651, 121356, 117856, 117761, 141158, 134210, 126241, 109828, 114907, 123255, 113448, 129991, 107987, 106681, 112383, 108899, 102007, 97955, 119232, 95562, 97452, 91548, 103153, 98967, 88974, 106652, 77991, 77658, 95643, 85817, 107750, 85979, 76292, 74458, 72518, 88932, 74412, 79446, 75673, 77585, 73225, 67115, 68349, 70722, 73933, 70920, 69884, 66814, 67909, 66431, 63380, 62723, 63188, 63846, 60069, 56839, 60969, 62768, 63241, 61278, 65431, 58263, 56738, 58478, 58991, 61026, 60020, 55376, 51958, 56684, 53802, 59968, 55989, 53430, 54665, 47205, 55359, 50484, 53342, 47645, 53111, 50617, 46089, 50450, 47986, 47312, 45645, 44212, 47248, 41765, 40486, 42645, 44578, 47344, 43407, 42806, 47094, 41785, 40545, 46910, 46246, 40549, 39234, 38769, 39611, 42574, 39667, 42237, 39086, 43099, 36769, 39813, 39228, 39171, 38384, 40650, 37791, 37353, 39250, 36662, 34909, 38381, 37229, 37350, 38841, 36223, 35516, 36223, 37654, 37301, 34198, 35276, 31652, 35376, 35105, 35815, 34938, 33965, 38245, 35617, 35888, 33549, 33700, 36737, 34716, 31241, 30214, 34281, 33660, 35343, 31903, 35724, 31191, 32018, 32733, 32734, 30992, 31962, 32172, 29237, 27887, 29147, 29497, 32142, 33344, 37309, 33418, 33102, 35050, 31277, 31976, 34455, 31509, 32777, 28994, 31706, 30985, 31355, 30477, 31223, 28202, 30088, 32288, 32014, 30935, 32522, 29026, 26905, 28408, 26878, 28575, 29151, 27197, 28906, 30403, 30459, 31269, 28612, 28322, 28741, 28637, 29084, 29279, 28947, 28953, 30063, 27609, 27905, 25156, 24672, 26498, 27502, 27670, 29554, 27330, 29743, 31068, 26096, 27213, 28984, 27467, 25993, 24660, 25085, 26536, 27475, 25576, 27465, 29208, 24749, 24991, 24288, 27437, 26663, 27705, 24197, 26381, 25206, 26051, 23739, 2569, 22628, 24646, 23873, 25577, 23153, 23509, 24899, 21199, 23640, 21157, 21947, 22873, 24101, 20824, 22176, 22853, 22336, 22166, 26010, 24137, 22180, 20490, 21937, 20281, 15554, 20011, 20879, 20160, 20001, 21204, 20380, ], color: '#85bed9', symbolSize: 5 }, { name: 'prediict number', "nameTextStyle":{"fontSize":25} , type: 'line', data: generateData(), color: '#bf74a1' } ] };