Search code examples
axisc3.js

c3js: How to make not equally spaced Y axis tick?


I'm trying to make not equally spaced Y axis tick in c3js.

enter image description here

For example, this graph has equally spaced tick. (0,20,40...)

I want to set a graph not equally spaced axis tick like 0,30,45,55...

How can I get this?


Solution

  • You can refer https://c3js.org/reference.html#axis-y-tick-values for your use case. It allows you to provide the tick values, but you should take care of the values going out of bound than the max bar value and the spacing between them.