Skip to content

Commit 9bac296

Browse files
authored
fix(radar): Correct display of indexed axis
Typecast axis text value to be dispalyed from the helper function. Fix #997
1 parent b97558c commit 9bac296

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

spec/shape/shape.radar-spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,23 @@ describe("SHAPE RADAR", () => {
190190
});
191191
});
192192
});
193+
194+
describe("Axis", () => {
195+
before(() => {
196+
args = {
197+
data: {
198+
columns: [
199+
["data1", 330, 350, 220, 400, 150, 330, 230, 390, 95, 195, 220]
200+
],
201+
type: "radar"
202+
}
203+
};
204+
});
205+
206+
it("check if default indexed axis text are showing", () => {
207+
chart.$.main.selectAll(`.${CLASS.chartRadars} .${CLASS.axis} text`).each(function(d, i) {
208+
expect(+this.textContent).to.be.equal(i);
209+
});
210+
});
211+
});
193212
});

src/shape/radar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ extend(ChartInternal.prototype, {
259259
.attr("dy", ".5em")
260260
.call(selection => {
261261
selection.each(function(d) {
262-
setTextValue(d3Select(this), d, [-1.2, 1.2], true);
262+
setTextValue(d3Select(this), String(d), [-1.2, 1.2], true);
263263
});
264264
})
265265
.datum((d, i) => ({index: i}))

0 commit comments

Comments
 (0)