X/Y 轴的分割线 :
splitLine: { show: false/true }
X/Y 轴的刻度线:
axisTick:{ show: false/true, inside: true /** 刻度线朝内 **/ }
X轴字体倾斜度:
axisLabel: { rotate: 45 /**倾斜度数 **/ }
区域缩放:dataZoom
dataZoom: [
{
show: false,
type: 'inside',
// 默认显示前25条数据
startValue: 0,
endValue: 25,
minValueSpan: 5,
},
{
show: false,
startValue: 0,
endValue: 25,
},
],
点击事件
let myChart = echarts.getInstanceByDom(document.getElementById('id选择器类名'))
myChart.off('click')
myChart.on('click', (params) => {
console.log(params)
})
echarts单轴散点图给了新数据之后原来的数据还渲染在图表中
myChart.setOption(newData, {notMerge: true}); // 渲染图表的时候加上notMerge: true
原生图形,自定义图片的用法
graphic: [{
type: 'image',
style: {
image: require('../../../assets/increase.png'), //图片地址使用require包裹
width: 15,
height: 15,
},
right: '2%',
top: '5%',
}],
折线不显示
{
name: '测试总数',
type: 'line',
data: this.timelinessRatioMap.total,
symbol: 'none',
lineStyle: {
opacity: 0, // 加上这句代码
},
},