c3js / c3js/c3

Incorrect bottom padding when removing labels

Open
#1,093 2 comments 0 reactions 0 assignees View on GitHub
C-bug easy pull request
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

Hello,

When hiding labels I noticed that Pie charts have a weird bottom padding that was preventing them from taking up the pixel perfect space I reserved for them.

After looking into the code I discovered this line in `core.js`:

``` javascript
c3_chart_internal_fn.updateSizes = function () {
...
$$.arcHeight = $$.height - ($$.isLegendRight ? 0 : 10);
...
}
```

When hiding labels this line still produces a 10px vertical padding... So I hacked a quick and dirty:

``` javascript
$$.arcHeight = $$.height - ($$.config.legend_hide == true || $$.config.legend_show == false || $$.isLegendRight ? 0 : 10);
```

And it worked wonders. It's not a fancy fix by any means. Is there some setting I'm forgetting, or should we look for a proper fix for this issue?

Thanks!

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.