score:7
Accepted answer
you need to add on half the width of each bar to the x point of your line/dot calculation. as you've defined the width of each bar to be x.rangeband(), this would mean changing the x property to something like:
var valueline = d3.svg.line()
.x(function(d) {
return x(d.property) + x.rangeband() / 2;
})
.y(function(d) { return ycost(d.normalised_cost); })
.interpolate("step-after");
Source: stackoverflow.com
Related Query
- How to line up x axis on stacked bar chart with a line overlay in d3.js
- How to add a line at top of stacked bar chart with d3.js?
- 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 to create Stacked Line Chart D3, Multiple Y Axis and common X Axis
- d3 bar chart with fixed bar width and fixed spacing to align in center axis line
- how to create a stacked bar chart with images in d3
- How to create a % difference arrow line with value in a bar chart using D3.js
- Angular-NVD3 Stacked Bar Chart With Line
- d3.js How to draw line chart with vertical x axis labels
- Horizontal Stacked Bar Chart with Two Y Axis Issues
- How can I create a basic bar chart with unique counts on the y axis and a category on the x axis?
- dc.js Stacked Bar Chart having only one column and with elastic X Axis is not rendered properly
- d3js - Stacked Bar Chart in Horizontal Axis - How do I set x so the bars are seperated?
- How to make bar chart with additional vertical lines below the x axis
- How to plot stacked bar chart according to the custom Y axis in D3
- How to make axis label of stacked bar chart in the middle of ticks chart in D3?
- How to build stacked bar chart overlapping with d3js
- How to add a properly scaled y axis to a stacked d3 bar chart
- How to hide a content on stacked Bar Chart below X - Axis
- How to update d3.js bar chart with new data
- Make simple bar chart using C3 with separate columns on the x axis
- How to create stacked row chart with one row with dc.js?
- nvd3.js-Line Chart with View Finder: rotate axis labels and show line values when mouse over
- d3.js bar chart sorting: can't figure out how to sort x-axis labels along with bars
- How to add a line on x-axis on a horizontal bar chart in d3
- How to use x and width in a bar chart with scaleTime?
- DC.js bar chart with date axis
- d3.js stacked bar chart with positive and negative values
- Need help lining up x axis ticks with bars in D3.js bar chart
- How to Make a bar chart with rounded corners with extended grid in d3.js?
More Query from same tag
- add images to bubble layout in D3.js
- Wrapping Text Inside SVG Circle
- d3js,when mouse drag the blank area,the force graph keeps jumping
- How to add a fixed range vertical line to a D3.js chart
- D3 Updating x axis ticks throws error "translate(NaN,0)"
- How to add text in the center of node in force directed graph?
- Read csv data with D3.csv, each column in separate array
- Embed D3 graph into a handlebar template
- How do I make a custom axis formatter for hours & minutes in d3.js?
- dc.js animated selection along x-axis
- d3 extracting values from selection after filtering data on mouseover
- Create dataset from array of numbers with d3.js
- i have a map variable i need to use that to draw a pie chart in d3.js
- Adding tool tip to collapse graph
- How To Align Text Inside SVG In D3.js
- d3 js redraw graph add existing nodes again
- Drawing D3 paths one after the other
- Creating thumbnails of dc.js charts
- How to change xaxis label in D3 chart?
- Access y value of a d3.line after interpolation
- d3 line chart not showing data - based of tutorial
- How to use default HTML DOM functions with D3js
- WebStorm React d3 library force()
- issues with Raphaƫl and removing objects within svg
- how to draw contour around text image
- d3.js scatter plot don't redraw on transition
- D3js page: how to replace topojson generated svg by stand alone svg file?
- D3 - Using JSON data to create multiple bars
- How to merge the best of mpld3 and square/crossfilter as a custom plugin?
- Set leaf nodes' size d3.treemap