diff --git a/.codeclimate.yml b/.codeclimate.yml
index 4377f06ea28..b7f9662a17e 100644
--- a/.codeclimate.yml
+++ b/.codeclimate.yml
@@ -14,7 +14,6 @@ checks:
exclude_patterns:
- "dist/"
- "docs/"
- - "samples/"
- "scripts/"
- "test/"
- "*.js"
diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml
index 4b51460834c..4ae501c2c7a 100644
--- a/.github/release-drafter.yml
+++ b/.github/release-drafter.yml
@@ -46,7 +46,7 @@ template: |
* [Migration guide](https://www.chartjs.org/docs/next/getting-started/v3-migration)
* [Docs](https://www.chartjs.org/docs/next/)
* [API](https://www.chartjs.org/docs/next/api/)
- * [Samples](https://www.chartjs.org/samples/next/)
+ * [Samples](https://www.chartjs.org/docs/next/samples/)
$CHANGES
diff --git a/package.json b/package.json
index 9dee681f372..ad530420915 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,7 @@
"dev:ff": "karma start --auto-watch --no-single-run --browsers firefox --grep",
"docs": "npm run build && vuepress build docs --no-cache",
"docs:dev": "npm run build && vuepress dev docs --no-cache",
- "lint-js": "eslint \"samples/**/*.html\" \"samples/**/*.js\" \"src/**/*.js\" \"test/**/*.js\"",
+ "lint-js": "eslint \"src/**/*.js\" \"test/**/*.js\" \"docs/**/*.js\"",
"lint-md": "eslint \"**/*.md\"",
"lint-tsc": "tsc",
"lint-types": "eslint \"types/**/*.ts\" && tsc -p types/tests/",
diff --git a/samples/.eslintrc.yml b/samples/.eslintrc.yml
deleted file mode 100644
index 618932b79af..00000000000
--- a/samples/.eslintrc.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-globals:
- $: true
- Chart: true
- Samples: true
- moment: true
- luxon: true
- randomScalingFactor: true
-
-rules:
- indent: ["error", "tab", {flatTernaryExpressions: true}]
- no-new: "off"
diff --git a/samples/advanced/derived-axis-type.html b/samples/advanced/derived-axis-type.html
deleted file mode 100644
index e53a2be25b9..00000000000
--- a/samples/advanced/derived-axis-type.html
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
-
- Logarithmic Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/advanced/derived-chart-type.html b/samples/advanced/derived-chart-type.html
deleted file mode 100644
index 9f6cb205b23..00000000000
--- a/samples/advanced/derived-chart-type.html
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
- Derived Chart Type
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/advanced/line-gradient.html b/samples/advanced/line-gradient.html
deleted file mode 100644
index 6cbcb368307..00000000000
--- a/samples/advanced/line-gradient.html
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-Linear Gradient
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/advanced/programmatic-events.html b/samples/advanced/programmatic-events.html
deleted file mode 100644
index d6b1dc22a91..00000000000
--- a/samples/advanced/programmatic-events.html
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
- Programmatic Event Triggers
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/advanced/progress-bar.html b/samples/advanced/progress-bar.html
deleted file mode 100644
index 905d0466125..00000000000
--- a/samples/advanced/progress-bar.html
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
- Animation Callbacks
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/advanced/radial-gradient.html b/samples/advanced/radial-gradient.html
deleted file mode 100644
index 72039d52bed..00000000000
--- a/samples/advanced/radial-gradient.html
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-Radial Gradient
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/animations/delay.html b/samples/animations/delay.html
deleted file mode 100644
index aa81bd73bb7..00000000000
--- a/samples/animations/delay.html
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
- Stacked Bar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/animations/drop.html b/samples/animations/drop.html
deleted file mode 100644
index 5fe656d97a9..00000000000
--- a/samples/animations/drop.html
+++ /dev/null
@@ -1,185 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/animations/loop.html b/samples/animations/loop.html
deleted file mode 100644
index 8568f0c5a1e..00000000000
--- a/samples/animations/loop.html
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/area/analyser.js b/samples/charts/area/analyser.js
deleted file mode 100644
index 3b2e371070f..00000000000
--- a/samples/charts/area/analyser.js
+++ /dev/null
@@ -1,64 +0,0 @@
-'use strict';
-
-(function() {
- Chart.register({
- id: 'samples-filler-analyser',
-
- beforeInit: function(chart, options) {
- this.element = document.getElementById(options.target);
- },
-
- afterUpdate: function(chart) {
- var datasets = chart.data.datasets;
- var element = this.element;
- var stats = [];
- var meta, i, ilen, dataset;
-
- if (!element) {
- return;
- }
-
- for (i = 0, ilen = datasets.length; i < ilen; ++i) {
- meta = chart.getDatasetMeta(i).$filler;
- if (meta) {
- dataset = datasets[i];
- stats.push({
- fill: dataset.fill,
- target: meta.fill,
- visible: meta.visible,
- index: i
- });
- }
- }
-
- this.element.innerHTML = '' +
- '' +
- 'Dataset | ' +
- 'Fill | ' +
- 'Target (visibility) | ' +
- '
' +
- stats.map(function(stat) {
- var target = stat.target;
- var row =
- '' + stat.index + ' | ' +
- '' + JSON.stringify(stat.fill) + ' | ';
-
- if (target === false) {
- target = 'none';
- } else if (typeof target !== 'object' && isFinite(target)) {
- target = 'dataset ' + target;
- } else {
- target = 'boundary "' + (typeof target === 'object' ? JSON.stringify(target) : target) + '"';
- }
-
- if (stat.visible) {
- row += '' + target + ' | ';
- } else {
- row += '(hidden) | ';
- }
-
- return '' + row + '
';
- }).join('') + '
';
- }
- });
-}());
diff --git a/samples/charts/area/line-boundaries.html b/samples/charts/area/line-boundaries.html
deleted file mode 100644
index 0dd98a28f9c..00000000000
--- a/samples/charts/area/line-boundaries.html
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
- area > boundaries | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/area/line-datasets.html b/samples/charts/area/line-datasets.html
deleted file mode 100644
index 1d1d2706e07..00000000000
--- a/samples/charts/area/line-datasets.html
+++ /dev/null
@@ -1,166 +0,0 @@
-
-
-
-
-
-
- area > datasets | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/area/line-stacked.html b/samples/charts/area/line-stacked.html
deleted file mode 100644
index eaee5f0a459..00000000000
--- a/samples/charts/area/line-stacked.html
+++ /dev/null
@@ -1,201 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/area/radar.html b/samples/charts/area/radar.html
deleted file mode 100644
index 3c36d670f52..00000000000
--- a/samples/charts/area/radar.html
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
-
-
- area > radar | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bar/border-radius.html b/samples/charts/bar/border-radius.html
deleted file mode 100644
index e0f03edc349..00000000000
--- a/samples/charts/bar/border-radius.html
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
- Bar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bar/float.html b/samples/charts/bar/float.html
deleted file mode 100644
index 345f085c896..00000000000
--- a/samples/charts/bar/float.html
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
- Bar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bar/horizontal.html b/samples/charts/bar/horizontal.html
deleted file mode 100644
index 816cf2d3a67..00000000000
--- a/samples/charts/bar/horizontal.html
+++ /dev/null
@@ -1,152 +0,0 @@
-
-
-
-
- Horizontal Bar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bar/multi-axis.html b/samples/charts/bar/multi-axis.html
deleted file mode 100644
index 30672f5c8c5..00000000000
--- a/samples/charts/bar/multi-axis.html
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
- Bar Chart Multi Axis
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bar/stacked-group.html b/samples/charts/bar/stacked-group.html
deleted file mode 100644
index 8d66ed24ac7..00000000000
--- a/samples/charts/bar/stacked-group.html
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
- Stacked Bar Chart with Groups
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bar/stacked.html b/samples/charts/bar/stacked.html
deleted file mode 100644
index f78eb1f84fb..00000000000
--- a/samples/charts/bar/stacked.html
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
- Stacked Bar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bar/vertical.html b/samples/charts/bar/vertical.html
deleted file mode 100644
index 337a0437050..00000000000
--- a/samples/charts/bar/vertical.html
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
- Bar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/bubble.html b/samples/charts/bubble.html
deleted file mode 100644
index 26ec14c1186..00000000000
--- a/samples/charts/bubble.html
+++ /dev/null
@@ -1,190 +0,0 @@
-
-
-
-
- Bubble Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/combo-bar-line.html b/samples/charts/combo-bar-line.html
deleted file mode 100644
index c35e807fafa..00000000000
--- a/samples/charts/combo-bar-line.html
+++ /dev/null
@@ -1,103 +0,0 @@
-
-
-
-
- Combo Bar-Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/doughnut.html b/samples/charts/doughnut.html
deleted file mode 100644
index 358213bc4b0..00000000000
--- a/samples/charts/doughnut.html
+++ /dev/null
@@ -1,159 +0,0 @@
-
-
-
-
- Doughnut Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/basic.html b/samples/charts/line/basic.html
deleted file mode 100644
index e832bf43e1c..00000000000
--- a/samples/charts/line/basic.html
+++ /dev/null
@@ -1,165 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/interpolation-modes.html b/samples/charts/line/interpolation-modes.html
deleted file mode 100644
index a305983be53..00000000000
--- a/samples/charts/line/interpolation-modes.html
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
- Line Chart - Cubic interpolation mode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/line-styles.html b/samples/charts/line/line-styles.html
deleted file mode 100644
index 5ce58e94fa3..00000000000
--- a/samples/charts/line/line-styles.html
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
- Line Styles
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/multi-axis.html b/samples/charts/line/multi-axis.html
deleted file mode 100644
index 66c12e8d625..00000000000
--- a/samples/charts/line/multi-axis.html
+++ /dev/null
@@ -1,108 +0,0 @@
-
-
-
-
- Line Chart Multiple Axes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/point-sizes.html b/samples/charts/line/point-sizes.html
deleted file mode 100644
index 2290c6b105e..00000000000
--- a/samples/charts/line/point-sizes.html
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
- Different Point Sizes
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/point-styles.html b/samples/charts/line/point-styles.html
deleted file mode 100644
index b4303b9373f..00000000000
--- a/samples/charts/line/point-styles.html
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/skip-points.html b/samples/charts/line/skip-points.html
deleted file mode 100644
index 4ccaec546d4..00000000000
--- a/samples/charts/line/skip-points.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/line/stepped.html b/samples/charts/line/stepped.html
deleted file mode 100644
index e2b10419364..00000000000
--- a/samples/charts/line/stepped.html
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
- Stepped Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/multi-series-pie.html b/samples/charts/multi-series-pie.html
deleted file mode 100644
index 13adb98f18f..00000000000
--- a/samples/charts/multi-series-pie.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
- Multi Series Pie Chart
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/pie.html b/samples/charts/pie.html
deleted file mode 100644
index 9b3b3b8bf35..00000000000
--- a/samples/charts/pie.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
- Pie Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/polar-area.html b/samples/charts/polar-area.html
deleted file mode 100644
index b5d70660db0..00000000000
--- a/samples/charts/polar-area.html
+++ /dev/null
@@ -1,122 +0,0 @@
-
-
-
-
- Polar Area Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/radar-skip-points.html b/samples/charts/radar-skip-points.html
deleted file mode 100644
index 320c380115f..00000000000
--- a/samples/charts/radar-skip-points.html
+++ /dev/null
@@ -1,113 +0,0 @@
-
-
-
-
- Radar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/radar.html b/samples/charts/radar.html
deleted file mode 100644
index f24338a7f6e..00000000000
--- a/samples/charts/radar.html
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
-
- Radar Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/scatter/basic.html b/samples/charts/scatter/basic.html
deleted file mode 100644
index bff1f886271..00000000000
--- a/samples/charts/scatter/basic.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
- Scatter Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/charts/scatter/multi-axis.html b/samples/charts/scatter/multi-axis.html
deleted file mode 100644
index 63a031a61e4..00000000000
--- a/samples/charts/scatter/multi-axis.html
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
- Scatter Chart Multi Axis
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/favicon.ico b/samples/favicon.ico
deleted file mode 100644
index 5192a328567..00000000000
Binary files a/samples/favicon.ico and /dev/null differ
diff --git a/samples/index.html b/samples/index.html
deleted file mode 100644
index bf6ef7bba7e..00000000000
--- a/samples/index.html
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- Chart.js samples
-
-
-
-
-
-
-
diff --git a/samples/legend/callbacks.html b/samples/legend/callbacks.html
deleted file mode 100644
index 0573ea3eb51..00000000000
--- a/samples/legend/callbacks.html
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
- Legend Callbacks
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/legend/point-style.html b/samples/legend/point-style.html
deleted file mode 100644
index eac849a1cdf..00000000000
--- a/samples/legend/point-style.html
+++ /dev/null
@@ -1,118 +0,0 @@
-
-
-
-
- Legend Point Style
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/legend/positioning.html b/samples/legend/positioning.html
deleted file mode 100644
index c55e57c0a1e..00000000000
--- a/samples/legend/positioning.html
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
- Legend Positions
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/legend/title.html b/samples/legend/title.html
deleted file mode 100644
index 540e8350600..00000000000
--- a/samples/legend/title.html
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
-
- Legend Title Positions
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/logo.svg b/samples/logo.svg
deleted file mode 100644
index 24f5a2bf0ed..00000000000
--- a/samples/logo.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/samples/samples.js b/samples/samples.js
deleted file mode 100644
index 4f3671dd8ec..00000000000
--- a/samples/samples.js
+++ /dev/null
@@ -1,280 +0,0 @@
-(function(global) {
-
- var Samples = global.Samples || (global.Samples = {});
-
- Samples.items = [{
- title: 'Bar charts',
- items: [{
- title: 'Vertical',
- path: 'charts/bar/vertical.html'
- }, {
- title: 'Horizontal',
- path: 'charts/bar/horizontal.html'
- }, {
- title: 'Multi axis',
- path: 'charts/bar/multi-axis.html'
- }, {
- title: 'Stacked',
- path: 'charts/bar/stacked.html'
- }, {
- title: 'Stacked groups',
- path: 'charts/bar/stacked-group.html'
- }, {
- title: 'Floating',
- path: 'charts/bar/float.html'
- }, {
- title: 'Border Radius',
- path: 'charts/bar/border-radius.html'
- }]
- }, {
- title: 'Line charts',
- items: [{
- title: 'Basic',
- path: 'charts/line/basic.html'
- }, {
- title: 'Multi axis',
- path: 'charts/line/multi-axis.html'
- }, {
- title: 'Stepped',
- path: 'charts/line/stepped.html'
- }, {
- title: 'Interpolation',
- path: 'charts/line/interpolation-modes.html'
- }, {
- title: 'Line styles',
- path: 'charts/line/line-styles.html'
- }, {
- title: 'Point styles',
- path: 'charts/line/point-styles.html'
- }, {
- title: 'Point sizes',
- path: 'charts/line/point-sizes.html'
- }]
- }, {
- title: 'Area charts',
- items: [{
- title: 'Boundaries (line)',
- path: 'charts/area/line-boundaries.html'
- }, {
- title: 'Datasets (line)',
- path: 'charts/area/line-datasets.html'
- }, {
- title: 'Stacked (line)',
- path: 'charts/area/line-stacked.html'
- }, {
- title: 'Radar',
- path: 'charts/area/radar.html'
- }]
- }, {
- title: 'Other charts',
- items: [{
- title: 'Bubble',
- path: 'charts/bubble.html'
- }, {
- title: 'Scatter',
- path: 'charts/scatter/basic.html'
- }, {
- title: 'Scatter - Multi axis',
- path: 'charts/scatter/multi-axis.html'
- }, {
- title: 'Doughnut',
- path: 'charts/doughnut.html'
- }, {
- title: 'Pie',
- path: 'charts/pie.html'
- }, {
- title: 'Multi Series Pie',
- path: 'charts/multi-series-pie.html'
- }, {
- title: 'Polar area',
- path: 'charts/polar-area.html'
- }, {
- title: 'Radar',
- path: 'charts/radar.html'
- }, {
- title: 'Radar skip points',
- path: 'charts/radar-skip-points.html'
- }, {
- title: 'Combo bar/line',
- path: 'charts/combo-bar-line.html'
- }]
- }, {
- title: 'Linear scale',
- items: [{
- title: 'Step size',
- path: 'scales/linear/step-size.html'
- }, {
- title: 'Min & max',
- path: 'scales/linear/min-max.html'
- }, {
- title: 'Min & max (suggested)',
- path: 'scales/linear/min-max-suggested.html'
- }]
- }, {
- title: 'Logarithmic scale',
- items: [{
- title: 'Line',
- path: 'scales/logarithmic/line.html'
- }, {
- title: 'Scatter',
- path: 'scales/logarithmic/scatter.html'
- }]
- }, {
- title: 'Time scale',
- items: [{
- title: 'Line',
- path: 'scales/time/line.html'
- }, {
- title: 'Line (point data)',
- path: 'scales/time/line-point-data.html'
- }, {
- title: 'Line (break on 2 day gap)',
- path: 'scales/time/line-max-span.html'
- }, {
- title: 'Combo',
- path: 'scales/time/combo.html'
- }]
- }, {
- title: 'Scale options',
- items: [{
- title: 'Grid lines display',
- path: 'scales/gridlines-display.html'
- }, {
- title: 'Grid lines style',
- path: 'scales/gridlines-style.html'
- }, {
- title: 'Scriptable Grid lines',
- path: 'scales/gridlines-scriptable.html'
- }, {
- title: 'Multiline labels',
- path: 'scales/multiline-labels.html'
- }, {
- title: 'Filtering Labels',
- path: 'scales/filtering-labels.html'
- }, {
- title: 'Label Text Alignment',
- path: 'scales/label-text-alignment.html'
- }, {
- title: 'Non numeric Y Axis',
- path: 'scales/non-numeric-y.html'
- }, {
- title: 'Toggle Scale Type',
- path: 'scales/toggle-scale-type.html'
- }, {
- title: 'Axes Labels',
- path: 'scales/axes-labels.html'
- }, {
- title: 'Center Positioning',
- path: 'scales/axis-center-position.html'
- }, {
- title: 'Custom major ticks',
- path: 'scales/financial.html'
- }]
- }, {
- title: 'Legend',
- items: [{
- title: 'Positioning',
- path: 'legend/positioning.html'
- }, {
- title: 'Legend Title',
- path: 'legend/title.html'
- }, {
- title: 'Point style',
- path: 'legend/point-style.html'
- }, {
- title: 'Callbacks',
- path: 'legend/callbacks.html'
- }]
- }, {
- title: 'Title',
- items: [{
- title: 'Alignment',
- path: 'title/alignment.html'
- }]
- }, {
- title: 'Tooltip',
- items: [{
- title: 'Positioning',
- path: 'tooltips/positioning.html'
- }, {
- title: 'Custom Positioning',
- path: 'tooltips/positioning-custom.html'
- }, {
- title: 'Interactions',
- path: 'tooltips/interactions.html'
- }, {
- title: 'Callbacks',
- path: 'tooltips/callbacks.html'
- }, {
- title: 'Border',
- path: 'tooltips/border.html'
- }, {
- title: 'Point style',
- path: 'tooltips/point-style.html'
- }, {
- title: 'HTML tooltips (line)',
- path: 'tooltips/custom-line.html'
- }, {
- title: 'HTML tooltips (pie)',
- path: 'tooltips/custom-pie.html'
- }, {
- title: 'HTML tooltips (points)',
- path: 'tooltips/custom-points.html'
- }]
- }, {
- title: 'Scriptable',
- items: [{
- title: 'Bar Chart',
- path: 'scriptable/bar.html'
- }, {
- title: 'Bubble Chart',
- path: 'scriptable/bubble.html'
- }, {
- title: 'Pie Chart',
- path: 'scriptable/pie.html'
- }, {
- title: 'Line Chart',
- path: 'scriptable/line.html'
- }, {
- title: 'Polar Area Chart',
- path: 'scriptable/polar.html'
- }, {
- title: 'Radar Chart',
- path: 'scriptable/radar.html'
- }]
- }, {
- title: 'Animations',
- items: [{
- title: 'Delay',
- path: 'animations/delay.html'
- }, {
- title: 'Drop',
- path: 'animations/drop.html'
- }, {
- title: 'Loop',
- path: 'animations/loop.html'
- }]
- }, {
- title: 'Advanced',
- items: [{
- title: 'Progress bar',
- path: 'advanced/progress-bar.html'
- }, {
- title: 'Polar Area Radial Gradient',
- path: 'advanced/radial-gradient.html'
- }, {
- title: 'Line Gradient',
- path: 'advanced/line-gradient.html'
- }, {
- title: 'Programmatic Event Triggers',
- path: 'advanced/programmatic-events.html'
- }, {
- title: 'Derived Chart Type',
- path: 'advanced/derived-chart-type.html'
- }, {
- title: 'Derived Axis Type',
- path: 'advanced/derived-axis-type.html'
- }]
- }];
-
-}(this));
diff --git a/samples/scales/axes-labels.html b/samples/scales/axes-labels.html
deleted file mode 100644
index 4f97f6ec414..00000000000
--- a/samples/scales/axes-labels.html
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/axis-center-position.html b/samples/scales/axis-center-position.html
deleted file mode 100644
index dca9cdc33f5..00000000000
--- a/samples/scales/axis-center-position.html
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
- Scatter Chart
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/filtering-labels.html b/samples/scales/filtering-labels.html
deleted file mode 100644
index 66b14403dd5..00000000000
--- a/samples/scales/filtering-labels.html
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
- Chart with xAxis Filtering
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/financial.html b/samples/scales/financial.html
deleted file mode 100644
index 20a6a43717e..00000000000
--- a/samples/scales/financial.html
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
This example demonstrates a time series scale with custom logic for generating minor and major ticks. Major ticks are bolded
-
For more specific functionality for financial charts, please see chartjs-chart-financial
-
-
-
-
- Chart Type:
-
-
-
-
-
-
-
diff --git a/samples/scales/gridlines-display.html b/samples/scales/gridlines-display.html
deleted file mode 100644
index 83bec9305a8..00000000000
--- a/samples/scales/gridlines-display.html
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
- Grid Lines Display Settings
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/gridlines-scriptable.html b/samples/scales/gridlines-scriptable.html
deleted file mode 100644
index 0d15d998026..00000000000
--- a/samples/scales/gridlines-scriptable.html
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
- Grid Lines Scriptable Settings
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/gridlines-style.html b/samples/scales/gridlines-style.html
deleted file mode 100644
index d71e5ae46f3..00000000000
--- a/samples/scales/gridlines-style.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
- Grid Lines Style Settings
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/label-text-alignment.html b/samples/scales/label-text-alignment.html
deleted file mode 100644
index 8c7c7434f3a..00000000000
--- a/samples/scales/label-text-alignment.html
+++ /dev/null
@@ -1,165 +0,0 @@
-
-
-
-
- Label Text Alignment
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/linear/min-max-suggested.html b/samples/scales/linear/min-max-suggested.html
deleted file mode 100644
index c750f262951..00000000000
--- a/samples/scales/linear/min-max-suggested.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
- Suggested Min/Max Settings
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/linear/min-max.html b/samples/scales/linear/min-max.html
deleted file mode 100644
index 5ebf416ffc1..00000000000
--- a/samples/scales/linear/min-max.html
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
- Min/Max Settings
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/linear/step-size.html b/samples/scales/linear/step-size.html
deleted file mode 100644
index 67cc3c13e9d..00000000000
--- a/samples/scales/linear/step-size.html
+++ /dev/null
@@ -1,176 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/logarithmic/line.html b/samples/scales/logarithmic/line.html
deleted file mode 100644
index 38cb607165e..00000000000
--- a/samples/scales/logarithmic/line.html
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-
- Logarithmic Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/logarithmic/scatter.html b/samples/scales/logarithmic/scatter.html
deleted file mode 100644
index 1f6769a8512..00000000000
--- a/samples/scales/logarithmic/scatter.html
+++ /dev/null
@@ -1,174 +0,0 @@
-
-
-
-
- Scatter Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/multiline-labels.html b/samples/scales/multiline-labels.html
deleted file mode 100644
index d562ee7b629..00000000000
--- a/samples/scales/multiline-labels.html
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/non-numeric-y.html b/samples/scales/non-numeric-y.html
deleted file mode 100644
index e9c5024d818..00000000000
--- a/samples/scales/non-numeric-y.html
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/time/combo.html b/samples/scales/time/combo.html
deleted file mode 100644
index 49b5051359c..00000000000
--- a/samples/scales/time/combo.html
+++ /dev/null
@@ -1,158 +0,0 @@
-
-
-
-
- Line Chart - Combo Time Scale
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/time/line-max-span.html b/samples/scales/time/line-max-span.html
deleted file mode 100644
index a20e2fcdb33..00000000000
--- a/samples/scales/time/line-max-span.html
+++ /dev/null
@@ -1,162 +0,0 @@
-
-
-
-
- Time Scale Point Data
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/time/line-point-data.html b/samples/scales/time/line-point-data.html
deleted file mode 100644
index 7bb1b568b3c..00000000000
--- a/samples/scales/time/line-point-data.html
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
- Time Scale Point Data
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/time/line.html b/samples/scales/time/line.html
deleted file mode 100644
index 79b071d1d3e..00000000000
--- a/samples/scales/time/line.html
+++ /dev/null
@@ -1,207 +0,0 @@
-
-
-
-
- Line Chart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scales/toggle-scale-type.html b/samples/scales/toggle-scale-type.html
deleted file mode 100644
index 243e9c5cafc..00000000000
--- a/samples/scales/toggle-scale-type.html
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
- Toggle Scale Type
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scriptable/bar.html b/samples/scriptable/bar.html
deleted file mode 100644
index 3fb69796253..00000000000
--- a/samples/scriptable/bar.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
- Scriptable > Bar | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scriptable/bubble.html b/samples/scriptable/bubble.html
deleted file mode 100644
index addc37c19c9..00000000000
--- a/samples/scriptable/bubble.html
+++ /dev/null
@@ -1,134 +0,0 @@
-
-
-
-
-
-
- Scriptable > Bubble | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scriptable/line.html b/samples/scriptable/line.html
deleted file mode 100644
index ae367d08ed4..00000000000
--- a/samples/scriptable/line.html
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
- Scriptable > Line | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scriptable/pie.html b/samples/scriptable/pie.html
deleted file mode 100644
index 1cc10366e39..00000000000
--- a/samples/scriptable/pie.html
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
- Scriptable > Pie | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scriptable/polar.html b/samples/scriptable/polar.html
deleted file mode 100644
index 0a5238674de..00000000000
--- a/samples/scriptable/polar.html
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
- Scriptable > Polar Area | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/scriptable/radar.html b/samples/scriptable/radar.html
deleted file mode 100644
index 00286996c7a..00000000000
--- a/samples/scriptable/radar.html
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
-
-
- Scriptable > Radar | Chart.js sample
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/style.css b/samples/style.css
deleted file mode 100644
index db92f0c6016..00000000000
--- a/samples/style.css
+++ /dev/null
@@ -1,191 +0,0 @@
-@import url('https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900');
-
-body, html {
- color: #333538;
- font-family: 'Lato', sans-serif;
- line-height: 1.6;
- padding: 0;
- margin: 0;
-}
-
-a {
- color: #f27173;
- text-decoration: none;
-}
-
-a:hover {
- color: #e25f5f;
- text-decoration: underline;
-}
-
-.content {
- max-width: 800px;
- margin: auto;
- padding: 16px 32px;
-}
-
-.header {
- text-align: center;
- padding: 32px 0;
-}
-
-.wrapper {
- min-height: 400px;
- padding: 16px 0;
- position: relative;
-}
-
-.wrapper.col-2 {
- display: inline-block;
- min-height: 256px;
- width: 49%;
-}
-
-@media (max-width: 400px) {
- .wrapper.col-2 {
- width: 100%
- }
-}
-
-.wrapper canvas {
- -moz-user-select: none;
- -webkit-user-select: none;
- -ms-user-select: none;
-}
-
-.toolbar {
- display: flex;
-}
-
-.toolbar > * {
- margin: 0 8px 0 0;
-}
-
-.btn {
- background-color: #aaa;
- border-radius: 4px;
- color: white;
- padding: 0.25rem 0.75rem;
-}
-
-.btn .fa {
- font-size: 1rem;
-}
-
-.btn:hover {
- background-color: #888;
- color: white;
- text-decoration: none;
-}
-
-.btn-chartjs { background-color: #f27173; }
-.btn-chartjs:hover { background-color: #e25f5f; }
-.btn-docs:hover { background-color: #2793db; }
-.btn-docs { background-color: #36A2EB; }
-.btn-docs:hover { background-color: #2793db; }
-.btn-gh { background-color: #444; }
-.btn-gh:hover { background-color: #333; }
-
-.btn-on {
- border-style: inset;
-}
-
-.chartjs-title {
- font-size: 2rem;
- font-weight: 600;
- white-space: nowrap;
-}
-
-.chartjs-title::before {
- background-image: url(logo.svg);
- background-position: left center;
- background-repeat: no-repeat;
- background-size: 40px;
- content: 'Chart.js | ';
- color: #f27173;
- font-weight: 600;
- padding-left: 48px;
-}
-
-.chartjs-caption {
- font-size: 1.2rem;
-}
-
-.chartjs-links {
- display: flex;
- justify-content: center;
- padding: 8px 0;
-}
-
-.chartjs-links a {
- align-items: center;
- display: flex;
- font-size: 0.9rem;
- margin: 0.2rem;
-}
-
-.chartjs-links .fa:before {
- margin-right: 0.5em;
-}
-
-.samples-category {
- display: inline-block;
- margin-bottom: 32px;
- vertical-align: top;
- width: 25%;
-}
-
-.samples-category > .title {
- color: #aaa;
- font-weight: 300;
- font-size: 1.5rem;
-}
-
-.samples-category:hover > .title {
- color: black;
-}
-
-.samples-category > .items {
- padding: 8px 0;
-}
-
-.samples-entry {
- padding: 0 0 4px 0;
-}
-
-.samples-entry > .title {
- font-weight: 700;
-}
-
-@media (max-width: 640px) {
- .samples-category { width: 33%; }
-}
-
-@media (max-width: 512px) {
- .samples-category { width: 50%; }
-}
-
-@media (max-width: 420px) {
- .chartjs-caption { font-size: 1.05rem; }
- .chartjs-title::before { content: ''; }
- .chartjs-links a { flex-direction: column; }
- .chartjs-links .fa { margin: 0 }
- .samples-category { width: 100%; }
-}
-
-.analyser table {
- color: #333;
- font-size: 0.9rem;
- margin: 8px 0;
- width: 100%
-}
-
-.analyser th {
- background-color: #f0f0f0;
- padding: 2px;
-}
-
-.analyser td {
- padding: 2px;
- text-align: center;
-}
diff --git a/samples/title/alignment.html b/samples/title/alignment.html
deleted file mode 100644
index 6b5b56fb102..00000000000
--- a/samples/title/alignment.html
+++ /dev/null
@@ -1,197 +0,0 @@
-
-
-
-
- Title Positions & Alignment
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/border.html b/samples/tooltips/border.html
deleted file mode 100644
index 004366e02c5..00000000000
--- a/samples/tooltips/border.html
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
- Tooltip Border
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/callbacks.html b/samples/tooltips/callbacks.html
deleted file mode 100644
index 33b14441678..00000000000
--- a/samples/tooltips/callbacks.html
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
- Tooltip Hooks
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/custom-line.html b/samples/tooltips/custom-line.html
deleted file mode 100644
index cf34d323d71..00000000000
--- a/samples/tooltips/custom-line.html
+++ /dev/null
@@ -1,175 +0,0 @@
-
-
-
-
- Line Chart with external Tooltips
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/custom-pie.html b/samples/tooltips/custom-pie.html
deleted file mode 100644
index 4c3e67bdcf8..00000000000
--- a/samples/tooltips/custom-pie.html
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-
-
- Pie Chart with Custom Tooltips
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/custom-points.html b/samples/tooltips/custom-points.html
deleted file mode 100644
index 84137087ffa..00000000000
--- a/samples/tooltips/custom-points.html
+++ /dev/null
@@ -1,133 +0,0 @@
-
-
-
-
- Custom Tooltips using Data Points
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/interactions.html b/samples/tooltips/interactions.html
deleted file mode 100644
index 7088549eb70..00000000000
--- a/samples/tooltips/interactions.html
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
- Tooltip Interaction Modes
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/point-style.html b/samples/tooltips/point-style.html
deleted file mode 100644
index 957449426cd..00000000000
--- a/samples/tooltips/point-style.html
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
- Tooltip Point Style
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/positioning-custom.html b/samples/tooltips/positioning-custom.html
deleted file mode 100644
index 824fff440f1..00000000000
--- a/samples/tooltips/positioning-custom.html
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
- Tooltip Interaction Modes
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/tooltips/positioning.html b/samples/tooltips/positioning.html
deleted file mode 100644
index 5378ab9dbe2..00000000000
--- a/samples/tooltips/positioning.html
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
- Tooltip Interaction Modes
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/utils.js b/samples/utils.js
deleted file mode 100644
index 69a3a827638..00000000000
--- a/samples/utils.js
+++ /dev/null
@@ -1,153 +0,0 @@
-'use strict';
-
-window.chartColors = {
- red: 'rgb(255, 99, 132)',
- orange: 'rgb(255, 159, 64)',
- yellow: 'rgb(255, 205, 86)',
- green: 'rgb(75, 192, 192)',
- blue: 'rgb(54, 162, 235)',
- purple: 'rgb(153, 102, 255)',
- grey: 'rgb(201, 203, 207)'
-};
-
-(function(global) {
- var MONTHS = [
- 'January',
- 'February',
- 'March',
- 'April',
- 'May',
- 'June',
- 'July',
- 'August',
- 'September',
- 'October',
- 'November',
- 'December'
- ];
-
- var COLORS = [
- '#4dc9f6',
- '#f67019',
- '#f53794',
- '#537bc4',
- '#acc236',
- '#166a8f',
- '#00a950',
- '#58595b',
- '#8549ba'
- ];
-
- var Samples = global.Samples || (global.Samples = {});
- var Color = Chart.helpers.color;
-
- function applyDefaultNumbers(config) {
- var cfg = config || {};
- cfg.min = cfg.min || 0;
- cfg.max = cfg.max || 1;
- cfg.from = cfg.from || [];
- cfg.count = cfg.count || 8;
- cfg.decimals = cfg.decimals || 8;
- cfg.continuity = cfg.continuity || 1;
-
- return cfg;
- }
-
- Samples.utils = {
- // Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/
- srand: function(seed) {
- this._seed = seed;
- },
-
- rand: function(min, max) {
- var seed = this._seed;
- min = min === undefined ? 0 : min;
- max = max === undefined ? 1 : max;
- this._seed = (seed * 9301 + 49297) % 233280;
- return min + (this._seed / 233280) * (max - min);
- },
-
- numbers: function(config) {
- var cfg = applyDefaultNumbers(config);
- var dfactor = Math.pow(10, cfg.decimals) || 0;
- var data = [];
- var i, value;
-
- for (i = 0; i < cfg.count; ++i) {
- value = (cfg.from[i] || 0) + this.rand(cfg.min, cfg.max);
- if (this.rand() <= cfg.continuity) {
- data.push(Math.round(dfactor * value) / dfactor);
- } else {
- data.push(null);
- }
- }
-
- return data;
- },
-
- labels: function(config) {
- var cfg = config || {};
- var min = cfg.min || 0;
- var max = cfg.max || 100;
- var count = cfg.count || 8;
- var step = (max - min) / count;
- var decimals = cfg.decimals || 8;
- var dfactor = Math.pow(10, decimals) || 0;
- var prefix = cfg.prefix || '';
- var values = [];
- var i;
-
- for (i = min; i < max; i += step) {
- values.push(prefix + Math.round(dfactor * i) / dfactor);
- }
-
- return values;
- },
-
- months: function(config) {
- var cfg = config || {};
- var count = cfg.count || 12;
- var section = cfg.section;
- var values = [];
- var i, value;
-
- for (i = 0; i < count; ++i) {
- value = MONTHS[Math.ceil(i) % 12];
- values.push(value.substring(0, section));
- }
-
- return values;
- },
-
- color: function(index) {
- return COLORS[index % COLORS.length];
- },
-
- transparentize: function(color, opacity) {
- var alpha = opacity === undefined ? 0.5 : 1 - opacity;
- return Color(color).alpha(alpha).rgbString();
- }
- };
-
- // DEPRECATED
- window.randomScalingFactor = function() {
- return Math.round(Samples.utils.rand(-100, 100));
- };
-
- // INITIALIZATION
-
- Samples.utils.srand(Date.now());
-
- // Google Analytics
- /* eslint-disable */
- if (document.location.hostname.match(/^(www\.)?chartjs\.org$/)) {
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-28909194-3', 'auto');
- ga('send', 'pageview');
- }
- /* eslint-enable */
-
-}(this));
diff --git a/scripts/deploy-docs.sh b/scripts/deploy-docs.sh
index 128cda6a1fc..d6bdccf00ee 100755
--- a/scripts/deploy-docs.sh
+++ b/scripts/deploy-docs.sh
@@ -8,11 +8,11 @@ TARGET_REPO_URL="https://$GITHUB_TOKEN@github.com/chartjs/chartjs.github.io.git"
VERSION=$1
-function move_sample_scripts {
- local subdirectory=$1
- for f in $(find ./samples/$subdirectory -name '*.html'); do
- sed -i -E "s/((\.\.\/)+dist\/)/..\/\1$subdirectory\//" $f
- done
+function move_sample_redirect {
+ local tag=$1
+
+ cp ../scripts/sample-redirect-template.html samples/$tag/index.html
+ sed -i -E "s/TAG/$tag/g" samples/$tag/index.html
}
function update_with_tag {
@@ -20,9 +20,9 @@ function update_with_tag {
rm -rf "docs/$tag"
cp -r ../dist/docs docs/$tag
rm -rf "samples/$tag"
- cp -r ../samples samples/$tag
+ mkdir "samples/$tag"
- move_sample_scripts $tag
+ move_sample_redirect $tag
deploy_versioned_files $tag
}
@@ -30,7 +30,6 @@ function update_with_tag {
# Note: this code also exists in docs-config.sh
# tag is next|latest|master
# https://www.chartjs.org/docs/$tag/
-# https://www.chartjs.org/samples/$tag/
# https://www.chartjs.org/dist/$tag/chart.*js
function update_tagged_files {
if [ "$VERSION" == "master" ]; then
diff --git a/scripts/sample-redirect-template.html b/scripts/sample-redirect-template.html
new file mode 100644
index 00000000000..06cf13b5f22
--- /dev/null
+++ b/scripts/sample-redirect-template.html
@@ -0,0 +1,32 @@
+
+
+
+
+ Chart.js | Samples
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file