score:1
Accepted answer
Use nice()
in the domain:
y.domain([
d3.min(chartData, function(n) {
return d3.min(n.values, function(d) {
return d.value;
});
}),
d3.max(chartData, function(n) {
return d3.max(n.values, function(d) {
return d.value;
});
})
]).nice();
Here is your Fiddle: https://jsfiddle.net/c8mjha3o/
Source: stackoverflow.com
Related Query
- show the bottom most tick of y axis
- D3: How to remove tick marks at the top and bottom of Y axis
- D3.js - show tick values on the Y axis
- MultiBar chart with nvd3 / d3 only shows labels for every other tick on the x-axis. How can I get them all to show up?
- How to display the value for the final tick on axis in D3?
- How do I specify the number of axis tick marks in d3?
- Add extra tick of the beginning of a d3 time axis
- Pushing the top most object in an SVG container to the bottom
- Limit number of Y axis ticks by keeping a top tick above the bar in d3
- D3 - Show only middle and last tick marks on axis
- c3.js - show tick label/value when zooming the chart
- D3.JS trying to format the text in first tick of axis
- Different tick sizes on the Y axis of a D3js line graph
- D3 align text on left side of the axis from the right most character
- plotting tick text above the axis
- d3 axis not showing tick label if two ticks have the same value
- The axis label at x=0 does not show up
- Why dont the axis tick marks get removed?
- How can i show the labels on the x axis when there is data overlap in d3js?
- How to move the x axis to the bottom of a svg
- d3.js - adding One additional tick for the Y axis does not work
- How can I make a bar chart starting from the 0 point of the y axis and not from the bottom of the svg?
- How can i set the x axis tick interval to be 1 in C3 / d3 js charts?
- D3.js - Adding a tick value on the x axis (date format)
- How do I update the tick values on my axis when zooming ?
- D3js Ordinal Axis does not show all the ticks
- How to setup D3.js axis labels to show rounded numbers with the $ sign?
- Change the amount of tick labels on the x axis shown?
- d3.js: Align text labels between ticks on the axis
- D3.js: Using images (with filenames specified in data) as tick values on axis
More Query from same tag
- Wrong number of lines/ticks on d3 bar chart
- Find tangent of path in d3.js
- get the bounding box of a D3 graph
- Read json data in d3 js
- How to display javascript variable as text using D3
- Correct date format for Rickshaw
- making a modular d3js tree node
- Get one element from d3js selection, by index
- D3 taking an index string and classifying a circle as hidden or not
- Crossfilter group a filtered dimension
- dc.js - queries related to axis
- Hover on legend and hover on path effect in nvD3
- d3 tricking voronoi tesselation
- Filter nested array of objects by object property in d3.js
- Bind dynamically created D3 elements with an event through another function call
- d3js not removing previous element when select a new JSON file
- Mousemove within mousedown stops mouse up firing
- Background bar distorting
- unable to extract and separately colour subunits in d3
- How to update the data in a stacked area chart?
- how to hide loading image after load chart in d3?
- How to use ordinal scale in d3 to return month names
- x axis with a full day in hours/quarters
- d3.js: run the same code in Angular app and on node.js
- Dimple.JS Animate line series animation
- I have an image that has a hover effect, but there is a text above and it avoids it
- d3.js - Multiple line chart doesn't update circles
- Why is this SVG Path showing incorrect width and height on Firefox?
- d3 v4 scaleTime not accepting date object nor integer
- Graph line not moving with zoomable chart area