diff --git a/superset/assets/src/visualizations/nvd3/LineMulti/LineMulti.jsx b/superset/assets/src/visualizations/nvd3/LineMulti/LineMulti.jsx index 525a0f0944c7b..42efb7b013d93 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 80ed849e3dc38..bc6873a9d06e2 100644 --- a/superset/assets/src/visualizations/nvd3/utils.js +++ b/superset/assets/src/visualizations/nvd3/utils.js @@ -170,7 +170,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; }