We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用myChart.setOption(options, {notMerge:true}) 改变visualMap->inRange->color时不起作用
let options = this.myChart.getOption() let keyName = 'keyName' /////////////////////////可以正常更改Y轴颜色、标签 let newYAxis = options.yAxis.map((item, index) =>{ if(item.name === keyName){ return item }else{ if(index > posInArr){ item.nameTextStyle.color = [options.color[index - 1]] item.axisLabel.color = [options.color[index - 1]] item.axisLine.lineStyle.color = [options.color[index - 1]] item.offset = (index - 1)*(-15) item.position = (index -1) % 2 > 0 ? 'right' : 'left' } return item } }) newYAxis.forEach((item, index) =>{ if(item.name === keyName){ newYAxis.splice(index,1) } }) /////////////////////////不能正常更改线条及visualMap颜色 let newVisualMap = options.visualMap.map((item, index) =>{ if(item.name === keyName){ return item }else{ if(index > posInArr){ item.seriesIndex = item.seriesIndex -1 item.inRange.color = [options.color[index - 1]] } return item } }) newVisualMap.forEach((item, index) =>{ if(item.id === keyName){ newVisualMap.splice(index,1) } }) options.visualMap = newVisualMap myChart.setOption(options, {notMerge:true})
https://img-blog.csdn.net/20180810174024843?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2pveW1vZA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
The text was updated successfully, but these errors were encountered:
//之前的定义 visualMap.push({ id: keyName, show: false, realtime:false, seriesIndex:this.number, min: parseFloat(min), max: parseFloat(max), left: 'right', bottom: '45%', calculable: true, precision:1, inRange: { color: [options.color[this.number]] }, }) //修改后定义 visualMap.push({ id: keyName, show: false, realtime:false, seriesIndex:this.number, min: parseFloat(min), max: parseFloat(max), left: 'right', bottom: '45%', calculable: true, precision:1, controller:{ inRange: { color: [options.color[this.number]] } }, target:{ inRange: { color: [options.color[this.number]] } }, }) //修改时 let newVisualMap = options.visualMap.map((item, index) =>{ if(item.name === keyName){ return item }else{ if(index > posInArr){ item.seriesIndex = item.seriesIndex -1 item.controller.inRange.color = [options.color[index - 1]] item.target.inRange.color = [options.color[index - 1]] } return item } })
Sorry, something went wrong.
No branches or pull requests
One-line summary [问题简述]
使用myChart.setOption(options, {notMerge:true})
改变visualMap->inRange->color时不起作用
Version & Environment [版本及环境]
Expected behaviour [期望结果]
ECharts option [ECharts配置项]
Other comments [其他信息]
截图
https://img-blog.csdn.net/20180810174024843?watermark/2/text/aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2pveW1vZA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70
The text was updated successfully, but these errors were encountered: