]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
The scatter example page now has negative numbers in both directions
authorEvert Timberg <evert.timberg@gmail.com>
Mon, 18 May 2015 12:44:06 +0000 (08:44 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Mon, 18 May 2015 12:44:06 +0000 (08:44 -0400)
samples/scatter.html

index afb04edc854b3300ffc5f5c0dcb587c9c7f7e704..56c23fa72ca6d5ddb2e789390b1c91ba4389e98b 100644 (file)
@@ -16,7 +16,7 @@
     <button id="randomizeData">Randomize Data</button>
     <script>
     var randomScalingFactor = function() {
-        return Math.round(Math.random() * 100);
+        return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);
     };
     var randomColor = function(opacity) {
         return 'rgba(' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + (opacity || '.3') + ')';