// Args are: (tooltipItem, data)
beforeLabel: helpers.noop,
label: function(tooltipItem, data) {
- var label = data.datasets[tooltipItem.datasetIndex].label || '';
+ let label = data.datasets[tooltipItem.datasetIndex].label || '';
if (label) {
label += ': ';
}
- if (!helpers.isNullOrUndef(tooltipItem.value)) {
- label += tooltipItem.value;
+ const value = tooltipItem.value;
+ if (!helpers.isNullOrUndef(value)) {
+ label += value;
}
return label;
},
me._endValue = end;
me._valueRange = end - start;
}
+
+ getLabelForValue(value) {
+ return new Intl.NumberFormat().format(value);
+ }
}
export default LinearScaleBase;
}
getLabelForValue(value) {
- return value === undefined ? 0 : value;
+ return value === undefined ? 0 : new Intl.NumberFormat().format(value);
}
getPixelForTick(index) {
});
chart.update();
- expect(chart.scales.y.getLabelForValue(7)).toBe(7);
+ expect(chart.scales.y.getLabelForValue(7)).toBe('7');
});
it('Should correctly determine the min and max data values when stacked mode is turned on', function() {
}
});
- expect(chart.scales.y.getLabelForValue(150)).toBe(150);
+ expect(chart.scales.y.getLabelForValue(150)).toBe('150');
});
describe('when', function() {
}
}
});
- expect(chart.scales.r.getLabelForValue(5)).toBe(5);
+ expect(chart.scales.r.getLabelForValue(5)).toBe('5');
});
it('should get the correct distance from the center point', function() {