c3js / c3js/c3

chart.load stopping axis label change?

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

Description

Whack the following code in one of the c3 examples (e.g. http://c3js.org/samples/api_axis_label.html ). The y-axis label updates fine if it is done immediately before a chart.load or if done by itself, but will only show if done immediately after a chart.load if the chart is prodded with a later .flush command. Is it something to do with the transition initiated by the data.load?

```
var chart = c3.generate({
data: {
columns: [
['download', 30, 200, 100, 400],
],
type: 'bar'
},
axis: {
y: {label: {
text: 'Y-Axis #1',
}}
}
});

setTimeout(function () {
chart.axis.labels({y: 'New Y Axis Label Before Load'});
chart.load({
columns: [
['download', 130, 210, 120, 360],
],
});

}, 1000);

setTimeout(function () {
chart.load({
columns: [
['download', 130, 220, 150, 350],
],
});
chart.axis.labels({y: 'New Y Axis Label After Load'});
}, 3000);

setTimeout(function () {
chart.flush();
}, 5000);

setTimeout(function () {
chart.axis.labels({y: 'New Y Axis Label Only'});
}, 7000);
```

PS. Is there any way to fork those c3 examples? Much easier to show some c3 issues with them than with a jsfiddle.

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.