Skip to content

Commit 6184ff9

Browse files
committed
More colors for charts
1 parent 05ff7de commit 6184ff9

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

libs/app.js

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
const COLORS = [
1+
/*
2+
PHP-Frameworks-Bench
3+
*/
4+
5+
const COLORS_ = [
26
"#3273a8",
37
"#3a78ac",
48
"#437cae",
@@ -21,10 +25,19 @@ const COLORS = [
2125
"#a87732",
2226
];
2327

24-
var rpsChart = document.getElementById('rpsChart');
25-
var memoryChart = document.getElementById('memoryChart');
26-
var timeChart = document.getElementById('timeChart');
27-
var fileChart = document.getElementById('fileChart');
28+
// For more colors
29+
// I'm lazy to regenerate them again
30+
// so lets have a map to make more
31+
let COLORS = dataRPS.map(
32+
(item, index) =>
33+
COLORS_[Math.round(index / (dataRPS.length / COLORS_.length))]
34+
);
35+
36+
var rpsChart = document.getElementById("rpsChart");
37+
var memoryChart = document.getElementById("memoryChart");
38+
var timeChart = document.getElementById("timeChart");
39+
var fileChart = document.getElementById("fileChart");
40+
2841
new Chart(rpsChart, {
2942
type: "bar",
3043
data: {

0 commit comments

Comments
 (0)