c3js / c3js/c3

subplot causes x-axis tick labels to be out of bounds

Open
#1,378 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

After adding a subplot, then changing the extent, it is possible to make the labels of the x-axis ticks go off to the side on the left or right. You can see this while using the default subplot at http://c3js.org/samples/options_subchart.html.

![screen shot 2015-09-09 at 2 20 31 pm](https://cloud.githubusercontent.com/assets/515580/9774758/6c6a5bb8-56ff-11e5-8001-b1a33c9dd619.png)

You can make it more dramatic by adding some padding to the left of the chart. e.g.

```
var chart = c3.generate({
data: {
columns: [
['sample', 30, 200, 100, 400, 150, 250]
]
},
padding: {
right: 200
},
subchart: {
show: true
}
});
```

Shown in this screenshot where you can see the label '2' way off to the right of the plot, into the padding of the total chart area.

![screen shot 2015-09-09 at 2 24 26 pm](https://cloud.githubusercontent.com/assets/515580/9775071/496d4baa-5701-11e5-87f2-2e5f3b7c16d4.png)

Is there any way to fix this so that the labels never go past the actual data?

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.