diff --git a/superset/assets/src/visualizations/nvd3/LineMulti/LineMulti.jsx b/superset/assets/src/visualizations/nvd3/LineMulti/LineMulti.jsx index 3f5aff435046f..11d954460cdf0 100644 --- a/superset/assets/src/visualizations/nvd3/LineMulti/LineMulti.jsx +++ b/superset/assets/src/visualizations/nvd3/LineMulti/LineMulti.jsx @@ -9,7 +9,7 @@ const propTypes = { width: PropTypes.number, height: PropTypes.number, annotationData: PropTypes.object, - datasource: PropTypes.array, + datasource: PropTypes.object, formData: PropTypes.object, onAddFilter: PropTypes.func, onError: PropTypes.func, diff --git a/superset/assets/src/visualizations/nvd3/utils.js b/superset/assets/src/visualizations/nvd3/utils.js index 86ee61f1ac6ef..b8d0d4df33d44 100644 --- a/superset/assets/src/visualizations/nvd3/utils.js +++ b/superset/assets/src/visualizations/nvd3/utils.js @@ -181,7 +181,7 @@ export function getMaxLabelSize(svg, axisClass) { const tickTexts = svg.selectAll(`.${axisClass} g.tick text`); if (tickTexts.length > 0) { const lengths = tickTexts[0].map(text => text.getComputedTextLength()); - return Math.ceil(Math.max(...lengths)); + return Math.ceil(Math.max(0, ...lengths)); } return 0; }