score:2
Accepted answer
I have improved your fiddle: https://jsfiddle.net/y1vctdsg/1/ I have changed following part of the code:
svg.append("g")
.attr("class", "x axis")
.attr("transform", `translate(20,${height+margin.top})`)
.call(xAxis);
And also I've changed from axisBottom()
to axisTop()
only for better readability:
g.append("g")
.attr("class", "xAxis")
.call(d3.axisTop(x))
Source: stackoverflow.com
Related Query
- How to make the grids of a chart be in line with axes
- how to make the x axis scrollable in a d3 line chart graph
- How do I make my chart bars align with the chart axis?
- How to make a d3 multiple line chart with irregular data?
- How to make the patterns of a pie chart parallel to the center line of sectors in d3.js?
- How to make bar chart with additional vertical lines below the x axis
- How to render multi line chart with DC.js with the following type of data - JAVASCRIPT (DC.js)
- Normalize the Graph axes in NVD3 Line with focus chart
- How to change the scale of axes in line chart using d3.js?
- 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 make a dashed line legend with d3.js
- Make simple bar chart using C3 with separate columns on the x axis
- D3 bubble chart / pack layout - How to make bubbles radiate out from the largest bubbles to the smallest?
- How to make an interactive tree chart with d3?
- How to plot animated line chart using d3 while the data table is required to be updated every 1 second?
- d3 v4 drag line chart with x and y axes
- How to change the viewfinder (focus chart) of a NVD3 line chart programmatically?
- How to Make a bar chart with rounded corners with extended grid in d3.js?
- How to make grid lines when axes are aligned at the middle?
- How can I make my lines spin with the globe?
- How to make labels appear only when the chart is zoomed in
- D3.js: plot dots on the existing line in a multiseries line chart with long formatted data
- How to line up x axis on stacked bar chart with a line overlay in d3.js
- d3js gantt chart with date/time scale at the top and current day blue line
- How to cut y axis to make the chart look better?
- How to make D3.js use UTC times for the x-axis, with Moment.js
- How to create a % difference arrow line with value in a bar chart using D3.js
- D3 How to update the chart after selection from drop down menu with new data
- How can I make a 100% stacked chart with nvd3?
- How to plot data points on multi-line chart with multiple y axes
More Query from same tag
- d3 directed graph with varying stroke-widths
- jquery error when trying to get window width
- dynamically giving input to date format for parsing D3.js
- D3 (with angular) Failing to insert a span inside a div
- CSS Values in a D3 Transition box shadow
- How to style slider on chart in D3.js and show label of dynamic y-value?
- How is data parsed in this 3D piechart?
- Append <div> to node in SVG with D3
- Replace d3.js symbols with images
- Error: <path> attribute d: expected number - when trying to build a line chart with D3
- How to rotate the text labels for the x Axis of a nvd3.js line chart
- Adjust panel size bootstrap
- Line chart axis zoom
- Uncaught TypeError: Cannot read property 'y' of undefined in NV D3 StackedLine
- c3 chart background area
- repeating world map projection with d3.js?
- meteor d3.js communicate event
- D3.js SVG drop shadow for fast transitions
- Append foreignObject containing some HTML inside an SVG element
- d3.js inline-block elements are failing in Firefox and IE
- How do I append text to my rect in d3?
- D3JS interpolateSpectral
- Appending text to rows and columns
- Graphing code size
- D3 Y Scale, y vs height?
- Adding Multiple graphs to one page with D3
- d3.event is undefined in zoom callback (Angular)
- dynamic diameter in bubble chart in d3.js
- How can I successfully load dimple.js when require.js is present?
- D3 v4 - d3.zoom() prevents binding some events except on the Window