2

To demonstrate, please to this example page and paste the following chart configuration:

option = {
  title: {
    text: 'Referer of a Website',
    subtext: 'Fake Data',
    left: 'center'
  },
  tooltip: {
    trigger: 'item'
  },
  legend: {
    orient: 'vertical',
    left: 'left'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: '50%',
      data: [
        { value: 1048, name: 'Search Engine' },
        { value: 735, name: 'Direct' },
        { value: 580, name: 'Email' },
        { value: 484, name: 'Union Ads' },
        { value: 300, name: 'Video Ads' },
        { value: 10, name: 'Tiny Value 1' },
        { value: 20, name: 'Tiny Value 2' },
        { value: 30, name: 'Tiny Value 3' }
      ],
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)'
        }
      }
    }
  ]
};

The three values I added to the example, all starting with Tiny Value, have very small wedges on the pie chart. I'm wondering if there's a configuration option to combinate values that don't meet a certain minimum size (percentage based, angle, etc.) into a single item and provide a custom label, such as Other. I haven't had any luck searching through the documentation, but it's possible I'm not using the correct terms.

I could potentially add logic to modify the data source and handle this type of scenario myself, but I want to ensure there's nothing natively available to handle this.

JKasper11
  • 772
  • 1
  • 7
  • 21
  • I would suggest filtering out data before `setOption()` that's less than your desired value, and push a new `set {}` to `series: []`. It would then give you possibility to control how that data is represented (bar, line, style etc). – Joosep Parts Mar 06 '22 at 05:34
  • Hi @jkasper11, I am having the same issue. Have u solved it yet? – Sovai May 30 '22 at 10:09
  • 1
    @Sovai Sadly no, there is no native way to do this and the developer who manages Echarts rejected a request to support this functionality. I'm afraid the only solution is to manipulate the data to consoldate options yourself. https://github.com/apache/echarts/issues/16626 – JKasper11 Jun 06 '22 at 15:22

0 Answers0