apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.59k stars 19.62k forks source link

react中使用echarts4.x visualMap 折线分段显示颜色设置的不起作用 #9755

Closed DKTOM1 closed 5 years ago

DKTOM1 commented 5 years ago

哪位大佬求告知配置哪里出错

const option = { grid: { containLabel: true, left: 10, right: 10, }, xAxis: { type: 'category', axisLabel: { show: false, }, data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'], splitLine: { show: true, lineStyle: { color: 'rgb(237, 232, 249)', }, }, axisLine: { lineStyle: { color: 'rgb(237, 232, 249)', }, }, }, yAxis: { type: 'value', axisLine: { lineStyle: { color: 'rgb(237, 232, 249)', }, }, axisLabel: { color: 'rgba(145,145,145,1)', }, }, series: [{ data: [1820, 932, 1901, 2934, 1290, 1330, 320, 423, 1289, 2345, 2235, 3234, 2725, 234, 123, 1465, 67, 78, 435, 824, 354, 546, 446, 346, 46, 673, 36, 903, 2896, 3534], type: 'line', }], visualMap: [ { pieces: [{ gt: 0, lte: 1000, color: '#673CD1', }], outOfRange: { color: '#7e0023', }, } ], }

anbee commented 5 years ago

请问最后问题解决了吗?我现在也遇到了相似的问题

DKTOM1 commented 5 years ago

image ,要引入visulmap @anbee