apache / apache/echarts

[Feature] Apply styling on a stack level for bar charts

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

Description

### What problem does this feature solve?

Currently, styling is applied to each individual series/data point, but there's no way to apply it to the whole stacked group. Therefore, some styling may look strange since the bar isn't considered as a whole when applying the styling.

2 concrete examples where this issue matters are borders (which cut into the bar) and rounded corners (which get repeated in the middle of the graph).

This is how a dashed border looks on a stacked bar currently:

Image

And this is how it should look:

Image

This is how rounded top corners look on a stacked bar currently:

Image

And this is how they should look:

Image

### What does the proposed API look like?

The simplest I can think of is to introduce a new optional field in `BarItemStyleOption`, which could change where the styling is applied, for example `target?: 'stack' | 'series'`.

Contributor guide

Open the contributing guide

Research direction

Start by locating BarItemStyleOption and the stacked bar rendering entry points, then trace how borders and rounded corners are currently applied to individual series or data points. Done should provide an agreed API for stack-level targeting and make dashed borders and rounded top corners render once around the stacked group.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.