apache / apache/echarts

[Feature] Hyperlink/anchor support for pie charts

Open
#19,641 5 comments 0 reactions 0 assignees View on GitHub
en new-feature pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
15h 17m
Merged PRs (30d)
5

Description

### What problem does this feature solve?

Clicking a pie chart section or a legend entry should be able to take the user to a specified URL. I render my SVGs on the server, and browser Javascript is not strictly necessary for this feature, I currently achieve it by wrapping the sections and labels in ``.

This potentially could be extended to some other chart types.

### What does the proposed API look like?

Not having much eCharts experience, I can only propose a suboptimal API. In my case it looks like this:

```json
{
"dataset": { "source": [["Company 1", 60, "/companies/1"], ["Company 2", 40, "/companies/2"]] }
}
```

Of course a different configuration option could be used to specify the mapping of labels to URLs in a more generic way, reusable by other types of charts.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the pie-chart dataset configuration and the server-rendered SVG output described in the issue, comparing the proposed URL column with the existing anchor-wrapping approach. Done means pie sections and legend entries can navigate to specified URLs without requiring browser JavaScript, with an API approach that can support other chart types.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.