Skip to content
This repository was archived by the owner on Dec 21, 2018. It is now read-only.

Commit 3b74358

Browse files
committed
Add tickFormat method to bin-ordinal scale. (vega/vega#1395)
1 parent e560c97 commit 3b74358

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/scaleBin.js

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ export function binOrdinal() {
9090
}
9191
};
9292

93+
// Addresses #1395, refine if/when d3-scale tickFormat is exposed
94+
scale.tickFormat = function() {
95+
var linear = scaleLinear().domain([domain[0], peek(domain)]);
96+
return linear.tickFormat.apply(linear, arguments);
97+
};
98+
9399
scale.copy = function() {
94100
return binOrdinal().domain(scale.domain()).range(scale.range());
95101
};

0 commit comments

Comments
 (0)