Skip to content

Commit

Permalink
perf: add point values
Browse files Browse the repository at this point in the history
For golang/go#48803.

Change-Id: I1d683fd33f12d2cfcc2050aad180ef4ab6431d98
Reviewed-on: https://go-review.googlesource.com/c/build/+/412996
Reviewed-by: Michael Knyszek <[email protected]>
  • Loading branch information
prattmic committed Jun 17, 2022
1 parent cb53467 commit 3062ce6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions third_party/bandchart/bandchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,30 @@ function BandChart(data, {
}).format(X[i])
+ ")")
)
.call(g => g.append('text')
// Point center, low, high values.
// Bottom-right corner, next to "Commits".
.attr("x", xRange[1])
.attr("y", yRange[0] + (yRange[0]-yRange[1])*0.12)
.attr("pointer-events", "none")
.attr("fill", "currentColor")
.attr("text-anchor", "end")
.attr("font-family", "sans-serif")
.attr("font-size", 12)
.text(Intl.NumberFormat([], {
style: 'percent',
signDisplay: 'always',
minimumFractionDigits: 2,
}).format(Y[i]) + " (" + Intl.NumberFormat([], {
style: 'percent',
signDisplay: 'always',
minimumFractionDigits: 2,
}).format(Y1[i]) + ", " + Intl.NumberFormat([], {
style: 'percent',
signDisplay: 'always',
minimumFractionDigits: 2,
}).format(Y2[i]) + ")")
)
})
.on("mouseout", () => svg.selectAll('.tooltip').remove());

Expand Down

0 comments on commit 3062ce6

Please sign in to comment.