Perhaps the underlying problem is that the data being passed into the chart
does not have a value for every x-axis tick? This may be solvable without
editing the NVD3.
- Generate the x-series based on time duration and grain. If range is Jan 1 -
Jan 3 with daily granularity, then generate `[Jan 1, Jan 2, Jan 3]`.
- Left join generated series into data set. This would generate `{Jan 1: 10,
Jan 2: None, Jan 3: 7}'. Each metric would need to be left-joined into the
source series.
- Lines should then skip over missing points.
This logic should work for time series graphs. Jan 2 occurs between Jan 1 and
Jan 3, regardless of if any data is in the returned set. The approach would not
work for arbitrary dimensions as Superset does not have knowledge of the set of
values. Furthermore, this would mean that the first x-axis bounds would be
determined by the date range and not the returned set.
In response to approaches:
- null to be replaced by 0: This does feel like a hack that alters the
underlying data.
- lines in line chat to be broken off, show a line on the left, and a line on
the right: I agree with @davidhassan that this is probably the best solution.
It accurately visualizes the returned data.
- lines to skip over missing points, connecting the dots on either side: This
seems like the worst option as the visual is out of sync with the underlying
data (more so than replacing with 0s, in my opinion, as 0 is "closer" to null
than other values).
[ Full content available at:
https://github.com/apache/incubator-superset/issues/5888 ]
This message was relayed via gitbox.apache.org for [email protected]