mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Fixed a bug with switching viz_type in exploreV2 (#1631)
- Issue: when switching from a viz_type outside nvd3 to a viz_type in nvd3, the Chart Container doesn't draw new graph - Fix: The reason was somehow the function inside nv.addGraph() wasn't called, extract the function outside and explicitly calling it solve the problem
This commit is contained in:
parent
2c068a1a15
commit
0acf26b37c
@ -1112,6 +1112,7 @@ export const fields = {
|
||||
'28 days ago',
|
||||
'90 days ago',
|
||||
'1 year ago',
|
||||
'100 year ago',
|
||||
]),
|
||||
description: 'Timestamp from filter. This supports free form typing and ' +
|
||||
'natural language as in `1 day ago`, `28 days` or `3 years`',
|
||||
|
@ -104,7 +104,8 @@ function nvd3Vis(slice) {
|
||||
const reduceXTicks = fd.reduce_x_ticks || false;
|
||||
let stacked = false;
|
||||
let row;
|
||||
nv.addGraph(function () {
|
||||
|
||||
const drawGraph = function () {
|
||||
switch (vizType) {
|
||||
case 'line':
|
||||
if (fd.show_brush) {
|
||||
@ -352,8 +353,10 @@ function nvd3Vis(slice) {
|
||||
}
|
||||
|
||||
return chart;
|
||||
});
|
||||
};
|
||||
|
||||
const graph = drawGraph();
|
||||
nv.addGraph(graph);
|
||||
slice.done(payload);
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user