Justin-ZS commented on issue #20608: URL: https://github.com/apache/echarts/issues/20608#issuecomment-3195769211
> I get it, but i think i can't aplly the full gradient to the bars, maybe this can be another issue, because the ECharts does not support full gradient on series for discrete charts. Here is an example with continuous gradient using the standard ECharts configuration: > > <img alt="Image" width="1033" height="788" src="https://private-user-images.githubusercontent.com/140714367/478512929-72622ca0-4dc1-497e-b134-24b8129d0184.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTU1MDY2NDksIm5iZiI6MTc1NTUwNjM0OSwicGF0aCI6Ii8xNDA3MTQzNjcvNDc4NTEyOTI5LTcyNjIyY2EwLTRkYzEtNDk3ZS1iMTM0LTI0YjgxMjlkMDE4NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwODE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDgxOFQwODM5MDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lZTNkZWIzZjZiM2RiMzU0NWMzNmU4NjE0NTg3NTc2Y2I5YzY3NWMwN2QzOTllNTA3MDQ2YWY1ODllZWRjZDQ0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.HsLUYWVfzQ5DT8RVxmTNF-o76TzggQAhfrqzLAM_2aw"> > https://echarts.apache.org/examples/en/editor.html?c=bar-simple > > ``` > xAxis: { > type: 'category', > data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] > }, > yAxis: { > type: 'value' > }, > visualMap: {inRange: {color: ['red', 'green']}} > , > series: [ > { > data: [120, 200, 150, 80, 70, 110, 130], > type: 'bar' > } > ] > }; > ``` The current behavior is correct: each bar receives a discrete color interpolated between red and green based on its value through the `visualMap`. What I expected is individual bars with gradient fills, similar to [demo](https://echarts.apache.org/examples/zh/editor.html?c=bar-simple&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGLQC6JAL5905HPiKpSZSjVi0AbowA2AVyq0FS2HiocIVQrFH9imwcLEBGAEwAGGZc0KajoAI0YOXmd0CBYAWwBlCkMdDVd0emBDTnUo1wysjkTQByc0tNSy12AAM2rrMCIfAMrSfOzdDlYwgAoPHy8eWA8AFgA2Qa8PAFZBnwA6AGYASnMW0kVc8s2ymrqqBqHmtbaOOk6evoGhsYnpwY8V7c15J9h_V4xGo9dyL4-vP5rcgAw6vII6WiGCDQKjhSJrVhZMKGIjVIzWbYvNJY9YkOTyADcQA) Simply setting gradient colors in `inRange.color` may not be the most general solution. Perhaps we need a new property to transform discrete colors into gradient fills: ``` inRange: { color: ['red', 'green'], colorTransform: // a function to generate the final gradient color } ``` @Ovilia @100pah do you have any thoughts on this approach? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org