Skip to content

Commit

Permalink
More colors for charts
Browse files Browse the repository at this point in the history
  • Loading branch information
myaaghubi committed Jul 23, 2023
1 parent 05ff7de commit 6184ff9
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions libs/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const COLORS = [
/*
PHP-Frameworks-Bench
*/

const COLORS_ = [
"#3273a8",
"#3a78ac",
"#437cae",
Expand All @@ -21,10 +25,19 @@ const COLORS = [
"#a87732",
];

var rpsChart = document.getElementById('rpsChart');
var memoryChart = document.getElementById('memoryChart');
var timeChart = document.getElementById('timeChart');
var fileChart = document.getElementById('fileChart');
// For more colors
// I'm lazy to regenerate them again
// so lets have a map to make more
let COLORS = dataRPS.map(
(item, index) =>
COLORS_[Math.round(index / (dataRPS.length / COLORS_.length))]
);

var rpsChart = document.getElementById("rpsChart");
var memoryChart = document.getElementById("memoryChart");
var timeChart = document.getElementById("timeChart");
var fileChart = document.getElementById("fileChart");

new Chart(rpsChart, {
type: "bar",
data: {
Expand Down

0 comments on commit 6184ff9

Please sign in to comment.