From: Evert Timberg Date: Wed, 17 Jun 2015 02:21:40 +0000 (-0400) Subject: Update radar sample + use the same colour functions in all samples X-Git-Tag: 2.0.0-alpha4~82^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F1221%2Fhead;p=thirdparty%2FChart.js.git Update radar sample + use the same colour functions in all samples --- diff --git a/samples/doughnut.html b/samples/doughnut.html index 93f7c8656..f2746557a 100644 --- a/samples/doughnut.html +++ b/samples/doughnut.html @@ -32,7 +32,7 @@ return Math.round(Math.random() * 255); }; var randomColor = function(opacity) { - return 'rgba(' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + (opacity || '.3') + ')'; + return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')'; }; var config = { diff --git a/samples/line.html b/samples/line.html index c7ea97c17..b4d9bc4ee 100644 --- a/samples/line.html +++ b/samples/line.html @@ -25,8 +25,11 @@ var randomScalingFactor = function() { return Math.round(Math.random() * 100 * (Math.random() > 0.5 ? -1 : 1)); }; + var randomColorFactor = function() { + return Math.round(Math.random() * 255); + }; var randomColor = function(opacity) { - return 'rgba(' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + (opacity || '.3') + ')'; + return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')'; }; var config = { diff --git a/samples/pie.html b/samples/pie.html index 2ae057355..571efb037 100644 --- a/samples/pie.html +++ b/samples/pie.html @@ -18,8 +18,11 @@ var randomScalingFactor = function() { return Math.round(Math.random() * 100); }; + var randomColorFactor = function() { + return Math.round(Math.random() * 255); + }; var randomColor = function(opacity) { - return 'rgba(' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + Math.round(Math.random() * 255) + ',' + (opacity || '.3') + ')'; + return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')'; }; var config = { diff --git a/samples/radar.html b/samples/radar.html index 0630bc1ed..fd1214cbb 100644 --- a/samples/radar.html +++ b/samples/radar.html @@ -8,10 +8,12 @@ -
+
+ +