From eea56bb8adbaa98f724fe869bf46614dae159f8d Mon Sep 17 00:00:00 2001 From: Jeff Niu Date: Wed, 27 Dec 2017 19:31:11 -0500 Subject: [PATCH] Remedy for dual axis annotation --- superset/assets/visualizations/nvd3_vis.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/superset/assets/visualizations/nvd3_vis.js b/superset/assets/visualizations/nvd3_vis.js index 470f4990945dc..b60c32a0e57c0 100644 --- a/superset/assets/visualizations/nvd3_vis.js +++ b/superset/assets/visualizations/nvd3_vis.js @@ -553,7 +553,7 @@ function nvd3Vis(slice, payload) { } else { xMin = chart.xAxis.scale().domain()[0].valueOf(); xMax = chart.xAxis.scale().domain()[1].valueOf(); - xScale = chart.xScale(); + xScale = chart.xScale ? chart.xScale() : d3.scale.linear(); } if (Array.isArray(formulas) && formulas.length) { @@ -591,8 +591,8 @@ function nvd3Vis(slice, payload) { })); data.push(...formulaData); } - - const annotationHeight = chart.yAxis.scale().range()[0]; + const yAxis = chart.yAxis1 ? chart.yAxis1 : chart.yAxis; + const annotationHeight = yAxis.scale().range()[0]; const tipFactory = layer => d3tip() .attr('class', 'd3-tip') .direction('n')