Hoang Duy
Hoang Duy

Reputation: 63

Move axis x from bottom to top in c3 js

I am working on a project and use c3 js library (don't use d3 js) And now I'm having a problem, that is when using c3 js, the x-axis of the graph will default to the bottom, but the design they want it to be above, so how do I handle it? Any help on how to achieve this would be greatly appreciated. Thanks every body

Upvotes: 0

Views: 272

Answers (1)

Sydney Y
Sydney Y

Reputation: 3152

Can you set the axis min and Max to limit the displayed area? https://c3js.org/reference.html#api-axis-min

chart.axis.min({
  x: -10,
  y: 1000,
  y2: 100
});
chart.axis.max({
  x: 100,
  y: 1000,
  y2: 10000
});

Upvotes: 1

Related Questions