Feat: Doughnut chart react on datas

This commit is contained in:
2018-12-03 11:53:01 +01:00
parent f28d22ecb6
commit c469976d50
5 changed files with 51 additions and 38 deletions

View File

@@ -25,3 +25,8 @@ function strContains (string, words, invert) {
}
}
export function total (row, field='Montant') {
var sum = row.map(x => parseFloat(x[field]))
.reduce((sum, x) => sum + x, 0)
return Math.round(sum)
}