mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -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',
|
'28 days ago',
|
||||||
'90 days ago',
|
'90 days ago',
|
||||||
'1 year ago',
|
'1 year ago',
|
||||||
|
'100 year ago',
|
||||||
]),
|
]),
|
||||||
description: 'Timestamp from filter. This supports free form typing and ' +
|
description: 'Timestamp from filter. This supports free form typing and ' +
|
||||||
'natural language as in `1 day ago`, `28 days` or `3 years`',
|
'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;
|
const reduceXTicks = fd.reduce_x_ticks || false;
|
||||||
let stacked = false;
|
let stacked = false;
|
||||||
let row;
|
let row;
|
||||||
nv.addGraph(function () {
|
|
||||||
|
const drawGraph = function () {
|
||||||
switch (vizType) {
|
switch (vizType) {
|
||||||
case 'line':
|
case 'line':
|
||||||
if (fd.show_brush) {
|
if (fd.show_brush) {
|
||||||
@ -352,8 +353,10 @@ function nvd3Vis(slice) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return chart;
|
return chart;
|
||||||
});
|
};
|
||||||
|
|
||||||
|
const graph = drawGraph();
|
||||||
|
nv.addGraph(graph);
|
||||||
slice.done(payload);
|
slice.done(payload);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user