var dataset = this.getDataset();
var custom = point.custom || {};
- if (custom.borderWidth) {
+ if (!isNaN(custom.borderWidth)) {
borderWidth = custom.borderWidth;
- } else if (dataset.pointBorderWidth) {
+ } else if (!isNaN(dataset.pointBorderWidth)) {
borderWidth = helpers.getValueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth);
- } else if (dataset.borderWidth) {
+ } else if (!isNaN(dataset.borderWidth)) {
borderWidth = dataset.borderWidth;
}
expect(point._model.borderWidth).toBe(5.5);
expect(point._model.radius).toBe(4.4);
});
+
+ it('should allow 0 as a point border width', function() {
+ var chart = window.acquireChart({
+ type: 'line',
+ data: {
+ datasets: [{
+ data: [10, 15, 0, -4],
+ label: 'dataset1',
+ pointBorderWidth: 0
+ }],
+ labels: ['label1', 'label2', 'label3', 'label4']
+ }
+ });
+
+ var meta = chart.getDatasetMeta(0);
+ var point = meta.data[0];
+
+ expect(point._model.borderWidth).toBe(0);
+ });
});
expect(point._model.borderWidth).toBe(5.5);
expect(point._model.radius).toBe(4.4);
});
+
+ it('should allow pointBorderWidth to be set to 0', function() {
+ var chart = window.acquireChart({
+ type: 'radar',
+ data: {
+ datasets: [{
+ data: [10, 15, 0, 4],
+ pointBorderWidth: 0
+ }],
+ labels: ['label1', 'label2', 'label3', 'label4']
+ }
+ });
+
+ var meta = chart.getDatasetMeta(0);
+ var point = meta.data[0];
+ expect(point._model.borderWidth).toBe(0);
+ });
});