feat(ui): som of multiseries
This commit is contained in:
parent
e4ec766323
commit
343dc44189
1 changed files with 2 additions and 3 deletions
|
|
@ -281,15 +281,14 @@ export default class Widget {
|
|||
}
|
||||
|
||||
calculateTotalSeries = (data: any): any => {
|
||||
return data.map(entry => {
|
||||
return Array.isArray(data) ? data.map(entry => {
|
||||
const total = Object.keys(entry)
|
||||
.filter(key => key !== 'timestamp' && key !== 'time')
|
||||
.reduce((sum, key) => sum + entry[key], 0);
|
||||
return { ...entry, Total: total };
|
||||
});
|
||||
}) : [];
|
||||
};
|
||||
|
||||
|
||||
setData(data: any, period: any) {
|
||||
const _data: any = {...data};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue