From 923957aab4adae2c04745d729b02b239c8ac0c1b Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Fri, 15 Dec 2017 19:38:48 +0100 Subject: [PATCH] total in global graph tooltip --- public/ts/components/dashboard.ts | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/public/ts/components/dashboard.ts b/public/ts/components/dashboard.ts index 95af8bb..b390c9c 100644 --- a/public/ts/components/dashboard.ts +++ b/public/ts/components/dashboard.ts @@ -75,12 +75,12 @@ app.component('dashboard', tooltip: { contentGenerator: function(e) { let format_line = (serie) => { - return ` - - -${serie.key} -${serie.value} - + return ` + + + ${serie.key} + ${serie.value} + `; }; @@ -90,10 +90,19 @@ app.component('dashboard', return series.filter((s) => { return s.value != 0; }); }; - return ` +return `

${e.value}

-${prepare_series(e.series).map((s) => { return format_line(s); }).join("")} + + ${prepare_series(e.series).map((s) => { return format_line(s); }).join("")} + + + + + + + +
Total${e.series.reduce((memo, serie) => { return memo + serie.value; }, 0)}
`; }