mirror of
https://github.com/apache/superset.git
synced 2026-04-25 11:04:48 +00:00
[bugfix] bignumber comparison wrong with neg values (#1743)
* [bugfix] bignumber comparison wrong with neg values * Handling zero div
This commit is contained in:
committed by
GitHub
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]);
|
||||
|
||||
Reference in New Issue
Block a user