Ovilia commented on issue #10636: 自定义 sector emphasis无效
URL: 
https://github.com/apache/incubator-echarts/issues/10636#issuecomment-500289151
 
 
   发现其实是文档写得不是很好,正确的写法是,如果在 `data.emphasis.itemStyle` 中定义了样式,需要在 `renderItem` 
中定义 `styleEmphasis: api.styleEmphasis()`,如:
   ```js
   function renderItem(params, api) {
       // ...
   
       return rectShape && {
           type: 'rect',
           shape: rectShape,
           style: api.style(),
           styleEmphasis: api.styleEmphasis()
       };
   }
   ```
   
   此外,还可以直接在 `renderItem` 中定义高亮样式,如:
   ```js
   function renderItem(params, api) {
       // ...
   
       return rectShape && {
           type: 'rect',
           shape: rectShape,
           style: api.style(),
           styleEmphasis: {
               color: 'red'
           }
       };
   }
   ```
   之后我会改进一下文档。

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


With regards,
Apache Git Services

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

Reply via email to