jiawulin001 commented on issue #16749: URL: https://github.com/apache/echarts/issues/16749#issuecomment-1079685656
To solve this bug, we might need a little discussion. Let's find the problem step by step. ## Problem location After correctly dealing with color at: https://github.com/apache/echarts/blob/d3dbf1215a0ae0c5075efffb10b17fe4de37582c/src/chart/treemap/treemapVisual.ts#L95-L99 Echarts tries to reset the data (which I don't know why) at: https://github.com/apache/echarts/blob/d3dbf1215a0ae0c5075efffb10b17fe4de37582c/src/core/Scheduler.ts#L625-L639 and from line 632 we enters: https://github.com/apache/echarts/blob/d3dbf1215a0ae0c5075efffb10b17fe4de37582c/src/visual/style.ts#L137-L173 and finally from line 156 we enters: https://github.com/apache/echarts/blob/d3dbf1215a0ae0c5075efffb10b17fe4de37582c/src/model/mixin/makeStyleMapper.ts#L27-L54 The bug comes at line 46. The function `getShallow` finds the value of `model.propName`, which is `model.color = 'cyan'` here., ignoring the property `model.colorAlpha` at all. Then it returns it to `val` and make `style.fill = val = 'cyan'`. Then when style is returned, it overwrites the existsStyle (where `existsStyle={fill: 'rgba(0, 255, 255, 0.3)'}` before overwriting!) as @fuchunhui said at: https://github.com/apache/echarts/blob/d3dbf1215a0ae0c5075efffb10b17fe4de37582c/src/visual/style.ts#L159 ## Plan of fixing Since this problem has involved serveral models, changing which might cause unknown problem, I could offer two plans of fixing. - One is to remove colorAlpha completely because we can directly define the opacity at itemStyle.color. - The second one is to add a judgment inside `getShallow`. If 'color' is asked to be found, then try finding colorAlpha as well and return a correct color. **I can submit a PR for either one and I respect the decision of echarts member.** -- 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]
