Clarkkkk edited a comment on issue #164:
URL: https://github.com/apache/echarts-doc/issues/164#issuecomment-773274259


   > > In this example, `fill` is fixed in `renderItem`. You can try another 
simpler example 
https://echarts.apache.org/examples/zh/editor.html?c=custom-cartesian-polygon
   > > `api.visual('color')` will pick color from `itemStyle` or color palette. 
We should mention it in the doc
   > 
   > So here is two conclusions:
   > 
   > 1. The color in `itemStyle` is covered by `fill` in `renderItem`, whether 
`fill` is specified or not.
   > 2. I need to use `api.visual()` in `renderItem` to reference the 
`itemStyle` config.
   > 
   > Am I right?
   > 
   > How about the other properties in `itemStyle`, like `shadowBlur` etc? I 
just looked up the [source 
code](https://github.com/apache/echarts/blob/master/src/chart/custom/install.ts)
 roughly. It seems that only `'color'` and `'borderColor'` is supported in 
`api.visual()`. Or is it better to use `style` in `renderItem` instead of 
`itemStyle`?
   
   Oh I discover that I can specify `style: api.style()` in `renderItem` to get 
other properties defined in `itemStyle`. Why is this deprecated, this is 
exactly what I need🤣. 
   
   As for the label, it is because I didn't get the styles correctly that I 
would consider that the `label` relavant properties are not available--The 
label is invisible without styles. Another fact that misleads me is that there 
is no `label` property in custom series doc. Now I discover that specifying 
`style: api.style()` also acts on labels, making styles defined in 
`series.label` take effect, which is also not documented.
   
   My misunderstanding of `selectMode` is similar--selected styles are not 
working. And I didn't find apis that reflect the `itemStyle` defined in 
`select` and `blur`. I may set those styles in `renderItem`.
   
   It turns out that if I continue to use `itemStyle`, it would be inconsistent 
since `itemStyle` and styles defined in `renderItem.return.select`, 
`renderItem.return.blur` etc are in different syntax. I think that's why 
`api.style()` and `api.styleEmphasis()` are deprecated--developers are 
encouraged to set styles right in `renderItem`. For consistency, `itemStyle` 
should be discouraged maybe?
   
   Anyway, my questions are solved generally. There is much work to do with the 
document though. If you don't have further comments, you can close this issue. 
Thanks for your patience!😀


----------------------------------------------------------------
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.

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

Reply via email to