Я считаю, что это то, что вам нужно:
var svg = d3.select("svg"),
margin = {top: 20, right: 20, bottom: 30, left: 40},
width = +svg.attr("width") - margin.left - margin.right,
height = +svg.attr("height") - margin.top - margin.bottom;
var x = d3.scaleLinear().range([0, width - (margin.left + margin.right)]);
var y = d3.scaleLinear().range([height - (margin.top * 2), 0]);
var line = d3.line()
.x(function(d) { return x(d.module); })
.y(function(d) { return y(d.value); });
var g = svg.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
var data = [
{"value": 83, "module": 0},
{"value": 79, "module": 1},
{ "value": 73, "module": 3},
{"value": 71, "module": 4},
{"value": 67, "module": 5},
{"value": 65, "module":6}
]
data.forEach(function(d) {
d.value = +d.value;
d.module = +d.module;
});
x.domain(d3.extent(data, function(d) { return d.module; }));
y.domain([
(Math.floor(d3.min(data, function(d) { return d.value; }) / 10) * 10),
(Math.ceil(d3.max(data, function(d) { return d.value; }) / 10) * 10)
]);
g.append("g")
.attr("class", "axis axis--x")
.attr("transform", "translate(" + ((margin.left + margin.right) / 2) + "," + (height - margin.top) + ")")
.call(d3.axisBottom(x)
.ticks(6)
.tickFormat(function(d) { return 'Module ' + d; })
)
g.append("g")
.attr("class", "axis axis--y")
// Data line and dots group
var lineAndDots = g.append("g")
.attr("class", "line-and-dots")
.attr("transform", "translate(" + ((margin.left + margin.right) / 2) + "," + 0 + ")")
// Data line
lineAndDots.append("path")
.datum(data)
.attr("class", "data-line")
.attr("d", line);
// Data dots
lineAndDots.selectAll("line-circle")
.data(data)
.enter().append("circle")
.attr("class", "data-circle")
.attr("r", 5)
.attr("cx", function(d) { return x(d.module); })
.attr("cy", function(d) { return y(d.value); });
g.selectAll("lines-ax")
.data(data)
.enter().append("line")
.attr("class", "line")
.attr("x1", function(d) { return x(d.module) + margin.right + 10; })
.attr("y1", function(d) { return height - margin.bottom })
.attr("x2", function(d) { return x(d.module) + margin.right + 10; })
.attr("y2", function(d) { return y(d.value); })
.attr("stroke", "gray")
.attr("stroke-width", 3);
/*focus.append("line")
.attr("class", "x-hover-line hover-line")
.attr("y1", 0)
.attr("y2", height);
//focus.select(".x-hover-line").attr("y2", height - y(d.value));*/
body {
font-family: 'Droid Sans', sans-serif;
}
.axis {
font-size: 14px;
font-weight: bold;
}
text {
fill: #727075;
stroke: none;
}
.axis path,
.axis line {
fill: none;
stroke: none;
stroke-width: 2px;
shape-rendering: crispEdges;
}
.grid path {
stroke: none;
}
.grid line {
stroke: #E0E0E0;
shape-rendering: crispEdges;
}
.data-line {
fill: none;
stroke: #3C92BA;
stroke-width: 4px;
}
.data-circle {
fill: #3C92BA;
}
.axis-title {
text-anchor: end;
fill: #5D6971;
font-weight: normal;
}
.axis-tspan {
font-size: 12px;
}
<svg width="730" height="375"></svg>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/5.15.0/d3.js"></script>