Move color generation to javascript
This commit is contained in:
@@ -43,9 +43,15 @@ function secondsToHumanReadable(seconds) {
|
||||
return result;
|
||||
}
|
||||
|
||||
function buildChart(ctx, data) {
|
||||
function buildChart(ctx, bare_data) {
|
||||
var data = bare_data;
|
||||
var max_value = 0;
|
||||
var index = 0;
|
||||
for (dataset of data.datasets) {
|
||||
var color = Chart.helpers.color(generateBarColor(index));
|
||||
dataset.backgroundColor = color.alpha(0.5).rgbString();
|
||||
dataset.borderColor = color.alpha(1.0).rgbString();
|
||||
dataset.borderWidth = 1;
|
||||
for (value of dataset.data) {
|
||||
max_value = Math.max(max_value, value);
|
||||
}
|
||||
|
Reference in New Issue
Block a user