diff --git a/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js b/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js index 4e3b2d405..d87af915b 100644 --- a/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js +++ b/packages/superset-ui-legacy-preset-chart-nvd3/src/NVD3Vis.js @@ -1080,13 +1080,15 @@ function nvd3Vis(element, props) { .call(chart); // Display styles for Time Series Annotations - d3.selectAll('.slice_container .nv-timeseries-annotation-layer.showMarkerstrue .nv-point') - .style('stroke-opacity', 1) - .style('fill-opacity', 1); - d3.selectAll('.slice_container .nv-timeseries-annotation-layer.hideLinetrue').style( - 'stroke-width', - 0, - ); + chart.dispatch.on('renderEnd.timeseries-annotation', () => { + d3.selectAll('.slice_container .nv-timeseries-annotation-layer.showMarkerstrue .nv-point') + .style('stroke-opacity', 1) + .style('fill-opacity', 1); + d3.selectAll('.slice_container .nv-timeseries-annotation-layer.hideLinetrue').style( + 'stroke-width', + 0, + ); + }); } }