如图:
代码复用参考:
let symbolArray = ['triangle', 'rect', 'circle', 'arrow', 'diamond', 'emptyRect', 'emptyTriangle']; let symbolColors = ['pink', 'blue', '#3CC3B6', '#3266E8', '#F07C4F', '#EDA949', '#F07C4F']; let xAxisDatum = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; let seriesDatum = [120, 200, 150, 80, 70, 120, 130]; let markPointDatum = []; for (var i = 0; i < seriesDatum.length; i++) { let _obj = { symbol: symbolArray[i], symbolSize: [10,10], symbolRotate: 0, symbolOffset: ['25%', -10], coord: [i, seriesDatum[i]+10], value: seriesDatum[i] - 20, label:{ show:true, color: '#000', fontSize: 12, position: 'right' }, itemStyle: { borderWidth: 3, borderColor: symbolColors[i], color: symbolColors[i], } } markPointDatum.push(_obj); } option = { grid:{ x: 0, y: 50, x2: 0, y2: 20, borderWidth:1 }, xAxis: { type: 'category', data: xAxisDatum }, yAxis: { type: 'value', scale: true, }, series: [{ data: seriesDatum, type: 'bar', markPoint:{ data: markPointDatum } }] };
参考:https://blog.51cto.com/u_15072811/4179823
标签:10,markPointDatum,symbolColors,柱状图,let,seriesDatum,type,echarts,标注 From: https://www.cnblogs.com/zqlym/p/17653569.html