You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "kirgrim (via GitHub)" <gi...@apache.org> on 2025/09/18 21:06:51 UTC

[PR] feat: Introducing "mixed" valued Pie Chart [echarts]

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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [PR] feat: Introducing "mixed" valued Pie Chart [echarts]

Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #21275:
URL: https://github.com/apache/echarts/pull/21275#issuecomment-3309727542

   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
   
   Document changes are required in this PR. Please also make a PR to [apache/echarts-doc](https://github.com/apache/echarts-doc) for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the `PR: awaiting doc` label.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [PR] feat: Introducing "mixed" valued Pie Chart [echarts]

Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #21275:
URL: https://github.com/apache/echarts/pull/21275#issuecomment-3326282646

   Thanks for your contribution! Do we have any theoretical basis for this new design? Because multi-dimension mapping can sometimes be confusing so we need to make sure viewers don't get confused by this design.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


Re: [PR] feat: Introducing "mixed" valued Pie Chart [echarts]

Posted by "ChristopheDeLoor (via GitHub)" <gi...@apache.org>.
ChristopheDeLoor commented on PR #21275:
URL: https://github.com/apache/echarts/pull/21275#issuecomment-3388664622

   > Thanks for your contribution! Do we have any theoretical basis for this new design? Because multi-dimension mapping can sometimes be confusing so we need to make sure viewers don't get confused by this design.
   
   Hi Olivia! @kirgrim opened this PR on the request of the company I represent. The multi-dimensional pie chart is a chart that has been requested by multiple of our customers.
   
   While it's true that multi-variable mappings can introduce cognitive load, this approach is already in use in several professional visualization tools. For example, [AG Charts](https://www.ag-grid.com/charts/javascript/pie-series/#variable-sector-radius) includes a similar concept called "Variable Sector Radius".
   
   To minimize potential confusion, this functionality is opt-in, meaning developers can use it when it aligns with their data storytelling goals. Additionally, clear labeling, legends, or tooltips can help make the meaning of both dimensions explicit to viewers.
   
   In terms of value to end users, visualizing both dimensions and radiuses in a pie chart transforms it from a simple categorical breakdown into a powerful multi-dimensional insight chart. By allowing users to see an additional variable in the slice radius (e.g., total study count, market size, or population), they can instantly perceive not just proportions but also magnitude and scale across categories, something standard pie charts can't convey. This added depth supports users to spot outliers or underrepresented segments at a glance.


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org