diff --git a/docs/charts/radar.md b/docs/charts/radar.md index 1b1c7ef0714..9989110ee38 100644 --- a/docs/charts/radar.md +++ b/docs/charts/radar.md @@ -87,6 +87,7 @@ The radar chart allows a number of properties to be specified for each dataset. | [`pointRadius`](#point-styling) | `number` | Yes | Yes | `3` | [`pointRotation`](#point-styling) | `number` | Yes | Yes | `0` | [`pointStyle`](#point-styling) | string|Image | Yes | Yes | `'circle'` +| [`spanGaps`](#line-styling) | `boolean` | - | - | `undefined` ### General @@ -125,8 +126,9 @@ The style of the line can be controlled with the following properties: | `borderWidth` | The line width (in pixels). | `fill` | How to fill the area under the line. See [area charts](area.md). | `lineTension` | Bezier curve tension of the line. Set to 0 to draw straightlines. +| `spanGaps` | If true, lines will be drawn between points with no or null data. If false, points with `NaN` data will create a break in the line. -All these values, if `undefined`, fallback to the associated [`elements.line.*`](../configuration/elements.md#line-configuration) options. +If the value is `undefined`, `spanGaps` fallback to the associated [chart configuration options](#configuration-options). The rest of the values fallback to the associated [`elements.line.*`](../configuration/elements.md#line-configuration) options. ### Interactions diff --git a/src/controllers/controller.radar.js b/src/controllers/controller.radar.js index d83e472a739..691e6e668f2 100644 --- a/src/controllers/controller.radar.js +++ b/src/controllers/controller.radar.js @@ -143,9 +143,12 @@ module.exports = DatasetController.extend({ */ _resolveDatasetElementOptions: function() { var me = this; + var config = me._config; + var options = me.chart.options; var values = DatasetController.prototype._resolveDatasetElementOptions.apply(me, arguments); - values.tension = valueOrDefault(me._config.lineTension, me.chart.options.elements.line.tension); + values.spanGaps = valueOrDefault(config.spanGaps, options.spanGaps); + values.tension = valueOrDefault(config.lineTension, options.elements.line.tension); return values; }, @@ -157,6 +160,13 @@ module.exports = DatasetController.extend({ var points = meta.data || []; var i, ilen, model, controlPoints; + // Only consider points that are drawn in case the spanGaps option is used + if (meta.dataset._model.spanGaps) { + points = points.filter(function(pt) { + return !pt._model.skip; + }); + } + function capControlPoint(pt, min, max) { return Math.max(Math.min(pt, max), min); } diff --git a/src/elements/element.line.js b/src/elements/element.line.js index b0e799d2770..5fa728bfe2c 100644 --- a/src/elements/element.line.js +++ b/src/elements/element.line.js @@ -38,17 +38,16 @@ module.exports = Element.extend({ var globalOptionLineElements = globalDefaults.elements.line; var lastDrawnIndex = -1; var closePath = me._loop; - var index, current, previous, currentVM; + var index, previous, currentVM; if (me._loop && points.length) { - if (!spanGaps) { - for (index = points.length - 1; index >= 0; --index) { - // If the line has an open path, shift the point array - if (points[index]._view.skip) { - points = points.slice(index).concat(points.slice(0, index)); - closePath = false; - break; - } + for (index = 0; index < points.length; ++index) { + previous = helpers.previousItem(points, index); + // If the line has an open path, shift the point array + if (!points[index]._view.skip && previous._view.skip) { + points = points.slice(index).concat(points.slice(0, index)); + closePath = spanGaps; + break; } } // If the line has a close path, add the first point again @@ -77,9 +76,8 @@ module.exports = Element.extend({ lastDrawnIndex = -1; for (index = 0; index < points.length; ++index) { - current = points[index]; previous = helpers.previousItem(points, index); - currentVM = current._view; + currentVM = points[index]._view; // First point moves to it's starting position no matter what if (index === 0) { @@ -96,7 +94,7 @@ module.exports = Element.extend({ ctx.moveTo(currentVM.x, currentVM.y); } else { // Line to next point - helpers.canvas.lineTo(ctx, previous._view, current._view); + helpers.canvas.lineTo(ctx, previous._view, currentVM); } lastDrawnIndex = index; } diff --git a/src/plugins/plugin.filler.js b/src/plugins/plugin.filler.js index 3388bb821d2..8acbc40742c 100644 --- a/src/plugins/plugin.filler.js +++ b/src/plugins/plugin.filler.js @@ -271,17 +271,22 @@ function doFill(ctx, points, mapper, view, color, loop) { var curve1 = []; var len0 = 0; var len1 = 0; - var i, ilen, index, p0, p1, d0, d1; + var i, ilen, index, p0, p1, d0, d1, loopOffset; ctx.beginPath(); - for (i = 0, ilen = (count + !!loop); i < ilen; ++i) { + for (i = 0, ilen = count; i < ilen; ++i) { index = i % count; p0 = points[index]._view; p1 = mapper(p0, index, view); d0 = isDrawable(p0); d1 = isDrawable(p1); + if (loop && loopOffset === undefined && d0) { + loopOffset = i + 1; + ilen = count + loopOffset; + } + if (d0 && d1) { len0 = curve0.push(p0); len1 = curve1.push(p1); diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.json b/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.json index e6c982f3bb5..4a8553bc26e 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.json @@ -5,20 +5,21 @@ "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], "datasets": [{ "backgroundColor": "rgba(0, 0, 192, 0.25)", - "data": [null, null, 2, 4, 2, 1, -1, 1, 2] + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] }, { "backgroundColor": "rgba(0, 192, 0, 0.25)", - "data": [4, 2, null, 3, 2.5, null, -2, 1.5, 3] + "data": [5.5, 2, null, 4, 5, null, null, 2, 1] }, { "backgroundColor": "rgba(192, 0, 0, 0.25)", - "data": [3.5, 2, 1, 2.5, -2, 3, -1, null, null] + "data": [7, 3, 4, 5, 6, 1, 4, null, null] }, { - "backgroundColor": "rgba(128, 0, 128, 0.25)", - "data": [5, 6, 5, -2, -4, -3, 4, 2, 4.5] + "backgroundColor": "rgba(0, 0, 192, 0.25)", + "data": [8, 7, 6.5, -6, -4, -6, 4, 5, 8] }] }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.png b/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.png index 1dff6bf84d0..1cca06775cb 100644 Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.png and b/test/fixtures/plugin.filler/fill-radar-boundary-end-circular.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-end-span.json b/test/fixtures/plugin.filler/fill-radar-boundary-end-span.json new file mode 100644 index 00000000000..29b444a7237 --- /dev/null +++ b/test/fixtures/plugin.filler/fill-radar-boundary-end-span.json @@ -0,0 +1,45 @@ +{ + "config": { + "type": "radar", + "data": { + "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], + "datasets": [{ + "backgroundColor": "rgba(0, 0, 192, 0.25)", + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] + }, { + "backgroundColor": "rgba(0, 192, 0, 0.25)", + "data": [5.5, 2, null, 4, 5, null, null, 2, 1] + }, { + "backgroundColor": "rgba(192, 0, 0, 0.25)", + "data": [7, 3, 4, 5, 6, 1, 4, null, null] + }, { + "backgroundColor": "rgba(0, 0, 192, 0.25)", + "data": [8, 7, 6.5, -6, -4, -6, 4, 5, 8] + }] + }, + "options": { + "responsive": false, + "spanGaps": true, + "legend": false, + "title": false, + "scale": { + "display": false + }, + "elements": { + "point": { + "radius": 0 + }, + "line": { + "borderColor": "transparent", + "fill": "end" + } + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 256 + } + } +} diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-end-span.png b/test/fixtures/plugin.filler/fill-radar-boundary-end-span.png new file mode 100644 index 00000000000..caa742b44e0 Binary files /dev/null and b/test/fixtures/plugin.filler/fill-radar-boundary-end-span.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-end.json b/test/fixtures/plugin.filler/fill-radar-boundary-end.json index 2018e4822f0..f725625966a 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-end.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-end.json @@ -5,20 +5,21 @@ "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], "datasets": [{ "backgroundColor": "rgba(0, 0, 192, 0.25)", - "data": [null, null, 2, 4, 2, 1, -1, 1, 2] + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] }, { "backgroundColor": "rgba(0, 192, 0, 0.25)", - "data": [4, 2, null, 3, 2.5, null, -2, 1.5, 3] + "data": [5.5, 2, null, 4, 5, null, null, 2, 1] }, { "backgroundColor": "rgba(192, 0, 0, 0.25)", - "data": [3.5, 2, 1, 2.5, -2, 3, -1, null, null] + "data": [7, 3, 4, 5, 6, 1, 4, null, null] }, { - "backgroundColor": "rgba(128, 0, 128, 0.25)", - "data": [5, 6, 5, -2, -4, -3, 4, 2, 4.5] + "backgroundColor": "rgba(0, 0, 192, 0.25)", + "data": [8, 7, 6.5, -6, -4, -6, 4, 5, 8] }] }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-end.png b/test/fixtures/plugin.filler/fill-radar-boundary-end.png index c17f9367d24..c7c7173e11f 100644 Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-end.png and b/test/fixtures/plugin.filler/fill-radar-boundary-end.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-circular.json b/test/fixtures/plugin.filler/fill-radar-boundary-origin-circular.json index af50665f5de..5e2e0878935 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-origin-circular.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-origin-circular.json @@ -19,6 +19,7 @@ }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-span.json b/test/fixtures/plugin.filler/fill-radar-boundary-origin-span.json new file mode 100644 index 00000000000..7b72cf4d56f --- /dev/null +++ b/test/fixtures/plugin.filler/fill-radar-boundary-origin-span.json @@ -0,0 +1,45 @@ +{ + "config": { + "type": "radar", + "data": { + "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], + "datasets": [{ + "backgroundColor": "rgba(0, 0, 192, 0.25)", + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] + }, { + "backgroundColor": "rgba(0, 192, 0, 0.25)", + "data": [6, 2, null, 4, 5, null, null, 2, 1] + }, { + "backgroundColor": "rgba(192, 0, 0, 0.25)", + "data": [7, 3, 4, 5, 6, 1, 4, null, null] + }, { + "backgroundColor": "rgba(0, 64, 192, 0.25)", + "data": [8, 7, 6, -6, -4, -6, 4, 5, 8] + }] + }, + "options": { + "responsive": false, + "spanGaps": true, + "legend": false, + "title": false, + "scale": { + "display": false + }, + "elements": { + "point": { + "radius": 0 + }, + "line": { + "borderColor": "transparent", + "fill": "origin" + } + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 256 + } + } +} diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-span.png b/test/fixtures/plugin.filler/fill-radar-boundary-origin-span.png new file mode 100644 index 00000000000..7f043dbd8ba Binary files /dev/null and b/test/fixtures/plugin.filler/fill-radar-boundary-origin-span.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline-span.json b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline-span.json new file mode 100644 index 00000000000..6e99d203c25 --- /dev/null +++ b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline-span.json @@ -0,0 +1,46 @@ +{ + "config": { + "type": "radar", + "data": { + "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], + "datasets": [{ + "backgroundColor": "rgba(0, 0, 192, 0.25)", + "data": [null, null, 2, 4, 2, 1, -1, 1, 2] + }, { + "backgroundColor": "rgba(0, 192, 0, 0.25)", + "data": [4, 2, null, 3, 2.5, null, -2, 1.5, 3] + }, { + "backgroundColor": "rgba(192, 0, 0, 0.25)", + "data": [3.5, 2, 1, 2.5, -2, 3, -1, null, null] + }, { + "backgroundColor": "rgba(128, 0, 128, 0.25)", + "data": [5, 6, 5, -2, -4, -3, 4, 2, 4.5] + }] + }, + "options": { + "responsive": false, + "spanGaps": true, + "legend": false, + "title": false, + "scale": { + "display": false + }, + "elements": { + "point": { + "radius": 0 + }, + "line": { + "borderColor": "transparent", + "tension": 0.5, + "fill": "origin" + } + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 256 + } + } +} diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline-span.png b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline-span.png new file mode 100644 index 00000000000..b9b4dde994c Binary files /dev/null and b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline-span.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json index e5c4b2f8009..caf1a4e6a05 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-origin-spline.json @@ -19,6 +19,7 @@ }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin.json b/test/fixtures/plugin.filler/fill-radar-boundary-origin.json index 0cc32b4a93a..e4f52186eab 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-origin.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-origin.json @@ -5,20 +5,21 @@ "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], "datasets": [{ "backgroundColor": "rgba(0, 0, 192, 0.25)", - "data": [null, null, 2, 4, 2, 1, -1, 1, 2] + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] }, { "backgroundColor": "rgba(0, 192, 0, 0.25)", - "data": [4, 2, null, 3, 2.5, null, -2, 1.5, 3] + "data": [6, 2, null, 4, 5, null, null, 2, 1] }, { "backgroundColor": "rgba(192, 0, 0, 0.25)", - "data": [3.5, 2, 1, 2.5, -2, 3, -1, null, null] + "data": [7, 3, 4, 5, 6, 1, 4, null, null] }, { - "backgroundColor": "rgba(128, 0, 128, 0.25)", - "data": [5, 6, 5, -2, -4, -3, 4, 2, 4.5] + "backgroundColor": "rgba(0, 64, 192, 0.25)", + "data": [8, 7, 6, -6, -4, -6, 4, 5, 8] }] }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-origin.png b/test/fixtures/plugin.filler/fill-radar-boundary-origin.png index af1725f910c..2194bc4ae98 100644 Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-origin.png and b/test/fixtures/plugin.filler/fill-radar-boundary-origin.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.json b/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.json index aec9f511228..bbd7c74283c 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.json @@ -4,21 +4,22 @@ "data": { "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], "datasets": [{ - "backgroundColor": "rgba(0, 0, 192, 0.25)", - "data": [null, null, 2, 4, 2, 1, -1, 1, 2] + "backgroundColor": "rgba(0, 0, 255, 0.25)", + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] }, { - "backgroundColor": "rgba(0, 192, 0, 0.25)", - "data": [4, 2, null, 3, 2.5, null, -2, 1.5, 3] + "backgroundColor": "rgba(0, 255, 0, 0.25)", + "data": [6, 2, null, 4, 5, null, null, 2, 1] }, { - "backgroundColor": "rgba(192, 0, 0, 0.25)", - "data": [3.5, 2, 1, 2.5, -2, 3, -1, null, null] + "backgroundColor": "rgba(255, 0, 0, 0.25)", + "data": [7, 3, 4, 5, 6, 1, 4, null, null] }, { - "backgroundColor": "rgba(128, 0, 128, 0.25)", - "data": [5, 6, 5, -2, -4, -3, 4, 2, 4.5] + "backgroundColor": "rgba(0, 0, 255, 0.25)", + "data": [8, 7, 6, -6, -4, -6, 4, 5, 8] }] }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.png b/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.png index 8be3f232cc2..b0f8f8f0a96 100644 Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.png and b/test/fixtures/plugin.filler/fill-radar-boundary-start-circular.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-start-span.json b/test/fixtures/plugin.filler/fill-radar-boundary-start-span.json new file mode 100644 index 00000000000..2f59ccf1028 --- /dev/null +++ b/test/fixtures/plugin.filler/fill-radar-boundary-start-span.json @@ -0,0 +1,45 @@ +{ + "config": { + "type": "radar", + "data": { + "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], + "datasets": [{ + "backgroundColor": "rgba(0, 0, 255, 0.25)", + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] + }, { + "backgroundColor": "rgba(0, 255, 0, 0.25)", + "data": [6, 2, null, 4, 5, null, null, 2, 1] + }, { + "backgroundColor": "rgba(255, 0, 0, 0.25)", + "data": [7, 3, 4, 5, 6, 1, 4, null, null] + }, { + "backgroundColor": "rgba(0, 0, 255, 0.25)", + "data": [8, 7, 6, -6, -4, -6, 4, 5, 8] + }] + }, + "options": { + "responsive": false, + "spanGaps": true, + "legend": false, + "title": false, + "scale": { + "display": false + }, + "elements": { + "point": { + "radius": 0 + }, + "line": { + "borderColor": "transparent", + "fill": "start" + } + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 256 + } + } +} diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-start-span.png b/test/fixtures/plugin.filler/fill-radar-boundary-start-span.png new file mode 100644 index 00000000000..d97e6919ae6 Binary files /dev/null and b/test/fixtures/plugin.filler/fill-radar-boundary-start-span.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-start.json b/test/fixtures/plugin.filler/fill-radar-boundary-start.json index fcd44ad853a..4171ffe4288 100644 --- a/test/fixtures/plugin.filler/fill-radar-boundary-start.json +++ b/test/fixtures/plugin.filler/fill-radar-boundary-start.json @@ -4,21 +4,22 @@ "data": { "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], "datasets": [{ - "backgroundColor": "rgba(0, 0, 192, 0.25)", - "data": [null, null, 2, 4, 2, 1, -1, 1, 2] + "backgroundColor": "rgba(0, 0, 255, 0.25)", + "data": [null, null, 2, 3, 4, -4, -2, 1, 0] }, { - "backgroundColor": "rgba(0, 192, 0, 0.25)", - "data": [4, 2, null, 3, 2.5, null, -2, 1.5, 3] + "backgroundColor": "rgba(0, 255, 0, 0.25)", + "data": [6, 2, null, 4, 5, null, null, 2, 1] }, { - "backgroundColor": "rgba(192, 0, 0, 0.25)", - "data": [3.5, 2, 1, 2.5, -2, 3, -1, null, null] + "backgroundColor": "rgba(255, 0, 0, 0.25)", + "data": [7, 3, 4, 5, 6, 1, 4, null, null] }, { - "backgroundColor": "rgba(128, 0, 128, 0.25)", - "data": [5, 6, 5, -2, -4, -3, 4, 2, 4.5] + "backgroundColor": "rgba(0, 0, 255, 0.25)", + "data": [8, 7, 6, -6, -4, -6, 4, 5, 8] }] }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-boundary-start.png b/test/fixtures/plugin.filler/fill-radar-boundary-start.png index 82b1f60478d..749913145a1 100644 Binary files a/test/fixtures/plugin.filler/fill-radar-boundary-start.png and b/test/fixtures/plugin.filler/fill-radar-boundary-start.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-dataset-border.json b/test/fixtures/plugin.filler/fill-radar-dataset-border.json index a7f5fb658a7..6881fbb6fd2 100644 --- a/test/fixtures/plugin.filler/fill-radar-dataset-border.json +++ b/test/fixtures/plugin.filler/fill-radar-dataset-border.json @@ -27,7 +27,8 @@ }, "options": { "responsive": false, - "legend": false, + "spanGaps": false, + "legend": false, "title": false, "scale": { "display": false diff --git a/test/fixtures/plugin.filler/fill-radar-dataset-span.json b/test/fixtures/plugin.filler/fill-radar-dataset-span.json new file mode 100644 index 00000000000..537adae21cf --- /dev/null +++ b/test/fixtures/plugin.filler/fill-radar-dataset-span.json @@ -0,0 +1,53 @@ +{ + "config": { + "type": "radar", + "data": { + "labels": ["0", "1", "2", "3", "4", "5", "6", "7", "8"], + "datasets": [{ + "backgroundColor": "rgba(255, 0, 0, 0.25)", + "data": [null, null, 0, -1, 0, 1, 0, -1, 0], + "fill": 1 + }, { + "backgroundColor": "rgba(0, 255, 0, 0.25)", + "data": [1, 0, null, 1, 0, null, -1, 0, 1], + "fill": "+1" + }, { + "backgroundColor": "rgba(0, 0, 255, 0.25)", + "data": [0, 2, 0, -2, 0, 2, 0], + "fill": 3 + }, { + "backgroundColor": "rgba(255, 0, 255, 0.25)", + "data": [2, 0, -2, 0, 2, 0, -2, 0, 2], + "fill": "-2" + }, { + "backgroundColor": "rgba(255, 255, 0, 0.25)", + "data": [3, 1, -1, -3, -1, 1, 3, 1, -1], + "fill": "-1" + }] + }, + "options": { + "responsive": false, + "spanGaps": true, + "legend": false, + "title": false, + "scale": { + "display": false + }, + "elements": { + "point": { + "radius": 0 + }, + "line": { + "borderColor": "transparent", + "tension": 0 + } + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 256 + } + } +} diff --git a/test/fixtures/plugin.filler/fill-radar-dataset-span.png b/test/fixtures/plugin.filler/fill-radar-dataset-span.png new file mode 100644 index 00000000000..48e7e8930be Binary files /dev/null and b/test/fixtures/plugin.filler/fill-radar-dataset-span.png differ diff --git a/test/fixtures/plugin.filler/fill-radar-dataset-spline.json b/test/fixtures/plugin.filler/fill-radar-dataset-spline.json index ecae77e4b83..24bd3423caf 100644 --- a/test/fixtures/plugin.filler/fill-radar-dataset-spline.json +++ b/test/fixtures/plugin.filler/fill-radar-dataset-spline.json @@ -27,6 +27,7 @@ }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": { diff --git a/test/fixtures/plugin.filler/fill-radar-dataset.json b/test/fixtures/plugin.filler/fill-radar-dataset.json index 69a6df80868..f1d68114e01 100644 --- a/test/fixtures/plugin.filler/fill-radar-dataset.json +++ b/test/fixtures/plugin.filler/fill-radar-dataset.json @@ -27,6 +27,7 @@ }, "options": { "responsive": false, + "spanGaps": false, "legend": false, "title": false, "scale": {