apache / apache/echarts

[Feature] Improve emphasis behavior in a stacked bar chart

Open
#18,694 2 comments 0 reactions 0 assignees View on GitHub
en 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?

Mainly, in stacked bars, sometimes is useful to have the emphasis on the whole category, not on the series.
I'll try to explain with some screenshots:

If we see the example on the docs of a stacked bar (this one https://echarts.apache.org/examples/en/editor.html?c=bar-y-category-stack) when we do hover on some value, the emphasis could be 'none', 'self' and 'series'. None is self-explanatory, 'self' raises some weird behavior that, honestly, I don't understand:

![image](https://github.com/apache/echarts/assets/50467435/baa1e989-4c3e-4ced-9154-b6962fc2235b)

And 'series' emphasis on the whole series:

![image](https://github.com/apache/echarts/assets/50467435/507980c0-47b9-4081-a1e5-2554a1f60c25)

But is sometimes useful to have the emphasis just on the category, specially when the label shows info about the category, not about the series, something like this (I made it with paint):

![image](https://github.com/apache/echarts/assets/50467435/55308cd0-1e37-43c7-b5a2-c07b0e1f3990)

### What does the proposed API look like?

Add 'category' on `the series-bar.emphasis.focus` with the expected behavior.

Anyway, if there is a workaround to get this, I want to know! I've tried with events but without result.
Also, I think it would be a good idea to have also the event 'blur' to allow having this behavior programmatically.

Thanks in advance!

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.