You are incorrectly calculating the height of the rectangle, and not using your scale. It's also trickier since your use of
padding is not the typical D3 convention.
svg.selectAll('rect') .data(arr) .enter() .append('rect') .attr('fill', 'blue') .attr('height', d => height - padding - yScale(d))
- 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 create a basic bar chart with unique counts on the y axis and a category on the x axis?
- How can I make the legend's similar to the stacked bar chart (and change the legend's label) in D3 v6?
- How can I get the d3.js bar chart start from 0 instead of from the top
- Starting point of x-axis in d3.js bar chart is not aligned with the y-intercept
- How to make bar chart with additional vertical lines below the x axis
- How to make axis label of stacked bar chart in the middle of ticks chart in D3?
- How do you rotate the x and y axis in D3 bar chart
- How can I get the D3.js axis ticks and positions as an array?
- 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 can I connect two parent node into one child node and how to make a tooltip for each node in the tree pragmatically? in D3 js (SVG)
- How can I rotate d3 chart and how can I start pie chart from angle -90?
- With D3, how can I set attribute ("fill", "none") of axis path and line, but not text (without editing stylesheet)
- dimple.js How can I change the labels of a chart axis without changing the data?
- 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
- D3.js bar chart - axis and labels not working / transitioning
- How to cut y axis to make the chart look better?
- How to make unselected part of pie chart and bar grayed out?
- how to make the x axis scrollable in a d3 line chart graph
- How can I make a dynamic line between 2 elements not knowing their positions in x and y?
- how to display data from 1st point on words on y axis for line chart in d3.js
- D3.js how to make the lines not go inside the arc of a donut chart
- d3 - Bar Chart overlapping my text, how can I reduce the domain so it doesn't?
- How can I apply a clipPath in SVG with multiple paths and NOT clip out the area between the paths?
- How to make axis "smart" and "flexible" so that the starting/end points on axis are sensible in D3 V4?
- How do I make D3 draw the axis from the start of a dataset?
- dc.js - Chart not rendering (single row bar chart - horizontal row), with the exception of legend, axes and tick marks/values (which do render)
- Can I project one state from "d3js.org/us-10m.v1.json" and not the whole nation?
More Query from same tag
- How to customize nvd3's tooltips and remove labels from x axis
- Can D3 force layout visualize multigraph?
- D3 line goes off chart to left when I append multiple line graph divs
- Qlik Sense change measure used on graph
- How to install d3 version 3 using npm?
- How to render a bar chart based on a selection from dropdown menu?
- Use of "i" in function (d, i) in d3.js
- mercator causing blank d3 page
- d3 importing csv file to array
- Filtering by Negation Crossfilter
- Zoom to bounding box of path on externally loaded svg using D3
- Importing d3.js in angular 2 project not working
- How to get the JSON path from element
- D3 Globe jumps at the start of drag to a different location
- How to apply custom format to .ValueFormat nvd3.js?
- Time Formatting in D3js
- Display text and direct via hyperlink on d3 Map
- Adding additional data points to a chart
- How to pass a value to line generation function in D3
- JSON doesn't load corretly
- dc.js, unable to render lines on a composite chart?
- D3 Time scales based only on hours and not bound to dates
- D3.js: How to combine 2 datasets in order to create a map and show values on.mouseover?
- Display large number on y-axis in python-nvd3
- Place several symbols on top of each candle on the canvas chart
- How to play a sound from audio tag in D3js selection?
- How to change D3 Dimple tooltips with chart data?
- How to put filteration expressions in vars in dc.js?
- Accessing filtered/clipped data from a dc.js chart
- d3.json Not able to post data after $ value