Skip to content

Commit

Permalink
Fix issue #7 : formula is invisible in metric viz.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Charlot committed Mar 19, 2018
1 parent 14184d1 commit 055554c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions public/decorators/lib/apply_formula.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,14 @@ export function AggResponseFormulaProvider(Private) {

// Apply
if (!isEmpty(computed)) {
const isRowValue = isObject(table.rows[0]);
const isRowValue = isObject(table.rows[0][0]);
each(table.rows, (row, i) => {
each(computed, (data, colIndex) => {
const value = (data.isArray ? data.value[i] || null : data.value);
let rv = row[colIndex];
if (isRowValue) {
rv.value = value;
row[colIndex].value = value;
} else {
rv = value;
row[colIndex] = value;
}
});
});
Expand Down

0 comments on commit 055554c

Please sign in to comment.