Skip to content
Bug reportNov 17, 2026· 0:44· 15 views

ECharts 5: pie series with duplicate names silently drops legend entries

0:44 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

mediumPie series data-name to legend and palette mapping (legend item dedup by name). Consider a dev-mode warning for duplicate names in series data.
url: https://echarts.apache.org/examples/en/editor.html?c=pie-simplesite: Apache ECharts Examples editorchart_type: piepage_title: Examples - Apache ECharts

Repro steps

  1. 1.Open the ECharts Examples editor with the pie-simple example.
  2. 2.Set series data to three items: { value: 120, name: 'Team Alpha' }, { value: 200, name: 'Team Beta' }, { value: 90, name: 'Team Alpha' }, with label formatter '{b}: {c}'.
  3. 3.Observe the legend and slice colors in the rendered chart.
  4. 4.Hover the blue slices to compare the two 'Team Alpha' items.
  5. 5.Control: rename the third item to 'Team Gamma' and re-render.

Expected

Each data item should get its own legend entry and a distinct color. If duplicate names are not supported, ECharts should warn about it.

Actual

With two items named 'Team Alpha', the legend shows only 'Team Alpha' and 'Team Beta'. Both 'Team Alpha' slices (120 and 90) are drawn in the same blue. No warning is visible. The two slices can only be told apart by their labels or a slight shade change on hover.

Evidence

visualThe code has three data items, two named 'Team Alpha'. The legend shows only two entries: 'Team Alpha' and 'Team Beta'.
visualSlices labeled 'Team Alpha: 90' and 'Team Alpha: 120' are both drawn in the same blue color.
visualThe status reads 'Chart has been generated in 8.20ms' at 10:14:40. No error or warning is shown.
visualHovering emphasizes only the 120 slice. The adjacent 90 slice keeps the same base blue, with only a slight shade difference.
visualControl case works: after renaming the third item to 'Team Gamma', the legend shows three entries. The 90 slice is dark gray and labeled 'Team Gamma: 90'. The status reads 'Chart has been generated in 10.60ms' at 10:15:07.
visualIn the control case, hovering the 'Team Alpha' 120 slice emphasizes it, and it stays visually distinct from the 'Team Gamma' slice.
Issue markdown (copy-paste ready)
## Summary
In a pie series, two data items with the same `name` collapse into a single legend entry. They also share one color. No warning is shown.

## Environment
- Apache ECharts Examples editor: https://echarts.apache.org/examples/en/editor.html?c=pie-simple
- Chart type: pie

## Steps to reproduce
1. Open the pie-simple example in the editor (0s).
2. Use this data (1s):
```js
data: [
  { value: 120, name: 'Team Alpha' },
  { value: 200, name: 'Team Beta' },
  { value: 90, name: 'Team Alpha' }
],
label: { show: true, formatter: '{b}: {c}' }
```
3. Look at the legend and slice colors (1s).
4. Hover the blue slices (11s).

## Expected
Each data item gets its own legend entry and color, or ECharts warns about the duplicate names.

## Actual
- The legend shows only 'Team Alpha' and 'Team Beta' (1s).
- The 'Team Alpha: 120' and 'Team Alpha: 90' slices are both the same blue (1s).
- No error or warning appears. The status shows 'Chart has been generated in 8.20ms' (1s).
- On hover, the two slices differ only by a slight shade (11s).

## Control (works)
Renaming the third item to 'Team Gamma' gives three legend entries. The third slice turns dark gray and is labeled 'Team Gamma: 90' (25s). Hover still emphasizes only the 'Team Alpha' slice (37s).

## Suggested area
Legend item dedup by name and palette assignment for pie data. A dev-mode warning for duplicate names would help.

*Recorded with SceneRecap.*

Your recordings could explain themselves too.

Free plan · silent recordings welcome · bug reports included.

Try SceneRecap free →
ECharts 5: pie series with duplicate names silently drops legend entries · SceneRecap