Pritom2357 commented on issue #20692:
URL: https://github.com/apache/echarts/issues/20692#issuecomment-2596806137

   ## Summary
   Hi, I’m Pritom Biswas. I’ve been exploring the code base and came across 
your issue regarding transparent areas in ECharts maps. After some 
investigation, I believe I have found a fix.
   
   ## Root Cause
   You used `null` for both `areaColor` and `color`, but ECharts expects color 
values. Setting these properties to `null` causes ECharts to revert to default 
colors, rather than applying true transparency.
   
   ## Proposed Fix
   Replace `null` with `'transparent'`. This ensures that the map polygons 
remain see-through, while still allowing borders to be visible.
   
   Additionally, if you need more granular control (for example, customizing 
opacity or highlighting behavior), you can:
   - Define colors using `rgba(...)` values.
   - Use `itemStyle` for each region in your data array to apply selective 
coloring or transparency.
   
   ## Example
   I’ve created a [[CodePen 
demo](https://codepen.io/qojayhrk-the-typescripter/pen/mybKazB)](https://codepen.io/qojayhrk-the-typescripter/pen/mybKazB)
 demonstrating how to use `transparent` and/or `rgba(...)` to control the fill 
and borders. You’ll find explanatory comments in the code:
   
   ```js
   // Example of how to define itemStyle per region
   {
     name: 'Region Name',
     itemStyle: {
       color: 'transparent',       // or 'rgba(0, 0, 0, 0)' for full 
transparency
       borderColor: '#333',        // border still visible
       borderWidth: 1
     }
   }
   ```
   
   ## Conclusion
   Using `'transparent'` instead of `null` (and optionally `rgba(...)` for more 
nuanced color control) fixes the issue of keeping polygon borders visible while 
making the areas fully transparent. If you have any questions or run into any 
other issues, feel free to let me know!
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to