C3: Start y-axis always with zero

Created on 24 Feb 2014  路  2Comments  路  Source: c3js/c3

Hi Masayuki,

Is there an option to force to start the Y-axis always with 0?
I know you could add an optional grid-line on the Y-axis in 0, but I want to force the chart's y-axis always to start in 0.

Thanks in advance!

Regards,

Paul

Most helpful comment

Hi Paul,

You can do it by setting axis.y.min = 0.
Sample is here - http://c3js.org/samples/axes_y_range.html

And if padding not needed between 0 and x axis, you can use axis.y.padding with option above, like axis.y.padding = {bottom: 0}.
Sample is here - http://c3js.org/samples/axes_y_padding.html

Please try these options with the latest version (I fixed bug for padding..).

Thank you.

All 2 comments

Hi Paul,

You can do it by setting axis.y.min = 0.
Sample is here - http://c3js.org/samples/axes_y_range.html

And if padding not needed between 0 and x axis, you can use axis.y.padding with option above, like axis.y.padding = {bottom: 0}.
Sample is here - http://c3js.org/samples/axes_y_padding.html

Please try these options with the latest version (I fixed bug for padding..).

Thank you.

Hi Masayuki,

Thanks! This works exactly like I wanted.

Regards,

Paul

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aishwaryak picture aishwaryak  路  4Comments

zachallia picture zachallia  路  3Comments

jstone-ponderosa picture jstone-ponderosa  路  3Comments

mwho picture mwho  路  3Comments

Shugardude picture Shugardude  路  4Comments