integer only of the x,y axis
See original GitHub issuehow to make the axis tick to be integer only?
what I have tried is to use the tick option:
tick: {
format: function(x) {
return (x == Math.floor(x)) ? x : "";
}
}
this can make the label only show integer, but the divid line on the axis still exits.
is there a way to control the axis tick?
Issue Analytics
- State:
- Created 9 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to force the Y axis to use only integers in Matplotlib?
Set the X-axis label using plt.xlabel() method. Set the Y-axis label using plt.ylabel() method. Set a title for the axes.
Read more >How to force the Y axis to only use integers - Stack Overflow
I'm plotting a histogram using the matplotlib.pyplot module and I am wondering how I can force the y-axis labels to only show integers...
Read more >Integer Values on Line Chart Category Axis - Peltier Tech
Although the category axis is defined by the line chart series, the XY series is not constrained by the whole-number-only restriction.
Read more >MS Excel - How can I control whole number axis values to ...
I am trying to create a risk (5 by 5) matrix that only should show integer values for x and ...
Read more >How to show only integers (no decimals) in chart API x/y-axis ...
Hi, When I create a chart, decimal values are not, but on the y axis shows decimal values, how can I do to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Better version:
FWIW, requiring knowing the internals of D3 and running JS seems really odd. I see that pattern a lot in these C3 issues: someone has a problem, and instead of offering a C3 option, 5-30 lines of javascript that manipulating the underlying SVG is with d3 is the accepted solution. I think in the long run that’s going to be a huge detriment to the adoption of C3.
For this issue in particular, a “axis.y.tick.integer_only” option would be of incredible value. I’d love to provide an extension to C3 for this. I see an example extension here. Is there an extension guide somewhere that can guide me?
Thanks!
Edit: grammar.