Skip to content

Commit

Permalink
[bugfix] bignumber comparison wrong with neg values
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Dec 2, 2016
1 parent 168a252 commit 113bbc2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion superset/assets/visualizations/big_number.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ function bigNumberVis(slice) {
if (json.compare_lag > 0) {
const pos = data.length - (json.compare_lag + 1);
if (pos >= 0) {
vCompare = (v / data[pos][1]) - 1;
const vAnchor = data[pos][1];
vCompare = (v - vAnchor) / Math.abs(vAnchor);
}
}
const dateExt = d3.extent(data, (d) => d[0]);
Expand Down

0 comments on commit 113bbc2

Please sign in to comment.