]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add tests and a sample for radar scriptable line options (#6263)
authorAkihiko Kusanagi <nagi@nagi-p.com>
Tue, 21 May 2019 22:06:12 +0000 (06:06 +0800)
committerEvert Timberg <evert.timberg@gmail.com>
Tue, 21 May 2019 22:06:12 +0000 (18:06 -0400)
* Add tests and a sample for radar scriptable line options

* Improve image tests

53 files changed:
docs/charts/radar.md
samples/scriptable/radar.html
test/fixtures/controller.radar/backgroundColor/scriptable.js
test/fixtures/controller.radar/backgroundColor/scriptable.png
test/fixtures/controller.radar/backgroundColor/value.js
test/fixtures/controller.radar/backgroundColor/value.png
test/fixtures/controller.radar/borderCapStyle/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/borderCapStyle/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/borderCapStyle/value.js [new file with mode: 0644]
test/fixtures/controller.radar/borderCapStyle/value.png [new file with mode: 0644]
test/fixtures/controller.radar/borderColor/indexable.png [deleted file]
test/fixtures/controller.radar/borderColor/scriptable.js
test/fixtures/controller.radar/borderColor/scriptable.png
test/fixtures/controller.radar/borderColor/value.js
test/fixtures/controller.radar/borderColor/value.png
test/fixtures/controller.radar/borderDash/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/borderDash/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/borderDash/value.js [new file with mode: 0644]
test/fixtures/controller.radar/borderDash/value.png [new file with mode: 0644]
test/fixtures/controller.radar/borderDashOffset/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/borderDashOffset/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/borderDashOffset/value.js [new file with mode: 0644]
test/fixtures/controller.radar/borderDashOffset/value.png [new file with mode: 0644]
test/fixtures/controller.radar/borderJoinStyle/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/borderJoinStyle/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/borderJoinStyle/value.js [new file with mode: 0644]
test/fixtures/controller.radar/borderJoinStyle/value.png [new file with mode: 0644]
test/fixtures/controller.radar/borderWidth/scriptable.js
test/fixtures/controller.radar/borderWidth/scriptable.png
test/fixtures/controller.radar/borderWidth/value.js
test/fixtures/controller.radar/borderWidth/value.png
test/fixtures/controller.radar/fill/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/fill/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/fill/value.js [new file with mode: 0644]
test/fixtures/controller.radar/fill/value.png [new file with mode: 0644]
test/fixtures/controller.radar/pointBackgroundColor/indexable.js [moved from test/fixtures/controller.radar/backgroundColor/indexable.js with 93% similarity]
test/fixtures/controller.radar/pointBackgroundColor/indexable.png [moved from test/fixtures/controller.radar/backgroundColor/indexable.png with 100% similarity]
test/fixtures/controller.radar/pointBackgroundColor/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/pointBackgroundColor/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/pointBackgroundColor/value.js [new file with mode: 0644]
test/fixtures/controller.radar/pointBackgroundColor/value.png [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderColor/indexable.js [moved from test/fixtures/controller.radar/borderColor/indexable.js with 91% similarity]
test/fixtures/controller.radar/pointBorderColor/indexable.png [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderColor/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderColor/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderColor/value.js [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderColor/value.png [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderWidth/indexable.js [moved from test/fixtures/controller.radar/borderWidth/indexable.js with 92% similarity]
test/fixtures/controller.radar/pointBorderWidth/indexable.png [moved from test/fixtures/controller.radar/borderWidth/indexable.png with 100% similarity]
test/fixtures/controller.radar/pointBorderWidth/scriptable.js [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderWidth/scriptable.png [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderWidth/value.js [new file with mode: 0644]
test/fixtures/controller.radar/pointBorderWidth/value.png [new file with mode: 0644]

index 1b1c7ef0714c655099e48800b4d94a0be8dd01c5..717942bd8806f7493bc1659737877a051edf882c 100644 (file)
@@ -66,14 +66,14 @@ The radar chart allows a number of properties to be specified for each dataset.
 
 | Name | Type | [Scriptable](../general/options.md#scriptable-options) | [Indexable](../general/options.md#indexable-options) | Default
 | ---- | ---- | :----: | :----: | ----
-| [`backgroundColor`](#line-styling) | [`Color`](../general/colors.md) | - | - | `'rgba(0, 0, 0, 0.1)'`
-| [`borderCapStyle`](#line-styling) | `string` | - | - | `'butt'`
-| [`borderColor`](#line-styling) | [`Color`](../general/colors.md) | - | - | `'rgba(0, 0, 0, 0.1)'`
-| [`borderDash`](#line-styling) | `number[]` | - | - | `[]`
-| [`borderDashOffset`](#line-styling) | `number` | - | - | `0.0`
-| [`borderJoinStyle`](#line-styling) | `string` | - | - | `'miter'`
-| [`borderWidth`](#line-styling) | `number` | - | - | `3`
-| [`fill`](#line-styling) | <code>boolean&#124;string</code> | - | - | `true`
+| [`backgroundColor`](#line-styling) | [`Color`](../general/colors.md) | Yes | - | `'rgba(0, 0, 0, 0.1)'`
+| [`borderCapStyle`](#line-styling) | `string` | Yes | - | `'butt'`
+| [`borderColor`](#line-styling) | [`Color`](../general/colors.md) | Yes | - | `'rgba(0, 0, 0, 0.1)'`
+| [`borderDash`](#line-styling) | `number[]` | Yes | - | `[]`
+| [`borderDashOffset`](#line-styling) | `number` | Yes | - | `0.0`
+| [`borderJoinStyle`](#line-styling) | `string` | Yes | - | `'miter'`
+| [`borderWidth`](#line-styling) | `number` | Yes | - | `3`
+| [`fill`](#line-styling) | <code>boolean&#124;string</code> | Yes | - | `true`
 | [`label`](#general) | `string` | - | - | `''`
 | [`lineTension`](#line-styling) | `number` | - | - | `0.4`
 | [`pointBackgroundColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
index 8b56c8682453bbdc7cbb4c43e0c4d71051baead6..31b13b0bbdd3f381f63b54d1bd7d61b35ab67d4c 100644 (file)
 
                utils.srand(110);
 
+               function getLineColor(ctx) {
+                       return utils.color(ctx.datasetIndex);
+               }
+
                function alternatePointStyles(ctx) {
                        var index = ctx.dataIndex;
                        return index % 2 === 0 ? 'circle' : 'rect';
                }
 
                function makeHalfAsOpaque(ctx) {
-                       var c = ctx.dataset.backgroundColor;
-                       return utils.transparentize(c);
+                       return utils.transparentize(getLineColor(ctx));
+               }
+
+               function make20PercentOpaque(ctx) {
+                       return utils.transparentize(getLineColor(ctx), 0.8);
                }
 
                function adjustRadiusBasedOnData(ctx) {
@@ -56,9 +63,7 @@
                var data = {
                        labels: [['Eating', 'Dinner'], ['Drinking', 'Water'], 'Sleeping', ['Designing', 'Graphics'], 'Coding', 'Cycling', 'Running'],
                        datasets: [{
-                               data: generateData(),
-                               backgroundColor: Chart.helpers.color('#4dc9f6').alpha(0.2).rgbString(),
-                               borderColor: '#4dc9f6',
+                               data: generateData()
                        }]
                };
 
                        legend: false,
                        tooltips: true,
                        elements: {
+                               line: {
+                                       backgroundColor: make20PercentOpaque,
+                                       borderColor: getLineColor,
+                               },
                                point: {
+                                       backgroundColor: getLineColor,
                                        hoverBackgroundColor: makeHalfAsOpaque,
                                        radius: adjustRadiusBasedOnData,
                                        pointStyle: alternatePointStyles,
 
                // eslint-disable-next-line no-unused-vars
                function addDataset() {
-                       var newColor = utils.color(chart.data.datasets.length);
-
                        chart.data.datasets.push({
-                               data: generateData(),
-                               backgroundColor: Chart.helpers.color(newColor).alpha(0.2).rgbString(),
-                               borderColor: newColor
+                               data: generateData()
                        });
                        chart.update();
                }
index cf2a074e5c7c0e750b051eb2df5b111c570a60c7..4c714a4512086aea1985cfd696d22cfd08681674 100644 (file)
@@ -7,17 +7,16 @@ module.exports = {
                                {
                                        // option in dataset
                                        data: [0, 5, 10, null, -10, -5],
-                                       pointBackgroundColor: function(ctx) {
-                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
-                                               return value > 8 ? '#ff0000'
-                                                       : value > 0 ? '#00ff00'
-                                                       : value > -8 ? '#0000ff'
+                                       backgroundColor: function(ctx) {
+                                               var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+                                               return index === 0 ? '#ff0000'
+                                                       : index === 1 ? '#00ff00'
                                                        : '#ff00ff';
                                        }
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -26,17 +25,16 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
+                                       backgroundColor: function(ctx) {
+                                               var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+                                               return index === 0 ? '#ff0000'
+                                                       : index === 1 ? '#00ff00'
+                                                       : '#ff00ff';
+                                       }
                                },
                                point: {
-                                       backgroundColor: function(ctx) {
-                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
-                                               return value > 8 ? '#ff00ff'
-                                                       : value > 0 ? '#0000ff'
-                                                       : value > -8 ? '#ff0000'
-                                                       : '#00ff00';
-                                       },
-                                       radius: 10,
+                                       backgroundColor: '#0000ff',
+                                       radius: 10
                                }
                        },
                        scale: {
index e82a84f65262bbdc63a89ec34bbdca4731dc11c2..90b4a4d27a157a346b01bd80e9d023f91f162949 100644 (file)
Binary files a/test/fixtures/controller.radar/backgroundColor/scriptable.png and b/test/fixtures/controller.radar/backgroundColor/scriptable.png differ
index 0a592c61595819ab3b68c183c01b4c589dd3bf08..d9347ee5d7341929da6892a7473c7572ad761f95 100644 (file)
@@ -7,11 +7,11 @@ module.exports = {
                                {
                                        // option in dataset
                                        data: [0, 5, 10, null, -10, -5],
-                                       pointBackgroundColor: '#ff0000'
+                                       backgroundColor: '#ff0000'
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -20,11 +20,10 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
+                                       backgroundColor: '#00ff00'
                                },
                                point: {
-                                       backgroundColor: '#00ff00',
-                                       radius: 10,
+                                       radius: 10
                                }
                        },
                        scale: {
index da08c0e442c0a1b55702aa02c57346ceaa5b50f3..de5cec78ddd61b2d03d1b45138483f393d07b957 100644 (file)
Binary files a/test/fixtures/controller.radar/backgroundColor/value.png and b/test/fixtures/controller.radar/backgroundColor/value.png differ
diff --git a/test/fixtures/controller.radar/borderCapStyle/scriptable.js b/test/fixtures/controller.radar/borderCapStyle/scriptable.js
new file mode 100644 (file)
index 0000000..128bf6e
--- /dev/null
@@ -0,0 +1,63 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [null, 3, 3],
+                                       borderCapStyle: function(ctx) {
+                                               var index = (ctx.datasetIndex % 2);
+                                               return index === 0 ? 'round'
+                                                       : index === 1 ? 'square'
+                                                       : 'butt';
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [null, 2, 2]
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [null, 1, 1]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderCapStyle: function(ctx) {
+                                               var index = (ctx.datasetIndex % 3);
+                                               return index === 0 ? 'round'
+                                                       : index === 1 ? 'square'
+                                                       : 'butt';
+                                       },
+                                       borderColor: '#ff0000',
+                                       borderWidth: 32,
+                                       fill: false
+                               },
+                               point: {
+                                       radius: 10
+                               }
+                       },
+                       layout: {
+                               padding: 32
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       beginAtZero: true
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderCapStyle/scriptable.png b/test/fixtures/controller.radar/borderCapStyle/scriptable.png
new file mode 100644 (file)
index 0000000..0be3c62
Binary files /dev/null and b/test/fixtures/controller.radar/borderCapStyle/scriptable.png differ
diff --git a/test/fixtures/controller.radar/borderCapStyle/value.js b/test/fixtures/controller.radar/borderCapStyle/value.js
new file mode 100644 (file)
index 0000000..ad6aa1f
--- /dev/null
@@ -0,0 +1,54 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [null, 3, 3],
+                                       borderCapStyle: 'round'
+                               },
+                               {
+                                       // option in dataset
+                                       data: [null, 2, 2],
+                                       borderCapStyle: 'square'
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [null, 1, 1]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderCapStyle: 'butt',
+                                       borderColor: '#00ff00',
+                                       borderWidth: 32,
+                                       fill: false
+                               },
+                               point: {
+                                       radius: 10
+                               }
+                       },
+                       layout: {
+                               padding: 32
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       beginAtZero: true
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderCapStyle/value.png b/test/fixtures/controller.radar/borderCapStyle/value.png
new file mode 100644 (file)
index 0000000..9e297d6
Binary files /dev/null and b/test/fixtures/controller.radar/borderCapStyle/value.png differ
diff --git a/test/fixtures/controller.radar/borderColor/indexable.png b/test/fixtures/controller.radar/borderColor/indexable.png
deleted file mode 100644 (file)
index e447785..0000000
Binary files a/test/fixtures/controller.radar/borderColor/indexable.png and /dev/null differ
index e0545231a5d3411658c6bb08af7a4e1774cb51e3..e4b59c58086e4110a3579cd5e5756d9747f4c2bf 100644 (file)
@@ -7,12 +7,11 @@ module.exports = {
                                {
                                        // option in dataset
                                        data: [0, 5, 10, null, -10, -5],
-                                       pointBorderColor: function(ctx) {
-                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
-                                               return value > 8 ? '#ff0000'
-                                                       : value > 0 ? '#00ff00'
-                                                       : value > -8 ? '#0000ff'
-                                                       : '#ff00ff';
+                                       borderColor: function(ctx) {
+                                               var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+                                               return index === 0 ? '#ff0000'
+                                                       : index === 1 ? '#00ff00'
+                                                       : '#0000ff';
                                        }
                                },
                                {
@@ -26,17 +25,19 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
-                               },
-                               point: {
                                        borderColor: function(ctx) {
-                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
-                                               return value > 8 ? '#ff00ff'
-                                                       : value > 0 ? '#0000ff'
-                                                       : value > -8 ? '#ff0000'
-                                                       : '#00ff00';
+                                               var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+                                               return index === 0 ? '#ff0000'
+                                                       : index === 1 ? '#00ff00'
+                                                       : '#0000ff';
                                        },
-                                       radius: 10,
+                                       borderWidth: 10,
+                                       fill: false
+                               },
+                               point: {
+                                       borderColor: '#ff0000',
+                                       borderWidth: 10,
+                                       radius: 16
                                }
                        },
                        scale: {
index 4a1c1e7706838a675256a51bd4f63edc0f80a376..58023c1bd939f0e7130dd9d8be64a5e53aa7509c 100644 (file)
Binary files a/test/fixtures/controller.radar/borderColor/scriptable.png and b/test/fixtures/controller.radar/borderColor/scriptable.png differ
index 0ff69e08b871c76128533012d0986d21564ffa62..c70ac64363fd4788410f39c8ce06702aab686b90 100644 (file)
@@ -7,11 +7,11 @@ module.exports = {
                                {
                                        // option in dataset
                                        data: [0, 5, 10, null, -10, -5],
-                                       pointBorderColor: '#ff0000'
+                                       borderColor: '#ff0000'
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -20,11 +20,12 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
+                                       borderColor: '#0000ff',
+                                       fill: false
                                },
                                point: {
-                                       borderColor: '#00ff00',
-                                       radius: 10,
+                                       borderColor: '#0000ff',
+                                       radius: 10
                                }
                        },
                        scale: {
index 486d1009dc5f45fd0f4c081ae72d8c70b2ce409c..9f421eec051f71a330c181a1eade406ff6c1e14e 100644 (file)
Binary files a/test/fixtures/controller.radar/borderColor/value.png and b/test/fixtures/controller.radar/borderColor/value.png differ
diff --git a/test/fixtures/controller.radar/borderDash/scriptable.js b/test/fixtures/controller.radar/borderDash/scriptable.js
new file mode 100644 (file)
index 0000000..0bee9a8
--- /dev/null
@@ -0,0 +1,48 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       borderDash: function(ctx) {
+                                               return ctx.datasetIndex === 0 ? [5] : [10];
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderColor: '#00ff00',
+                                       borderDash: function(ctx) {
+                                               return ctx.datasetIndex === 0 ? [5] : [10];
+                                       }
+                               },
+                               point: {
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderDash/scriptable.png b/test/fixtures/controller.radar/borderDash/scriptable.png
new file mode 100644 (file)
index 0000000..bd48558
Binary files /dev/null and b/test/fixtures/controller.radar/borderDash/scriptable.png differ
diff --git a/test/fixtures/controller.radar/borderDash/value.js b/test/fixtures/controller.radar/borderDash/value.js
new file mode 100644 (file)
index 0000000..a5e7ee8
--- /dev/null
@@ -0,0 +1,46 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       borderColor: '#ff0000',
+                                       borderDash: [5]
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderColor: '#00ff00',
+                                       borderDash: [10],
+                                       fill: false
+                               },
+                               point: {
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderDash/value.png b/test/fixtures/controller.radar/borderDash/value.png
new file mode 100644 (file)
index 0000000..2eef072
Binary files /dev/null and b/test/fixtures/controller.radar/borderDash/value.png differ
diff --git a/test/fixtures/controller.radar/borderDashOffset/scriptable.js b/test/fixtures/controller.radar/borderDashOffset/scriptable.js
new file mode 100644 (file)
index 0000000..90cca36
--- /dev/null
@@ -0,0 +1,55 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [1, 1, 1, 1],
+                                       borderColor: '#ff0000',
+                                       borderDash: [20],
+                                       borderDashOffset: function(ctx) {
+                                               return ctx.datasetIndex === 0 ? 5.0 : 0.0;
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [0, 0, 0, 0]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderColor: '#00ff00',
+                                       borderDash: [20],
+                                       borderDashOffset: function(ctx) {
+                                               return ctx.datasetIndex === 0 ? 5.0 : 0.0;
+                                       },
+                                       fill: false
+                               },
+                               point: {
+                                       radius: 10
+                               }
+                       },
+                       layout: {
+                               padding: 32
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -1
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderDashOffset/scriptable.png b/test/fixtures/controller.radar/borderDashOffset/scriptable.png
new file mode 100644 (file)
index 0000000..28557b2
Binary files /dev/null and b/test/fixtures/controller.radar/borderDashOffset/scriptable.png differ
diff --git a/test/fixtures/controller.radar/borderDashOffset/value.js b/test/fixtures/controller.radar/borderDashOffset/value.js
new file mode 100644 (file)
index 0000000..f96d4cd
--- /dev/null
@@ -0,0 +1,51 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [1, 1, 1, 1, 1, 1],
+                                       borderColor: '#ff0000',
+                                       borderDash: [20],
+                                       borderDashOffset: 5.0
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [0, 0, 0, 0, 0, 0]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderColor: '#00ff00',
+                                       borderDash: [20],
+                                       borderDashOffset: 0.0, // default
+                                       fill: false
+                               },
+                               point: {
+                                       radius: 10
+                               }
+                       },
+                       layout: {
+                               padding: 32
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -1
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderDashOffset/value.png b/test/fixtures/controller.radar/borderDashOffset/value.png
new file mode 100644 (file)
index 0000000..fb9eb72
Binary files /dev/null and b/test/fixtures/controller.radar/borderDashOffset/value.png differ
diff --git a/test/fixtures/controller.radar/borderJoinStyle/scriptable.js b/test/fixtures/controller.radar/borderJoinStyle/scriptable.js
new file mode 100644 (file)
index 0000000..ff33d60
--- /dev/null
@@ -0,0 +1,63 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [3, 3, null, 3],
+                                       borderColor: '#ff0000',
+                                       borderJoinStyle: function(ctx) {
+                                               var index = ctx.datasetIndex % 3;
+                                               return index === 0 ? 'round'
+                                                       : index === 1 ? 'miter'
+                                                       : 'bevel';
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [2, 2, null, 2],
+                                       borderColor: '#0000ff'
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [1, 1, null, 1]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderColor: '#00ff00',
+                                       borderJoinStyle: function(ctx) {
+                                               var index = (ctx.datasetIndex % 3);
+                                               return index === 0 ? 'round'
+                                                       : index === 1 ? 'miter'
+                                                       : 'bevel';
+                                       },
+                                       borderWidth: 25,
+                                       fill: false,
+                                       tension: 0
+                               }
+                       },
+                       layout: {
+                               padding: 32
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       beginAtZero: true
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderJoinStyle/scriptable.png b/test/fixtures/controller.radar/borderJoinStyle/scriptable.png
new file mode 100644 (file)
index 0000000..9b2248b
Binary files /dev/null and b/test/fixtures/controller.radar/borderJoinStyle/scriptable.png differ
diff --git a/test/fixtures/controller.radar/borderJoinStyle/value.js b/test/fixtures/controller.radar/borderJoinStyle/value.js
new file mode 100644 (file)
index 0000000..04a6beb
--- /dev/null
@@ -0,0 +1,54 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [3, 3, null, 3],
+                                       borderColor: '#ff0000',
+                                       borderJoinStyle: 'round'
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [2, 2, null, 2],
+                                       borderColor: '#0000ff',
+                                       borderJoinStyle: 'bevel'
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [1, 1, null, 1]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       borderColor: '#00ff00',
+                                       borderJoinStyle: 'miter',
+                                       borderWidth: 25,
+                                       fill: false,
+                                       tension: 0
+                               }
+                       },
+                       layout: {
+                               padding: 32
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       beginAtZero: true
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/borderJoinStyle/value.png b/test/fixtures/controller.radar/borderJoinStyle/value.png
new file mode 100644 (file)
index 0000000..757d051
Binary files /dev/null and b/test/fixtures/controller.radar/borderJoinStyle/value.png differ
index 8d321b5fcad75e1be25c15e514fc30fe886f4074..d2399d798ccc5f25376209e20612c71b418a62f0 100644 (file)
@@ -7,17 +7,16 @@ module.exports = {
                                {
                                        // option in dataset
                                        data: [0, 5, 10, null, -10, -5],
-                                       pointBorderColor: '#0000ff',
-                                       pointBorderWidth: function(ctx) {
-                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
-                                               return value > 4 ? 10
-                                                       : value > -4 ? 5
-                                                       : 2;
-                                       }
+                                       borderColor: '#0000ff',
+                                       borderWidth: function(ctx) {
+                                               var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+                                               return index % 2 ? 10 : 20;
+                                       },
+                                       pointBorderColor: '#00ff00'
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -26,17 +25,17 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
-                               },
-                               point: {
                                        borderColor: '#ff0000',
                                        borderWidth: function(ctx) {
-                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
-                                               return value > 4 ? 2
-                                                       : value > -4 ? 5
-                                                       : 10;
+                                               var index = (ctx.dataIndex === undefined ? ctx.datasetIndex : ctx.dataIndex);
+                                               return index % 2 ? 10 : 20;
                                        },
-                                       radius: 10,
+                                       fill: false
+                               },
+                               point: {
+                                       borderColor: '#00ff00',
+                                       borderWidth: 5,
+                                       radius: 10
                                }
                        },
                        scale: {
index 16bbfa5613e04498fce95bb959d79dea79e07707..de84a830b56f6c633299944c013608af69b1c670 100644 (file)
Binary files a/test/fixtures/controller.radar/borderWidth/scriptable.png and b/test/fixtures/controller.radar/borderWidth/scriptable.png differ
index 8c59eccfd2ab2eb0c9e02ee36a3a849ca2f2f5a8..521cbf076c8c346aa228e15106ad313249e6425e 100644 (file)
@@ -7,12 +7,12 @@ module.exports = {
                                {
                                        // option in dataset
                                        data: [0, 5, 10, null, -10, -5],
-                                       pointBorderColor: '#0000ff',
-                                       pointBorderWidth: 6
+                                       borderColor: '#0000ff',
+                                       borderWidth: 6
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -21,12 +21,12 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
-                               },
-                               point: {
                                        borderColor: '#00ff00',
                                        borderWidth: 3,
-                                       radius: 10,
+                                       fill: false
+                               },
+                               point: {
+                                       radius: 10
                                }
                        },
                        scale: {
index 870b2a9431c46c8fe16783b4b02c972dbbbb3f70..3254d2f2334e282058a7cd80be6acdcd84cbd72d 100644 (file)
Binary files a/test/fixtures/controller.radar/borderWidth/value.png and b/test/fixtures/controller.radar/borderWidth/value.png differ
diff --git a/test/fixtures/controller.radar/fill/scriptable.js b/test/fixtures/controller.radar/fill/scriptable.js
new file mode 100644 (file)
index 0000000..3706bbf
--- /dev/null
@@ -0,0 +1,46 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       backgroundColor: '#ff0000',
+                                       fill: function(ctx) {
+                                               return ctx.datasetIndex === 0 ? true : false;
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       backgroundColor: '#00ff00',
+                                       fill: function(ctx) {
+                                               return ctx.datasetIndex === 0 ? true : false;
+                                       }
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/fill/scriptable.png b/test/fixtures/controller.radar/fill/scriptable.png
new file mode 100644 (file)
index 0000000..c0a0d5c
Binary files /dev/null and b/test/fixtures/controller.radar/fill/scriptable.png differ
diff --git a/test/fixtures/controller.radar/fill/value.js b/test/fixtures/controller.radar/fill/value.js
new file mode 100644 (file)
index 0000000..4db74da
--- /dev/null
@@ -0,0 +1,42 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       backgroundColor: '#ff0000',
+                                       fill: false
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       backgroundColor: '#00ff00',
+                                       fill: true
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/fill/value.png b/test/fixtures/controller.radar/fill/value.png
new file mode 100644 (file)
index 0000000..daae593
Binary files /dev/null and b/test/fixtures/controller.radar/fill/value.png differ
similarity index 93%
rename from test/fixtures/controller.radar/backgroundColor/indexable.js
rename to test/fixtures/controller.radar/pointBackgroundColor/indexable.js
index cd59ce44a13f2174b4657957830f505d5988eef1..10148e65e020ce31d1b0c624cc07e328e2b1bb31 100644 (file)
@@ -18,7 +18,7 @@ module.exports = {
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -27,7 +27,7 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
+                                       fill: false
                                },
                                point: {
                                        backgroundColor: [
diff --git a/test/fixtures/controller.radar/pointBackgroundColor/scriptable.js b/test/fixtures/controller.radar/pointBackgroundColor/scriptable.js
new file mode 100644 (file)
index 0000000..07e1b12
--- /dev/null
@@ -0,0 +1,56 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       pointBackgroundColor: function(ctx) {
+                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
+                                               return value > 8 ? '#ff0000'
+                                                       : value > 0 ? '#00ff00'
+                                                       : value > -8 ? '#0000ff'
+                                                       : '#ff00ff';
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       fill: false
+                               },
+                               point: {
+                                       backgroundColor: function(ctx) {
+                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
+                                               return value > 8 ? '#ff00ff'
+                                                       : value > 0 ? '#0000ff'
+                                                       : value > -8 ? '#ff0000'
+                                                       : '#00ff00';
+                                       },
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/pointBackgroundColor/scriptable.png b/test/fixtures/controller.radar/pointBackgroundColor/scriptable.png
new file mode 100644 (file)
index 0000000..56c78b6
Binary files /dev/null and b/test/fixtures/controller.radar/pointBackgroundColor/scriptable.png differ
diff --git a/test/fixtures/controller.radar/pointBackgroundColor/value.js b/test/fixtures/controller.radar/pointBackgroundColor/value.js
new file mode 100644 (file)
index 0000000..20af577
--- /dev/null
@@ -0,0 +1,44 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       pointBackgroundColor: '#ff0000'
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       fill: false
+                               },
+                               point: {
+                                       backgroundColor: '#00ff00',
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/pointBackgroundColor/value.png b/test/fixtures/controller.radar/pointBackgroundColor/value.png
new file mode 100644 (file)
index 0000000..0f68142
Binary files /dev/null and b/test/fixtures/controller.radar/pointBackgroundColor/value.png differ
similarity index 91%
rename from test/fixtures/controller.radar/borderColor/indexable.js
rename to test/fixtures/controller.radar/pointBorderColor/indexable.js
index 11297f2dbfc421fcf41948a2accefbcfaadd2ad5..f7e0626d65b2ac34eeaafbd05e24df4179f58e51 100644 (file)
@@ -18,7 +18,7 @@ module.exports = {
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -27,7 +27,7 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
+                                       fill: false
                                },
                                point: {
                                        borderColor: [
@@ -38,6 +38,7 @@ module.exports = {
                                                '#8800ff',
                                                '#ffff88'
                                        ],
+                                       borderWidth: 5,
                                        radius: 10
                                }
                        },
diff --git a/test/fixtures/controller.radar/pointBorderColor/indexable.png b/test/fixtures/controller.radar/pointBorderColor/indexable.png
new file mode 100644 (file)
index 0000000..309cb1c
Binary files /dev/null and b/test/fixtures/controller.radar/pointBorderColor/indexable.png differ
diff --git a/test/fixtures/controller.radar/pointBorderColor/scriptable.js b/test/fixtures/controller.radar/pointBorderColor/scriptable.js
new file mode 100644 (file)
index 0000000..d9678c3
--- /dev/null
@@ -0,0 +1,57 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       pointBorderColor: function(ctx) {
+                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
+                                               return value > 8 ? '#ff0000'
+                                                       : value > 0 ? '#00ff00'
+                                                       : value > -8 ? '#0000ff'
+                                                       : '#ff00ff';
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       fill: false
+                               },
+                               point: {
+                                       borderColor: function(ctx) {
+                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
+                                               return value > 8 ? '#ff00ff'
+                                                       : value > 0 ? '#0000ff'
+                                                       : value > -8 ? '#ff0000'
+                                                       : '#00ff00';
+                                       },
+                                       borderWidth: 5,
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/pointBorderColor/scriptable.png b/test/fixtures/controller.radar/pointBorderColor/scriptable.png
new file mode 100644 (file)
index 0000000..de47d1b
Binary files /dev/null and b/test/fixtures/controller.radar/pointBorderColor/scriptable.png differ
diff --git a/test/fixtures/controller.radar/pointBorderColor/value.js b/test/fixtures/controller.radar/pointBorderColor/value.js
new file mode 100644 (file)
index 0000000..d639e28
--- /dev/null
@@ -0,0 +1,45 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       pointBorderColor: '#ff0000'
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       fill: false
+                               },
+                               point: {
+                                       borderColor: '#00ff00',
+                                       borderWidth: 5,
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/pointBorderColor/value.png b/test/fixtures/controller.radar/pointBorderColor/value.png
new file mode 100644 (file)
index 0000000..537e49f
Binary files /dev/null and b/test/fixtures/controller.radar/pointBorderColor/value.png differ
similarity index 92%
rename from test/fixtures/controller.radar/borderWidth/indexable.js
rename to test/fixtures/controller.radar/pointBorderWidth/indexable.js
index 262d9d56d87cd49c388d486756e3493cd867aede..1e60832e64611451d5c684b334bfe92d2d84ee15 100644 (file)
@@ -14,7 +14,7 @@ module.exports = {
                                },
                                {
                                        // option in element (fallback)
-                                       data: [4, -5, -10, null, 10, 5],
+                                       data: [4, -5, -10, null, 10, 5]
                                }
                        ]
                },
@@ -23,7 +23,7 @@ module.exports = {
                        title: false,
                        elements: {
                                line: {
-                                       fill: false,
+                                       fill: false
                                },
                                point: {
                                        borderColor: '#ff0000',
diff --git a/test/fixtures/controller.radar/pointBorderWidth/scriptable.js b/test/fixtures/controller.radar/pointBorderWidth/scriptable.js
new file mode 100644 (file)
index 0000000..94ea514
--- /dev/null
@@ -0,0 +1,56 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       pointBorderColor: '#0000ff',
+                                       pointBorderWidth: function(ctx) {
+                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
+                                               return value > 4 ? 10
+                                                       : value > -4 ? 5
+                                                       : 2;
+                                       }
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       fill: false
+                               },
+                               point: {
+                                       borderColor: '#ff0000',
+                                       borderWidth: function(ctx) {
+                                               var value = ctx.dataset.data[ctx.dataIndex] || 0;
+                                               return value > 4 ? 2
+                                                       : value > -4 ? 5
+                                                       : 10;
+                                       },
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/pointBorderWidth/scriptable.png b/test/fixtures/controller.radar/pointBorderWidth/scriptable.png
new file mode 100644 (file)
index 0000000..90112da
Binary files /dev/null and b/test/fixtures/controller.radar/pointBorderWidth/scriptable.png differ
diff --git a/test/fixtures/controller.radar/pointBorderWidth/value.js b/test/fixtures/controller.radar/pointBorderWidth/value.js
new file mode 100644 (file)
index 0000000..b486ea9
--- /dev/null
@@ -0,0 +1,46 @@
+module.exports = {
+       config: {
+               type: 'radar',
+               data: {
+                       labels: [0, 1, 2, 3, 4, 5],
+                       datasets: [
+                               {
+                                       // option in dataset
+                                       data: [0, 5, 10, null, -10, -5],
+                                       pointBorderColor: '#0000ff',
+                                       pointBorderWidth: 6
+                               },
+                               {
+                                       // option in element (fallback)
+                                       data: [4, -5, -10, null, 10, 5]
+                               }
+                       ]
+               },
+               options: {
+                       legend: false,
+                       title: false,
+                       elements: {
+                               line: {
+                                       fill: false
+                               },
+                               point: {
+                                       borderColor: '#00ff00',
+                                       borderWidth: 3,
+                                       radius: 10
+                               }
+                       },
+                       scale: {
+                               display: false,
+                               ticks: {
+                                       min: -15
+                               }
+                       }
+               }
+       },
+       options: {
+               canvas: {
+                       height: 512,
+                       width: 512
+               }
+       }
+};
diff --git a/test/fixtures/controller.radar/pointBorderWidth/value.png b/test/fixtures/controller.radar/pointBorderWidth/value.png
new file mode 100644 (file)
index 0000000..ad9106d
Binary files /dev/null and b/test/fixtures/controller.radar/pointBorderWidth/value.png differ