mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
filter out all nan series (#7313)
This commit is contained in:
parent
97718daea3
commit
7192d36513
@ -1112,16 +1112,22 @@ class NVD3TimeSeriesViz(NVD3Viz):
|
|||||||
series_title = series_title + (title_suffix,)
|
series_title = series_title + (title_suffix,)
|
||||||
|
|
||||||
values = []
|
values = []
|
||||||
|
non_nan_cnt = 0
|
||||||
for ds in df.index:
|
for ds in df.index:
|
||||||
if ds in ys:
|
if ds in ys:
|
||||||
d = {
|
d = {
|
||||||
'x': ds,
|
'x': ds,
|
||||||
'y': ys[ds],
|
'y': ys[ds],
|
||||||
}
|
}
|
||||||
|
if not np.isnan(ys[ds]):
|
||||||
|
non_nan_cnt += 1
|
||||||
else:
|
else:
|
||||||
d = {}
|
d = {}
|
||||||
values.append(d)
|
values.append(d)
|
||||||
|
|
||||||
|
if non_nan_cnt == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
d = {
|
d = {
|
||||||
'key': series_title,
|
'key': series_title,
|
||||||
'values': values,
|
'values': values,
|
||||||
|
Loading…
Reference in New Issue
Block a user