From fd3abdbc35102f062be526e72cf7c86405e78415 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 16 Jun 2018 15:09:54 -0400 Subject: [PATCH] Pad random color to be 6 hex characters Signed-off-by: Mcat12 --- src/components/ClientsGraph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ClientsGraph.js b/src/components/ClientsGraph.js index 55b279d..cb3d69c 100644 --- a/src/components/ClientsGraph.js +++ b/src/components/ClientsGraph.js @@ -56,7 +56,7 @@ class ClientsGraph extends Component { // If we ran out of colors, make a random one backgroundColor: i < colors.length ? colors[i] - : '#' + parseInt("" + Math.random() * 0xffffff, 10).toString(16), + : '#' + parseInt("" + Math.random() * 0xffffff, 10).toString(16).padStart(6, "0"), pointRadius: 0, pointHitRadius: 5, pointHoverRadius: 5,