Commit de597abbfaeb27b03e5f2a1e175c65b4f823c9b7
1 parent
13b5231b
Exists in
master
Add attendee amount on top of each emissions per distance chart's bar
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
flaskr/static/js/plots/emissions-per-distance.js
@@ -277,6 +277,13 @@ function draw_emissions_per_distance(containerSelector, csvUrl) { | @@ -277,6 +277,13 @@ function draw_emissions_per_distance(containerSelector, csvUrl) { | ||
277 | leftBorder: histolol[index].x0, | 277 | leftBorder: histolol[index].x0, |
278 | rightBorder: histolol[index].x1, | 278 | rightBorder: histolol[index].x1, |
279 | }; | 279 | }; |
280 | + svg.append("text") | ||
281 | + .attr("transform", "translate(" + ((x(histolol[index].x0) + x(histolol[index].x1))/2) + margin.left + ", " + ( yl(element) - 20) + ")") | ||
282 | + .attr("y", 0) | ||
283 | + .attr("x", 0 ) | ||
284 | + .attr("dy", "1em") | ||
285 | + .style("text-anchor", "middle") | ||
286 | + .text(attendeeNumberPerGroup[index]); | ||
280 | // console.log(index); | 287 | // console.log(index); |
281 | // console.log(barSettings[index]); | 288 | // console.log(barSettings[index]); |
282 | }); | 289 | }); |