From 482589fc6ec1f762bbdcdb5b183f25e0314bacb9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 3 Nov 2020 18:34:51 +0000 Subject: [PATCH] --- ...dash-test-bar-widget-count-by-usertype.vue | 16 ++--- ...h-test-line-widget-monthly-total-price.vue | 71 ++++++++++++++++++- 2 files changed, 73 insertions(+), 14 deletions(-) diff --git a/ayanova/src/components/dash-test-bar-widget-count-by-usertype.vue b/ayanova/src/components/dash-test-bar-widget-count-by-usertype.vue index 55381493..2296f4f3 100644 --- a/ayanova/src/components/dash-test-bar-widget-count-by-usertype.vue +++ b/ayanova/src/components/dash-test-bar-widget-count-by-usertype.vue @@ -39,6 +39,7 @@ /* TODO: Move palette color stuff to it's own file that can be imported in here and in ops-metrics todo: change palette colors to very muted choices as per guide book +todo: clickable bars to link to source */ import GzDash from "../components/dash-base.vue"; @@ -58,22 +59,13 @@ export default { "Head office", "Service", "Non Service", - "Subcontractor", - "Six", - "Seven", - "eight", - "nine", - "ten" + "Subcontractor" ], datasets: [ { label: "", - data: [2, 4, 6, 8, 10, 12, 14, 16, 18, 20], - backgroundColor: getPalette(10) - // , - // minBarLength: 5, - // barThickness: 6, - // categoryPercentage: 0.2 + data: [2, 4, 6, 8, 10], + backgroundColor: getPalette(5) } ] } diff --git a/ayanova/src/components/dash-test-line-widget-monthly-total-price.vue b/ayanova/src/components/dash-test-line-widget-monthly-total-price.vue index 4e124062..5b0f1702 100644 --- a/ayanova/src/components/dash-test-line-widget-monthly-total-price.vue +++ b/ayanova/src/components/dash-test-line-widget-monthly-total-price.vue @@ -8,7 +8,16 @@ > @@ -20,7 +29,30 @@ export default { GzDash }, data() { - return {}; + return { + obj: { + labels: [ + "January", + "February", + "March", + "April", + "May", + "June", + "July" + ], + datasets: [ + { + borderColor: CHART_PALETTE.teal, + backgroundColor: CHART_PALETTE.teal, + fill: false, + radius: 5, + hoverRadius: 10, + hitRadius: 5, + data: [0, 10, 5, 2, 20, 30, 45] + } + ] + } + }; }, props: {}, created() {}, @@ -31,4 +63,39 @@ export default { } } }; + +const CHART_PALETTE = { + blue: "#1f77b4", + red: "#d62728", + orange: "#fe7f0e", + green: "#2ca02c", + purple: "#9c27b0", + black: "#000000", + cyan: "#00BCD4", + teal: "#009688", + primary: "#00205B", //APP Canucks dark blue + secondary: "#00843D", //APP canucks green + accent: "#db7022" //APP lighter orangey red, more friendly looking though not as much clarity it seems +}; + +/////////////////////// +// +function getPalette(size) { + let palette = [ + CHART_PALETTE.blue, + CHART_PALETTE.red, + CHART_PALETTE.green, + CHART_PALETTE.orange, + CHART_PALETTE.purple, + CHART_PALETTE.cyan, + CHART_PALETTE.teal, + CHART_PALETTE.black + ]; + let paletteLength = palette.length; + let ret = []; + for (let i = 0; i < size; i++) { + ret.push(palette[i % paletteLength]); + } + return ret; +}