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

   <!-- 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?
   
   Adding "mixed" type of the pie chart that will allow generate roses of 
variable radius + variable arc lengths
   
   
   
   ### Fixed issues
   
   N/A
   
   ## Details
   
   ### Before: What was the problem?
   
   Previously you could either specify "area" or "radius" for the `roseType` 
which reduced the number of possible dimensions of quantitative data to apply
   
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How does it behave after the fixing?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. 
-->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   Now you could specify "mixed" `roseType` for the pie chart and supply two 
elements to the array of values:
   
   - first element is responsible for the radius
   - second element is responsible for the arc length
   
   Example of the newly supported `roseType`:
   
   ```js
           const option = {
               title: {
                   text: 'Rose Type Test',
                   left: 'center'
               },
               tooltip: {
                   trigger: 'item',
                   formatter: function(params) {
                       if (Array.isArray(params.value) && params.value.length 
>= 2) {
                           return params.seriesName + '<br/>' +
                                  params.name + ': Radius=' + params.value[0] + 
', Angle=' + params.value[1] + ' (' + params.percent + '%)';
                       } else {
                           return params.seriesName + '<br/>' +
                                  params.name + ': ' + params.value + ' (' + 
params.percent + '%)';
                       }
                   }
               },
               series: [
                   {
                       name: 'Rose Type',
                       type: 'pie',
                       radius: ['30%', '70%'],
                       center: ['50%', '50%'],
                       roseType: 'mixed',
                       data: [
                           { value: [10, 15], name: 'A' },
                           { value: [20, 25], name: 'B' },
                           { value: [30, 35], name: 'C' },
                           { value: [40, 45], name: 'D' },
                           { value: [50, 55], name: 'E' }
                       ],
                       label: {
                           show: true,
                           formatter: function(params) {
                               if (Array.isArray(params.value) && 
params.value.length >= 2) {
                                   return params.name + ': R=' + 
params.value[0] + ', A=' + params.value[1];
                               } else {
                                   return params.name + ': ' + params.value;
                               }
                           }
                       }
                   }
               ]
           };
   ```
   
   the full interactive example is added to:
   
   `test/pie-mixed-rose-type.html`
   
   ## 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
   
   N.A.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### Other information
   


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