Skip to content

Commit 3ce087d

Browse files
committed
Decrease size of reference line labels and rotate vertical ones
1 parent e98eebb commit 3ce087d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

js/reference_lines.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ const referenceLines = class {
7979
.join("text")
8080
.classed("plot-text", true)
8181
.attr("x", plotObj.width - plotObj.margins.right + 5)
82-
.attr("y", d => plotObj.yscale(d.y) + 4)
83-
.attr("font-size", "8px")
82+
.attr("y", d => plotObj.yscale(d.y) + 2)
83+
.attr("font-size", "6px")
8484
.attr("fill", d => d.color)
8585
.attr("display", d => inPlotY(d.y) ? null : "none")
8686
.text(d => d.y);
@@ -117,7 +117,8 @@ const referenceLines = class {
117117
.attr("text-anchor", "middle")
118118
.attr("x", d => plotObj.xscale(d.x))
119119
.attr("y", plotObj.height - plotObj.margins.bottom + 10)
120-
.attr("font-size", "8px")
120+
.attr("transform", d => "rotate(-90 " + plotObj.xscale(d.x) + " " + (plotObj.height - plotObj.margins.bottom + 8) + ")")
121+
.attr("font-size", "6px")
121122
.attr("fill", d => d.color)
122123
.attr("display", d => inPlotX(d.x) ? null : "none")
123124
.text(d => d.x)

0 commit comments

Comments
 (0)