mqliutie commented on issue #4696: 图例不显示,设置了series中data里的name URL: https://github.com/apache/incubator-echarts/issues/4696#issuecomment-390130357 legend data和series.name 保持一致 legend 不显示 ``` { "grid": { "top": "80", "left": "35", "right": "38", "containLabel": true }, "legend": { "data": [ 2017, 2016 ], "textStyle": { "color": "red" }, "selectedMode": "single" }, "tooltip": { "trigger": "axis" }, "xAxis": { "name": "分数", "type": "value", "splitLine": { "show": false }, "boundaryGap": false }, "yAxis": { "name": "人数", "type": "value", "splitLine": { "show": false }, "boundaryGap": [ 0, "20%" ] }, "dataZoom": [ { "type": "inside", "disabled": true, "start": 10, "end": 100 }, { "start": 200, "end": 100, "handleIcon": "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z", "handleSize": "80%", "handleStyle": { "color": "#fff", "shadowBlur": 3, "shadowColor": "rgba(0, 0, 0, 0.6)", "shadowOffsetX": 2, "shadowOffsetY": 2 } } ], "series": [ { "name": 2017, "type": "line", "smooth": true, "maxScore": 669, "minScore": 201, "symbol": "none", "sampling": "average", "itemStyle": { "normal": { "color": "#0071bd" } }, "areaStyle": { "normal": { "color": { "x": 0, "y": 0, "x2": 0, "y2": 1, "type": "linear", "global": false, "colorStops": [ { "offset": 0, "color": "#489ae4" }, { "offset": 1, "color": "#489ae4" } ] } } }, "markLine": { "silent": false, "symbol": "arrow", "symbolSize": 5, "precision": 30, "label": { "normal": { "position": "end", "formatter": "{b}" } }, "data": [ { "name": "本科一批 : 566", "xAxis": "566", "lineStyle": { "normal": { "color": "#37c1ff" } } } ] }, "data": [ [ 669, 105 ], [ 668, 15 ] ] }, { "name": 2016, "type": "line", "smooth": true, "maxScore": 698, "minScore": 201, "symbol": "none", "sampling": "average", "itemStyle": { "normal": { "color": "#0071bd" } }, "areaStyle": { "normal": { "color": { "x": 0, "y": 0, "x2": 0, "y2": 1, "type": "linear", "global": false, "colorStops": [ { "offset": 0, "color": "#489ae4" }, { "offset": 1, "color": "#489ae4" } ] } } }, "markLine": { "silent": false, "symbol": "arrow", "symbolSize": 5, "precision": 30, "label": { "normal": { "position": "end", "formatter": "{b}" } }, "data": [ { "name": "本科一批 :584", "xAxis": "584", "lineStyle": { "normal": { "color": "#37c1ff" } } } ] }, "data": [ [ 698, 11 ], [ 697, 1 ] ] } ] } ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@echarts.apache.org For additional commands, e-mail: dev-h...@echarts.apache.org