option = { backgroundColor:"#ffffff", tooltip: { trigger: 'xAxis', // 若需要使用默认的『显示』『隐藏』触发规则,则可以去掉trigger的配置 axisPointer: { type: 'cross', show: true }, formatter: '{a}{b}{c}' // 默认触发规则中散点展示的内容,{a}标题;{b}X坐标;{c}Y坐标 }, grid: { show:true, left:100, bottom:100, borderColor: "black", borderWidth:3 }, xAxis: [ { max:26, splitLine:{ show:false //去掉网格线 }, name: 'letter', nameGap: 30, // y轴name与横纵坐标轴线的间距 nameLocation: "middle", // y轴name处于y轴的什么位置 "nameTextStyle":{ "fontSize":25, "fontWeight":700 } , type: 'category', axisLabel: { show: true, textStyle: { color: '#000000', "fontSize": 18 }, }, data:["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r", "s","t","u","v","w","x","y","z"], axisLine: { show: true, textStyle: { color: '#', "fontSize": 24 }, } } ], yAxis: [ { name: 'extreme difference', type: 'value', splitLine:{ show:false //去掉网格线 }, nameGap: 50, // y轴name与横纵坐标轴线的间距 nameLocation: "middle", // y轴name处于y轴的什么位置 "nameTextStyle":{ "fontSize":25, "fontWeight":700 } , axisLabel: { show: true, textStyle: { color: '#', "fontSize": 18 }, }, axisLine: { show: true } }, ], series: [ { name: 'actual number', "nameTextStyle":{"fontSize":25} , type: 'scatter', data: [ ], color: '#000000', symbolSize: 5 }, { name: 'preduct number', "nameTextStyle":{"fontSize":25} , type: 'bar', data:[ -0.123244674461507, 0.16314595522169398, -0.689372491490222, -0.15556675185366903, 0.051100854735767975, 0.381986864408016, 0.190510995115348, -0.2707461090585199, 0.30883672094050696, 0.017228242059400795, -0.170671435516123, 0.05074352525944903, 0.04158129549206402, -0.3442380494275119, -0.0013234194328020088, -0.10566830117839698, -0.0323021582418479, -0.213596954644645, 0.42812014131801, 0.25661609635098503, 0.06327415733265296, 0.1675478895394987, -0.033115214887789984, -0.049530400301248695, 0.005017902736409008, 0.0, ].map(item => { //重点:超出规定值变色 if (item > 0.23) { return { value: item, itemStyle: { color: '#bf74a1' } } } else if(item<-0.23){ return { value: item, itemStyle: { color: '#85bed9' } } } return item }), markLine: { symbol: "none",//去掉警戒线最后面的箭头 label: {position: "end"},//将警示值放在哪个位置,三个值“start”,"middle","end" 开始 中点 结束 data: [ { name: 'x', yAxis: 0.23, silent: true, //鼠标悬停事件 true没有,false有 lineStyle: { //警戒线的样式 ,虚实 颜色 type: "solid", color: "grey", }, label: { show: true, textStyle:{ fontSize:"25px", } }, }, { name: '', yAxis: -0.23, silent: true, //鼠标悬停事件 true没有,false有 lineStyle: { //警戒线的样式 ,虚实 颜色 type: "solid", color: "grey", }, label: { show: true, textStyle:{ fontSize:"25px", } }, }, ] }, color: 'grey' } ] };