Pashted opened a new pull request, #19435:
URL: https://github.com/apache/echarts/pull/19435

   <!-- Please fill in the following information to help us review your PR more 
efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ ] bug fixing
   - [x] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   `itemRadiusScale` function added for pie series to control the radius of 
each item
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   #19020
   #15674
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   There was no easy option for pie charts to control the radius of items. In 
current version I can control either the whole pie radius or use some 
autocalculations with `roseType` option. But this is not suitable for our 
tasks. Earlier we used dashbords in PowerBI and the same feature in PBI looked 
like:
   
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
![image](https://github.com/apache/echarts/assets/16826622/0913325e-6a88-4aa3-be48-062b5c4464a9)
   
![image](https://github.com/apache/echarts/assets/16826622/e29cd6b2-9a89-4110-b32f-b61611ba10fc)
   
   
   ### After: How does it behave after the fixing?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. 
-->
   The solution is very similar with [scatter 
charts](https://echarts.apache.org/examples/en/editor.html?c=bubble-gradient) 
and its `symbolSize` option. Now (with this PR) i can pass custom function 
`itemRadiusScale`, which returns value from 0 to 1. That value is used within 
pie component to calculate outer radius for each item. In simple words, we now 
have a third dimension for each item, which means the size from center to the 
outer circle, almost like in scatter.
   
   Also, few calculated values (sum, maxValue) passed into `getDataParams` 
callback to make tooltip calculations easier.
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
![image](https://github.com/apache/echarts/assets/16826622/8ad263ba-7e5b-45cd-b74d-896d70d65409)
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [ ] This PR doesn't relate to document changes
   - [x] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   
   
   ## Misc
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   `test/pie-itemRadiusScale.html`
   
   here some content from the test file
   
   
https://github.com/apache/echarts/assets/16826622/2464bf2c-48d4-4f20-b84b-c3a7c18e73d9
   
   
   ## Others
   
   ### Merging options
   
   - [x] Please squash the commits into a single one when merging.
   
   ### Other information
   
   This is my first PR here. Sorry, if i violated the rules (=
   


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