apache / apache/echarts

[Feature] Shadow series key

Open
#21,017 1 comment 0 reactions 0 assignees View on GitHub
new-feature
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

To customize a chart, it's convenient to shadow/clone an existing series (e.g. `bar`) with a `custom` one, so you can draw on additional shapes (e.g. with `silent: true`) without having to reinvent the wheel.

But, this new series is disconnected from the original, so it won't toggle on/off when the original series is toggled. Trying to use the same series ID doesn't work.

It would be convenient to be able to define a shadow key/id for use with silent series, so that it would be considered a duplicate of the original.

Or if there is an existing way to do so, to show this more clearly in the examples and docs. e.g. It's unclear to me how to replicate `bar` series as a `custom` one. I don't know how to respond to the dynamic state of the legend on/off toggle in `renderItem` and `api.barLayout`. It seems to be static and requires passing in e.g. the `count` and `barGap`, rather than re-using the same state from `bar`.

### What does the proposed API look like?

A `series.shadowId` property that can have the `id` of another series.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.