From e25b58944d32ae53449ac51638816f2196508213 Mon Sep 17 00:00:00 2001 From: Guilherme Lima Date: Tue, 4 Oct 2022 23:20:23 +0200 Subject: [PATCH] Minor tweaks to charts appearance Some charts had a more 'curvy' look to it. Adjusted this by using the 'tension' parameter. Adjusted 'Utilization' pie chart aspect ratio so it is not so big. --- src/resources/js/app.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/resources/js/app.js b/src/resources/js/app.js index ae0bf6b..2835534 100644 --- a/src/resources/js/app.js +++ b/src/resources/js/app.js @@ -129,7 +129,8 @@ const Charts = (() => { }] }, options: { - hover: { mode: null } + hover: { mode: null }, + aspectRatio: 2 } }); c.executorBusyChanged = busy => { @@ -161,11 +162,13 @@ const Charts = (() => { backgroundColor: "#883d3d", data: data.map(e => e.failed || 0), fill: true, + tension: 0.35, },{ label: 'Successful Builds', backgroundColor: "#74af77", data: data.map(e => e.success || 0), fill: true, + tension: 0.35, }] }, options:{ @@ -279,7 +282,8 @@ const Charts = (() => { label: name, data: durations.map(x => x * scale.factor), borderColor: 'hsl('+(name.hashCode() % 360)+', 27%, 57%)', - backgroundColor: 'transparent' + backgroundColor: 'transparent', + tension: 0.35, }); const c = new Chart(document.getElementById(id), { type: 'line', @@ -389,7 +393,7 @@ const Charts = (() => { })(); // For all charts, set miniumum Y to 0 -Chart.defaults.scales.linear = { ticks: { suggestedMin: 0 } }; +Chart.defaults.scales.linear.suggestedMin = 0; // Don't display legend by default Chart.defaults.plugins.legend.display = false; // Disable tooltip hover animations