You will need to set the domain of x axis:
var x = d3.scaleLinear() .domain([0,12]) //you have not defined the domain .rangeRound([0, width]);
working code here
- D3.js version 4: How to properly set the x-axis-intervals for a histogram
- How to set the label for each vertical axis in a parallel coordinates visualization?
- How to properly set the type for property `d` in `path` element in a d3 react typescript application
- how to set the domain and scale on an axis on a nvd3.js multiBarChart
- How to display the value for the final tick on axis in D3?
- How to modify axis labels in d3 for a stacked bar chart when the axis labels are mapped as part of the scale's domain
- How do I set the X values for a singled stacked horizontal bar chart using d3.js?
- How to get the path string for D3 Axis
- How to properly transpose X and Y axes using the D3 axis commands?
- NVD3 Cumulative Line Chart : How to set different back ground color for specific X axis
- How to rotate the text labels for the x Axis of a nvd3.js line chart
- How do I properly sort the data for my d3 bubble map so that smaller bubbles show up on top of larger bubbles?
- d3js - Stacked Bar Chart in Horizontal Axis - How do I set x so the bars are seperated?
- How to set a scale for the time series, current x scale gives me NaN?
- How to add intervals in the X axis using d3.js?
- How can i set the x axis tick interval to be 1 in C3 / d3 js charts?
- how do I set up a grouping query on the server side. I want set up the query so I can use it for a pie chart in front end, using d3js
- How to add text on top the heatmap to properly show value for each rectangle when using D3.js?
- How to set unequal intervals on Y axis in D3.js?
- How do properly use an array label names for a custom axis on D3?
- D3.js: How to get the computed width and height for an arbitrary element?
- How to set text color for my d3 chart title?
- How do I display dates on the x-axis for nvd3 / d3.js?
- How to set the background-color of a D3.js svg?
- d3.js - How can I set the cursor to hand when mouseover these elements on SVG container?
- How can I get the D3.js axis ticks and positions as an array?
- 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 do I make a custom axis formatter for hours & minutes in d3.js?
- How to set the origin while drag in d3.js in v4
More Query from same tag
- Limiting D3 treemap Panning
- D3 Pie Chart not showing
- How to get absolute coordinates of object inside a <g> group?
- d3 drag event causes TypeError
- NVD3 Round Border on Tooltips
- When transitioning an SVG line in D3, new line appears instantly
- d3 - Rotate text elements in an array
- d3 bar chart using ionic 4 failed to load on device on -- prod mode
- Easy way to slide down an SVG element?
- Best way to increment d3 attribute
- D3: how to disable zoom on icons with background image?
- Not getting index for D3 Pie layout
- Impulse plot in d3
- How do you add and remove an information template by clicking on an SVG element in D3.js?
- In a d3 scatterplot using data from a csv file, how do i draw lines connecting related points when the mouse is over a point?
- A good book for learning D3.js
- C3.js graph not displaying
- How to implement highlight and transition effect for nodes in D3js force directed graph?
- D3 Area-Chart energy example
- Prevent aliasing SVG element when zooming on iOS device
- Cannot import data from csv file in d3
- Building a graph from ordered pairs
- d3.js map inset (zoom)
- dc.js geoChoroplethChart width smaller than 500 crops the map
- Return State ID from Containing County Event
- viewBox doesn't appear to work when width & height is set
- Key function for D3 datum
- Reusable d3.js Components And Inheritance
- D3 Bar Chart - Reverse Bars from Right to Left