]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update chartColors.js to utils.js and move randomScalingFactor function there
authorEvert Timberg <evert.timberg+github@gmail.com>
Sun, 23 Oct 2016 18:04:00 +0000 (14:04 -0400)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sun, 23 Oct 2016 21:33:25 +0000 (16:33 -0500)
46 files changed:
samples/animation/progress-bar.html [moved from samples/AnimationCallbacks/progress-bar.html with 95% similarity]
samples/bar/bar-horizontal.html
samples/bar/bar-multi-axis.html
samples/bar/bar-stacked.html
samples/bar/bar.html
samples/bubble.html
samples/combo-bar-line.html
samples/data_labelling.html
samples/doughnut.html
samples/legend/pointstyle.html
samples/legend/positions.html
samples/line/different-point-sizes.html
samples/line/interpolation-modes.html
samples/line/line-multi-axis.html
samples/line/line-skip-points.html
samples/line/line-stacked-area.html
samples/line/line-stepped.html
samples/line/line-styles.html
samples/line/line.html
samples/line/point-styles.html
samples/pie.html
samples/polar-area.html
samples/radar/radar-skip-points.html
samples/radar/radar.html
samples/scales/display-settings.html [moved from samples/generalScales/display-settings.html with 98% similarity]
samples/scales/filtering-labels.html [moved from samples/generalScales/filtering-labels.html with 98% similarity]
samples/scales/gridlines.html [moved from samples/generalScales/gridlines.html with 97% similarity]
samples/scales/line-non-numeric-y.html [moved from samples/generalScales/line-non-numeric-y.html with 82% similarity]
samples/scales/linear/min-max-settings.html [moved from samples/linearScale/min-max-settings.html with 94% similarity]
samples/scales/linear/step-size.html [moved from samples/linearScale/step-size.html with 97% similarity]
samples/scales/linear/suggested-min-max-settings.html [moved from samples/linearScale/suggested-min-max-settings.html with 95% similarity]
samples/scales/logarithmic/line-logarithmic.html [moved from samples/logarithmicScale/line-logarithmic.html with 96% similarity]
samples/scales/logarithmic/scatter-logX.html [moved from samples/logarithmicScale/scatter-logX.html with 96% similarity]
samples/scales/multiline-labels.html [moved from samples/generalScales/multiline-labels.html with 98% similarity]
samples/scales/time/combo-time-scale.html [moved from samples/timeScale/combo-time-scale.html with 95% similarity]
samples/scales/time/line-time-point-data.html [moved from samples/timeScale/line-time-point-data.html with 94% similarity]
samples/scales/time/line-time-scale.html [moved from samples/timeScale/line-time-scale.html with 96% similarity]
samples/scatter/scatter-multi-axis.html
samples/scatter/scatter.html
samples/tooltips/dataPoints-customTooltips.html
samples/tooltips/interaction-modes.html
samples/tooltips/line-customTooltips.html
samples/tooltips/pie-customTooltips.html
samples/tooltips/position-modes.html
samples/tooltips/tooltip-callbacks.html
samples/utils.js [moved from samples/chartColors.js with 64% similarity]

similarity index 95%
rename from samples/AnimationCallbacks/progress-bar.html
rename to samples/animation/progress-bar.html
index ddfc12e3cf69b9ab882f6aaf2bb593869c0d88fc..b0c495a02db0818a0b994bfdc520b7e078937214 100644 (file)
@@ -3,7 +3,7 @@
 <head>
        <title> Animation Callbacks </title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     <button id="randomizeData">Randomize Data</button>
     <script>
         var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100);
-        };
-
         var progress = document.getElementById('animationProgress');
-
         var config = {
             type: 'line',
             data: {
index 4759dd32767cec3e4ccef2f1e3d06e2a1a41e345..affcc334927d6eb8a71576ca62ef3b7e15bf33a0 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Horizontal Bar Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     <button id="removeData">Remove Data</button>
     <script>
         var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-        };
-        var randomColorFactor = function() {
-            return Math.round(Math.random() * 255);
-        };
-        var randomColor = function() {
-            return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',.7)';
-        };
-
         var color = Chart.helpers.color;
-
         var horizontalBarChartData = {
             labels: ["January", "February", "March", "April", "May", "June", "July"],
             datasets: [{
index 2a6caa8a2034631c0523e4f79a5a5c92c73e3e6e..b35e89055ea77257bd9087c55f8da099072b9448 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Bar Chart Multi Axis</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     </div>
     <button id="randomizeData">Randomize Data</button>
     <script>
-    var randomScalingFactor = function() {
-        return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-    };
-
     var barChartData = {
         labels: ["January", "February", "March", "April", "May", "June", "July"],
         datasets: [{
index 60bf26f5438213ebb676ce09bdfaa8a034262b56..f80b1b6ed9039401b229a73dcddc7ba4a8ff84a5 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Stacked Bar Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     </div>
     <button id="randomizeData">Randomize Data</button>
     <script>
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-        };
-
         var barChartData = {
             labels: ["January", "February", "March", "April", "May", "June", "July"],
             datasets: [{
index d46502e67b8d4c6ec70b661664b320a02735eadc..d2fc4acacedf94f803d85883d81103372c65de5c 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Bar Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     <button id="removeData">Remove Data</button>
     <script>
         var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-        };
-        var randomColorFactor = function() {
-            return Math.round(Math.random() * 255);
-        };
-        var randomColor = function() {
-            return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',.7)';
-        };
-
         var color = Chart.helpers.color;
         var barChartData = {
             labels: ["January", "February", "March", "April", "May", "June", "July"],
index bde0f70cfa2ed062bfc5007e64653be7d84c850c..d62d6375970c70632dec29b9c423b5a4a199d02b 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Bubble Chart</title>
     <script src="../dist/Chart.bundle.js"></script>
-    <script src="chartColors.js"></script>
+    <script src="utils.js"></script>
     <style type="text/css">
     canvas{
         -moz-user-select: none;
         var DEFAULT_DATASET_SIZE = 7;
 
         var addedCount = 0;
-
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-        };
-
         var color = Chart.helpers.color;
         var bubbleChartData = {
             animation: {
index db6c3aa07a02dc410174bd2bde72009b36ac892e..c8b5a08f865210979335ec9bcfeaad7ebedd9220 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Combo Bar-Line Chart</title>
     <script src="../dist/Chart.bundle.js"></script>
-    <script src="chartColors.js"></script>
+    <script src="utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     </div>
     <button id="randomizeData">Randomize Data</button>
     <script>
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-        };
-
         var chartData = {
             labels: ["January", "February", "March", "April", "May", "June", "July"],
             datasets: [{
index 849de80d36400b4db38b44648afb384612fd8de5..939e517a9f26aab3b9e9ed56fd964690c942498d 100644 (file)
@@ -5,7 +5,7 @@
 <head>
     <title>Labelling Data Points</title>
     <script src="../dist/Chart.bundle.js"></script>
-    <script src="chartColors.js"></script>
+    <script src="utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     </div>
     <button id="randomizeData">Randomize Data</button>
     <script>
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-        };
-
         var color = Chart.helpers.color;
         var barChartData = {
             labels: ["January", "February", "March", "April", "May", "June", "July"],
index e2fd662d8af76ed9f5dfb7d95679dea59c8e306b..51b98a82a4d527eb1eceb8009baba5bbc2919947 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Doughnut Chart</title>
     <script src="../dist/Chart.bundle.js"></script>
-    <script src="chartColors.js"></script>
+    <script src="utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
index e90b63def5212894a595866ca10502c9f9577c5e..727c7a6d85c2498acde9c45d81e9ea3f97539660 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Legend Point Style</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
         canvas {
             -moz-user-select: none;
         </div>
     </div>
     <script>
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-        };
-
         var color = Chart.helpers.color;
         function createConfig(colorName) {
             return {
index f1edd7c6ff1ac828abdf7cced4472f77424c4c90..97bc70fa04790480721e1327bcd9e40484bc8576 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Legend Positions</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
         canvas {
             -moz-user-select: none;
         </div>
     </div>
     <script>
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-        };
-
         var color = Chart.helpers.color;
         function createConfig(legendPosition, colorName) {
             return {
index 3137367f725bf8b1a993459deb156f161294d58b..ed52cf0ae6db5a68da4554d4be391d0e9bfbb54f 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Different Point Sizes</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
         canvas {
             -moz-user-select: none;
     </div>
     <script>
         var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-        };
-
         var config = {
             type: 'line',
             data: {
index 51469c933259b8fbcd60a6bc300dd4683491916d..ff75210a60263f7fe942b1359e44da6add3aedd2 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Chart - Cubic interpolation mode</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
index f51e297dc5fabf962e04f9d279b30343647e3771..debdf369f8820a9b383e7b273319b5261bbe4bff 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Chart Multiple Axes</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     </div>
     <button id="randomizeData">Randomize Data</button>
     <script>
-    var randomScalingFactor = function() {
-        return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-    };
-
     var lineChartData = {
         labels: ["January", "February", "March", "April", "May", "June", "July"],
         datasets: [{
index a40571d2c1f304e249b38b19cf42392d7c41a188..bb8c8c4c83f427515f6db802afeea94c9695259b 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
         <canvas id="canvas"></canvas>
     </div>
     <script>
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100);
-        };
-
         var config = {
             type: 'line',
             data: {
index a194bba3b1e2c17ad750fb9556747a1c04de661d..9621c14d511fec78fbf176a96f17af38dbb53deb 100644 (file)
@@ -4,7 +4,7 @@
 <head>
        <title>Line Chart</title>
        <script src="../../dist/Chart.bundle.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../utils.js"></script>
        <style>
                canvas {
                                -moz-user-select: none;
        <button id="removeData">Remove Data</button>
        <script>
                var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-
-               var randomScalingFactor = function() {
-                       return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-               };
-
                var config = {
                        type: 'line',
                        data: {
index 94cc6152083ada264fad49b510c6c5633621374f..ff1bf2a6e2d8a913af15bbc6f5a2dd52b5491a71 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Stepped Line Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
@@ -19,9 +19,6 @@
         <canvas id="canvas"></canvas>
     </div>
     <script>
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? -1 : 1) * Math.round(Math.random() * 100);
-        };
         var config = {
             type: 'line',
             data: {
index a2c06f9352a171ca10ec568a8cfcabb412a3061b..0ac3aabdb4b7d1a17c9ee146cfbd9c282d14dd22 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Styles</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
         <canvas id="canvas"></canvas>
     </div>
     <script>
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100);
-        };
-
         var config = {
             type: 'line',
             data: {
index 980feb7473243db43a27e037bc7b889bd90a0d15..68ae7e5f60cd11d7a59fb2bc8b2a0fdc27893719 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
     <button id="removeData">Remove Data</button>
     <script>
         var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-        
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100);
-        };
-
         var config = {
             type: 'line',
             data: {
index ff7586355418d7e697b834284e11fa3406dc6fa4..547b1ea0a2b7a53b2adee4d6e44a10b16bf71973 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
@@ -52,6 +52,9 @@
                         display:true,
                         text:'Point Style: ' + pointStyle
                     },
+                    legend: {
+                        display: false
+                    },
                     elements: {
                         point: {
                             pointStyle: pointStyle
index 2b1578536b8d98741ee48511dc0d24afdcd74141..c299af961901935c4e95bf850a29dec1b3b9dbf9 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Pie Chart</title>
     <script src="../dist/Chart.bundle.js"></script>
-    <script src="chartColors.js"></script>
+    <script src="utils.js"></script>
 </head>
 
 <body>
index 0b382c484deeaf434be048731d826953e24ac028..48fe984afab314688a2387e230bfefd7bb169779 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Polar Area Chart</title>
     <script src="../dist/Chart.bundle.js"></script>
-    <script src="chartColors.js"></script>
+    <script src="utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
index 40ad4779efb93ae741134b487af98293643a9572..ab29b3a0e34039c5063014b6e4f1e86eea67ab34 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Radar Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
index 98bc7086d9756faf41e62e9d56ad096f9758db66..507d5bb47d72317987cacf54af824f5297e64de5 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Radar Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
similarity index 98%
rename from samples/generalScales/display-settings.html
rename to samples/scales/display-settings.html
index 71f1c518ced1b8379ca849df4fda6a2f2e49fe95..0c2dc114e6fe0f4eac1c10935a8405c3554899ad 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Suggested Min/Max Settings</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
similarity index 98%
rename from samples/generalScales/filtering-labels.html
rename to samples/scales/filtering-labels.html
index 21cb0cc89180e650f26f0203571110eef55eb39d..4af89025eb497c64536fbdf76f5c940a584d73e7 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Chart with xAxis Filtering</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
similarity index 97%
rename from samples/generalScales/gridlines.html
rename to samples/scales/gridlines.html
index e133e4e8d41db518307edd858fefc650bbeafc90..76bb1f0070c889961406fd9df586230128238b7c 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Suggested Min/Max Settings</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
similarity index 82%
rename from samples/generalScales/line-non-numeric-y.html
rename to samples/scales/line-non-numeric-y.html
index 3ec760e92d28afc868b231056fa16749d2f1edac..07e319b7090716b53506327f6f283ee4adfbe180 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
     </div>
     <script>
         var MONTHS = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
-        
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100);
-            //return 0;
-        };
-        var randomColorFactor = function() {
-            return Math.round(Math.random() * 255);
-        };
-        var randomColor = function(opacity) {
-            return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')';
-        };
-
         var config = {
             type: 'line',
             data: {
similarity index 94%
rename from samples/linearScale/min-max-settings.html
rename to samples/scales/linear/min-max-settings.html
index 529eb481f2bb140f783c8c88c8b5c4276060d001..868bc7b1db53d7ea75b24d27f777dc255620dd6e 100644 (file)
@@ -3,8 +3,8 @@
 
 <head>
     <title>Min/Max Settings</title>
-    <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../../../dist/Chart.bundle.js"></script>
+    <script src="../../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
similarity index 97%
rename from samples/linearScale/step-size.html
rename to samples/scales/linear/step-size.html
index c65cc9ab4c69bd258e7094c55d84a1e171feef3e..d38f3e1f0bb469191007416542870a6b55135805 100644 (file)
@@ -3,8 +3,8 @@
 
 <head>
     <title>Line Chart</title>
-    <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../../../dist/Chart.bundle.js"></script>
+    <script src="../../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
similarity index 95%
rename from samples/linearScale/suggested-min-max-settings.html
rename to samples/scales/linear/suggested-min-max-settings.html
index 54396f92ebad5056b7f0affe35380db3a1844c39..18059548a7fe00783076f4b2f08f175d6fd1532d 100644 (file)
@@ -3,8 +3,8 @@
 
 <head>
     <title>Suggested Min/Max Settings</title>
-    <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../../../dist/Chart.bundle.js"></script>
+    <script src="../../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
similarity index 96%
rename from samples/logarithmicScale/line-logarithmic.html
rename to samples/scales/logarithmic/line-logarithmic.html
index fe3d5b11032db8d6566a1e47604886925e13ff54..2c961abd2e14d9f38b4af56c63a611cca34b6bdc 100644 (file)
@@ -3,8 +3,8 @@
 
 <head>
     <title>Logarithmic Line Chart</title>
-    <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../../../dist/Chart.bundle.js"></script>
+    <script src="../../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
similarity index 96%
rename from samples/logarithmicScale/scatter-logX.html
rename to samples/scales/logarithmic/scatter-logX.html
index 6864b409023a54cfce45cf6793f64e1f45f16899..a4bd577c27306b54e72a07840edfec9078b3dab1 100644 (file)
@@ -3,8 +3,8 @@
 
 <head>
     <title>Scatter Chart</title>
-    <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../../../dist/Chart.bundle.js"></script>
+    <script src="../../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
similarity index 98%
rename from samples/generalScales/multiline-labels.html
rename to samples/scales/multiline-labels.html
index 006c28edebb811a23f7cf01845b5b08da552b75b..b7bb041e973787d25b1b1e397aa2ad3df802db89 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Line Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas{
         -moz-user-select: none;
similarity index 95%
rename from samples/timeScale/combo-time-scale.html
rename to samples/scales/time/combo-time-scale.html
index 23a5f777eeb70783c1de66466225a8297def61b2..873e40d1ae385c5649939341cf968a802c3f9681 100644 (file)
@@ -4,8 +4,8 @@
 <head>
        <title>Line Chart - Combo Time Scale</title>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
-       <script src="../../dist/Chart.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../../../dist/Chart.js"></script>
+       <script src="../../utils.js"></script>
        <style>
     canvas {
         -moz-user-select: none;
        <script>
                var timeFormat = 'MM/DD/YYYY HH:mm';
 
-               function randomScalingFactor() {
-                       return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-               }
-
                function newDateString(days) {
                        return moment().add(days, 'd').format(timeFormat);
                }
similarity index 94%
rename from samples/timeScale/line-time-point-data.html
rename to samples/scales/time/line-time-point-data.html
index 7d90c6b0b2b82fe98e78eba5482519698da17a38..d880515f5a13a77dea05392dc0f6d1a83e5ad961 100644 (file)
@@ -4,8 +4,8 @@
 <head>
        <title>Time Scale Point Data</title>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
-       <script src="../../dist/Chart.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../../../dist/Chart.js"></script>
+       <script src="../../utils.js"></script>
        <style>
     canvas {
         -moz-user-select: none;
        <button id="addData">Add Data</button>
        <button id="removeData">Remove Data</button>
        <script>
-               function randomScalingFactor() {
-                       return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-               }
-
                function newDate(days) {
                        return moment().add(days, 'd').toDate();
                }
similarity index 96%
rename from samples/timeScale/line-time-scale.html
rename to samples/scales/time/line-time-scale.html
index e48d92c0240a694884697a15a2e15166058df8ac..b1645e0ddbe8eba4846c53177411d0abe196f6a6 100644 (file)
@@ -4,8 +4,8 @@
 <head>
        <title>Line Chart</title>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script>
-       <script src="../../dist/Chart.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../../../dist/Chart.js"></script>
+       <script src="../../utils.js"></script>
        <style>
     canvas {
         -moz-user-select: none;
        <button id="removeData">Remove Data</button>
        <script>
                var timeFormat = 'MM/DD/YYYY HH:mm';
-
-               function randomScalingFactor() {
-                       return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-               }
-
+               
                function newDate(days) {
                        return moment().add(days, 'd').toDate();
                }
index 96edac994449ed25d4647da31fc2693da243c624..aedcd3daa0b4b2ac3df2e2985de014ba0156966b 100644 (file)
@@ -4,7 +4,7 @@
 <head>
        <title>Scatter Chart Multi Axis</title>
        <script src="../../dist/Chart.bundle.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../utils.js"></script>
        <style>
        canvas {
                -moz-user-select: none;
        </div>
        <button id="randomizeData">Randomize Data</button>
        <script>
-       var randomScalingFactor = function() {
-               return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-       };
-
        var color = Chart.helpers.color;
        var scatterChartData = {
                datasets: [{
index c5de6bae00615cbd34770121dabad0fb332cad56..b8ac32b8f1eee40aa6de0fe316af638e859eca10 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Scatter Chart</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
     </div>
     <button id="randomizeData">Randomize Data</button>
     <script>
-        var randomScalingFactor = function() {
-            return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
-        };
-
         var color = Chart.helpers.color;
         var scatterChartData = {
             datasets: [{
index 1ae7f90ab80fa58a94e3824991ac617460b36b9e..b9e9816758442a1304cb572ddc52cc7553c327b4 100644 (file)
@@ -4,7 +4,7 @@
 <head>
        <title>Custom Tooltips using Data Points</title>
        <script src="../../dist/Chart.bundle.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../utils.js"></script>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
        <style>
                canvas{
@@ -66,9 +66,6 @@
                                });
                        }
                };
-               var randomScalingFactor = function() {
-                       return Math.round(Math.random() * 100);
-               };
                var color = Chart.helpers.color;
                var lineChartData = {
                        labels: ["January", "February", "March", "April", "May", "June", "July"],
index bf9bf971a47ef95450063bab7ed3356624634457..f3dec217ff750ae9ebc9b92b89fa733f1ee9e6e9 100644 (file)
@@ -4,7 +4,7 @@
 <head>
        <title>Tooltip Interaction Modes</title>
        <script src="../../dist/Chart.bundle.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../utils.js"></script>
        <style>
        canvas {
                -moz-user-select: none;
index cc6e356b353f8631f91cb704c0623aca29c8de47..97f543b2653ae6365738f74663df10df42240ab9 100644 (file)
@@ -4,7 +4,7 @@
 <head>
        <title>Line Chart with Custom Tooltips</title>
        <script src="../../dist/Chart.bundle.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../utils.js"></script>
        <style>
                canvas{
                        -moz-user-select: none;
                        tooltipEl.style.fontStyle = tooltip._fontStyle;
                        tooltipEl.style.padding = tooltip.yPadding + 'px ' + tooltip.xPadding + 'px';
                };
-               
-               var randomScalingFactor = function() {
-                       return Math.round(Math.random() * 100);
-               };
+
                var lineChartData = {
                        labels: ["January", "February", "March", "April", "May", "June", "July"],
                        datasets: [{
index abc047bfd214759f2a8f45bd0e261db4325869b6..4eedd6a3a7ab5b31ff0d21a5a1bce11a3b864cca 100644 (file)
@@ -4,7 +4,7 @@
 <head>
                <title>Pie Chart with Custom Tooltips</title>
                <script src="../../dist/Chart.bundle.js"></script>
-               <script src="../chartColors.js"></script>
+               <script src="../utils.js"></script>
 
                <style>
                #canvas-holder {
index 596eb6dfeb65e2bf52278fac48a68fd2dbe012b6..03ad882145f9d406ca280e1685761ac4e7cbbd0c 100644 (file)
@@ -4,7 +4,7 @@
 <head>
        <title>Tooltip Interaction Modes</title>
        <script src="../../dist/Chart.bundle.js"></script>
-       <script src="../chartColors.js"></script>
+       <script src="../utils.js"></script>
        <style>
        canvas {
                -moz-user-select: none;
index 397348b01b87ee750e767d030a92d990075c03fb..590edd1a236cd557b5135a0f95483eca267ab2cf 100644 (file)
@@ -4,7 +4,7 @@
 <head>
     <title>Tooltip Hooks</title>
     <script src="../../dist/Chart.bundle.js"></script>
-    <script src="../chartColors.js"></script>
+    <script src="../utils.js"></script>
     <style>
     canvas {
         -moz-user-select: none;
         <canvas id="canvas"></canvas>
     </div>
     <script>
-        var randomScalingFactor = function() {
-            return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1));
-        };
-
         var config = {
             type: 'line',
             data: {
similarity index 64%
rename from samples/chartColors.js
rename to samples/utils.js
index c63678fb547742ef180981f990a9592bd4ff2f3e..34965ce66cae6a74d6f42fa7cd08c3ca0d602063 100644 (file)
@@ -6,4 +6,8 @@ window.chartColors = {
        blue: 'rgb(54, 162, 235)',
        purple: 'rgb(153, 102, 255)',
        grey: 'rgb(231,233,237)'
+};
+
+window.randomScalingFactor = function() {
+       return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
 }
\ No newline at end of file