]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add test for normalized option (#8552)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Mon, 1 Mar 2021 20:27:36 +0000 (12:27 -0800)
committerGitHub <noreply@github.com>
Mon, 1 Mar 2021 20:27:36 +0000 (15:27 -0500)
test/fixtures/scale.timeseries/normalize.js [new file with mode: 0644]
test/fixtures/scale.timeseries/normalize.png [new file with mode: 0644]

diff --git a/test/fixtures/scale.timeseries/normalize.js b/test/fixtures/scale.timeseries/normalize.js
new file mode 100644 (file)
index 0000000..fe850b8
--- /dev/null
@@ -0,0 +1,39 @@
+module.exports = {
+  threshold: 0.01,
+  config: {
+    type: 'line',
+    data: {
+      datasets: [{
+        data: [
+          {x: '2017', y: null},
+          {x: '2018', y: 1},
+          {x: '2019', y: 2},
+          {x: '2020', y: 3},
+          {x: '2021', y: 4}
+        ],
+        fill: false
+      }]
+    },
+    options: {
+      normalized: true,
+      scales: {
+        x: {
+          type: 'timeseries',
+          time: {
+            parser: 'YYYY'
+          },
+          distribution: 'linear',
+          ticks: {
+            source: 'data'
+          }
+        },
+        y: {
+          display: false
+        }
+      }
+    }
+  },
+  options: {
+    spriteText: true
+  }
+};
diff --git a/test/fixtures/scale.timeseries/normalize.png b/test/fixtures/scale.timeseries/normalize.png
new file mode 100644 (file)
index 0000000..2207779
Binary files /dev/null and b/test/fixtures/scale.timeseries/normalize.png differ