It's irregular because you are rounding your output range (
rangeRound). In some cases, the distance between two bars is 3 pixels and sometimes only 2. This is because the actual
x position is a fractional value and ends up being rounded one way in some cases and the other way on other cases.
You can mitigate the effect but changing
range, but that won't eliminate it entirely as you'll still get fractional pixel values for positions. The best thing to do is probably to simply increase the padding so that the differences aren't as obvious.
- d3.js : getting the bars width or X position right?
- D3.js bar chart 'enter' appears to draw the new bars in wrong position
- Sorting the bars and getting the group data in a grouped bar chart
- Getting the scale right for a line chart for a simple CSV in D3 v4
- D3.js SVGs are not being drawn at the right node position
- How to position the legend to the right of the donut chart
- Why does removing, then re-adding bars to my stack bar chart change the position of the bars?
- Using transform to position my shape the right way up
- How to get the position and width of a tspan element
- How to place the bars of a bar chart in the right positions of the xAxis using d3.js?
- vertical bars not aligned with the x-axis label and last bar rendered outside the x-axis range - D3 js - simple bar with fixed width
- d3 make a individual bar Chart of week and Hours between and set the Item in the right Position
- How to position the legend right to donut chart in d3.js?
- d3 - foreign object - getting the right scope
- D3.js: How to get the computed width and height for an arbitrary element?
- How do I get the width of an svg element using d3js?
- Calculate width of text before drawing the text
- D3.js: calculate width of bars in time scale with changing range?
- Is D3.js the right choice for real-time visualization of Neo4j Graph DB data
- D3 how to change the width and length of SVG
- How do I change the legend position in a NVD3 chart?
- D3, retrieve the x position of a <g> element and apply multiple transform
- How can I set the each line color or width in SVG path
- Counting the number of continuous blue bars till the hover bar
- How do I position subgroups of small multiples together on the page?
- How to set circle at the right end of the last bar / item using D3
- Pre-projected geometry v getting the browser to do it (aka efficiency v flexibility)
- How to assign the x-axis position of a node in a Sankey Diagram (D3) from the json file
- d3.event.x does not get the x cursor's position
- How to maintain the SVG marker width and height ?
More Query from same tag
- D3JS - animate a circle along an svg path at a constant speed
- d3 tree <g> tag padding/border overall styling
- D3 Bar Chart Negative Values not Showing Up
- change the color of chart d3
- d3.js not understanding svg:path
- Prevent click action when dragging a D3 Node
- d3.js - draw file directory with tree layout
- how to deal with unique data use d3.js?
- How to handle visualizing massive datasets in D3
- Four color theorem in D3js for neighbors polygons coloring?
- d3 version 4 rescaleX where X scale is scaleTime
- Creating a force layout in D3.js visualisation library
- How to implement hyperlinks in JSON & D3 plugin?
- How can the elements in SVG can't be dragged out of the scope of SVG?
- How can I generate as many colors as I want using d3?
- Change style of the data point based on the text area
- csv data logs but json data doesn't?
- How to selectively pass mouse events to underlying svg elements
- D3.js v5 Domain() not taking variable for array
- Multi series chart (D3) with missing values
- Iterate over geojson in D3.js and return values when condition is met
- Driving a D3 chart with and without d3.json()
- Creating a whole new world with shapefile format of different layers in one file
- Calculate SVG Path Centroid with D3.js
- Can you bind data using D3.js to A-Frame primitives?
- Responsive pie chart using NVD3
- Gremlin: Find all the paths between two nodes and transform the query result into JSON format
- How to import the d3.js v5 module into a polymer 3 element?
- d3 setting multiple attributes from the same function?