total in global graph tooltip

This commit is contained in:
Gwenhael Le Moine 2017-12-15 19:38:48 +01:00
parent 9a16fa1069
commit 923957aab4
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -93,7 +93,16 @@ app.component('dashboard',
return ` return `
<h2>${e.value}</h2> <h2>${e.value}</h2>
<table> <table>
<tbody>
${prepare_series(e.series).map((s) => { return format_line(s); }).join("")} ${prepare_series(e.series).map((s) => { return format_line(s); }).join("")}
</tbody>
<tfoot>
<tr>
<td> </td>
<td style="text-align: right; text-decoration: underline; font-weight: bold;">Total</td>
<td style="text-align: right; font-weight: bold;">${e.series.reduce((memo, serie) => { return memo + serie.value; }, 0)}</td>
</tr>
</tfoot>
</table> </table>
`; `;
} }