Commit 931e99c3 authored by Magnus Holm Brunbjerg's avatar Magnus Holm Brunbjerg
Browse files

color update

parent df6a58dc
const chartCtx = document.querySelector('#issues-chart')
function randomColor () {
const letters = '0123456789ABCDEF'.split('')
let color = '#'
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)]
}
return color
}
function makeData (data) {
let labels = []
let issues = []
......@@ -35,6 +46,7 @@ function makeData (data) {
function makeChart (data) {
const dataset = makeData(data)
let lineColor = randomColor()
let chart = new Chart(chartCtx, {
type: 'bar',
......@@ -44,12 +56,13 @@ function makeChart (data) {
label: 'Gennemsnitlig tid (Min)',
data: dataset.avgTime,
type: 'line',
backgroundColor: '#113657',
backgroundColor: lineColor,
borderColor: lineColor,
fill: false
}, {
label: 'Antal problemer',
data: dataset.issues,
backgroundColor: 'gold'
backgroundColor: randomColor()
}]
},
......
......@@ -76,6 +76,7 @@ function makeChart (issueData, experimentNames) {
label: `${experimentNames[i]} - Tid`,
data: data.avgStepTime[i],
backgroundColor: colors[i],
borderColor: colors[i],
type: 'line',
fill: false
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment