mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[bugfix] bignumber comparison wrong with neg values (#1743)
* [bugfix] bignumber comparison wrong with neg values * Handling zero div
This commit is contained in:
parent
b045075a96
commit
a3106bcb3d
@ -35,7 +35,10 @@ 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];
|
||||
if (vAnchor !== 0) {
|
||||
vCompare = (v - vAnchor) / Math.abs(vAnchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
const dateExt = d3.extent(data, (d) => d[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user