解决办法

在series里添加进去

series.itemStyle.normal.label的值为true

itemStyle:{
	normal:{
         label:{
              show:true //在每个上面显示当前值
          }
   }
}

显示值
echarts折线图

局部代码

series: [{
			data: [150, 60, 224, 218, 135, 147],
			type: 'line',
			itemStyle : { normal: {label : {show: true}}}, //重点
           	symbolSize: 10,   //设定实心点的大小
			
		}]

全部代码

var option = {
		tooltip: {
			trigger: 'axis',
			axisPointer: {       // 坐标轴指示器,坐标轴触发有效
				type: 'line'   // 默认为直线,可选为:'line' | 'shadow'
			}
		},
		xAxis: {
			type: 'category',
			data: ['参加1次活动', '参加2次活动', '参加3次活动', '参加4次活动', '参加5次活动', '参加6次活动', ]
		},
		yAxis: {
			type: 'value',
			axisTick: {		//x轴刻度线
				show:false,
				alignWithLabel: true,
			},
			"axisLine":{     //x轴坐标轴
				"show":false
			},
		},
		color: '#6f96fe',
		series: [{
			data: [150, 60, 224, 218, 135, 147],
			type: 'line',
			itemStyle : { normal: {label : {show: true}}},
	                      	symbolSize: 10,   //设定实心点的大小
			
		}]
	};
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐