apache / apache/echarts

[Feature] barGap can be applied to single series instead of all series

Open
#19,645 0 comments 0 reactions 0 assignees View on GitHub
new-feature topic: bar
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

barGap can be applied to create bullet chart.
![image](https://github.com/apache/echarts/assets/125205627/34796716-e25f-440a-98e6-1165cc6c3f49)

However, multiple series bullet chart cannot be create because barGap only work for all series instead of single series. In [this issue](https://github.com/apache/echarts/issues/6795), [FirstVertex](https://github.com/FirstVertex) wrote a custom function to create multiple series bullet chart.
![image](https://github.com/apache/echarts/assets/125205627/3e329802-902b-471e-a66e-dbf5e3330f7a)
It's not convinient for daily work. So, is it possible to make barGap to be applied to single series?

### What does the proposed API look like?

series: [{
name: '2011年',
type: 'bar',
barWidth: 28,
zlevel: 2,
barGap:'30%',
data: [183, 239, 290, 104, 234, 630]
},
{
name: '2012年',
type: 'bar',
barWidth: 40,
barGap: '-120%',
data: [125, 308, 310, 121, 134, 481]
},
{
name: '2013年',
type: 'bar',
barWidth: 40,
barGap: '40%',
data: [125, 308, 310, 121, 134, 481]
},
{
name: '2014年',
type: 'bar',
barWidth: 40,
barGap: '-120%',
data: [125, 308, 310, 121, 134, 481]
}
]

Contributor guide

Open the contributing guide

Research direction

Start by tracing how barGap is interpreted for bar series and whether its current scope is global across the series collection. Use the proposed per-series barGap examples as the acceptance case; done means different bar series can specify independent gaps while existing bar layout behavior remains unchanged.

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.