echart中markpoint标记点显示不全的情况
在echart中使用过大数据难以区分 在yAxis中加上了 scale: true
的参数,只展现数据发生变化的区域,当在这个条件上加上不在这个区间的标记点时,标记点将会丢失
解决办法:
使用boundaryGap: ['0%', '20%']
属性
使用位置:在options中的yAxis:[ { } ]
中添加
yAxis: {
scale: true,
type: "value",
boundaryGap: ['0%', '10%']
},
或者在series中加上
series: [
{
name: '数量',
type: "line",
data: obj,
markPoint: {
symbol: "circle",
symbolSize: 3,
itemStyle: {
color: "red",
},
data: this.markPoint,
},
{
symbolSize: 1,
data:this.markPoint, //放的x,y值的数组
color:'red',
type: 'scatter'
} //在图上加上散点图,将数据扩大
],