//定义一个起点,终点 that.beforeLastYearSymbolStart that.beforeLastYearSymbolEnd
//这个点最好后端给 前端不好控制 如果固定不变的话就无所谓了 在函数中做判断就可以了
//series.dataIndex 这个你可以理解为x轴数组的下标
series: [
{
smooth: true, //true 为平滑曲线,false为直线
symbol: function (value, series) {
if (
series.dataIndex >= that.beforeLastYearSymbolStart &&
series.dataIndex <= that.beforeLastYearSymbolEnd
) {
return "emptyCircle"; // 拐点显示为圆形
} else {
return "none"; // 其他拐点不显示
}
},
symbolSize: 20,
name: this.legendList[0],
animationDuration: 1800,
type: "line",
data: this.ydata3,
itemStyle: {
color: "rgba(80, 201, 131, 1)",
borderWidth: 5,
},
lineStyle: {
width: 5,
shadowColor: "rgba(80, 201, 131, 1)",
shadowBlur: 20,
},
}]
echarts 折线图固定坐标显示拐点
于 2024-02-04 16:05:32 首次发布