onlyInteger option is present globally and also is part of the axis configuration.
Ideally global configuration should overwrite axis configuration, if axis configuration is not defined explicitly but its not the case right now.
I wonder why this issue https://github.com/gionkunz/chartist-js/issues/358 is closed, if anyone go through docs https://gionkunz.github.io/chartist-js/api-documentation.html then first paragraph didn't mentioned to use onlyInteger with axis configuration.
Hi there. Can you point out where its part of the global configuration?
Global configuration:
https://github.com/gionkunz/chartist-js/blob/develop/src/scripts/charts/bar.js#L69
X-axis configuration:
https://github.com/gionkunz/chartist-js/blob/develop/src/scripts/charts/bar.js#L36
Y-axis configuration:
https://github.com/gionkunz/chartist-js/blob/develop/src/scripts/charts/bar.js#L58
@anilmaurya thanks for pointing out! Since we introduced dynamic axes, the onlyInteger configuration should not be part of the global configuration anymore! The property was removed in the default settings of the Line chart but it looks like we forgot about the bar chart default settings. I'll remove that in the next release.
@gionkunz Thanks, we will also need to update docs https://gionkunz.github.io/chartist-js/api-documentation.html in next release.
@anilmaurya thanks. The docs are automatically generated from the source so that's why it's wrong there too. Cheers
cheers :beers:
So how do we enable onlyInteger? It doesn't seem to be working at all for me.
@JasonLeeH Its working for Axis configuration.
axisX: {
onlyInteger: true
}
axisY: {
onlyInteger: true
}
Most helpful comment
@JasonLeeH Its working for Axis configuration.