Skip to content

Commit

Permalink
Fix box_plot NaN issue (apache#3722)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored and michellethomas committed May 23, 2018
1 parent d9629ac commit 6551893
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions superset/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,7 @@ function nvd3Vis(slice, payload) {
case 'box_plot':
colorKey = 'label';
chart = nv.models.boxPlotChart();
chart.x(function (d) {
return d.label;
});
chart.x(d => d.label);
chart.staggerLabels(true);
chart.maxBoxWidth(75); // prevent boxes from being incredibly wide
break;
Expand Down Expand Up @@ -353,7 +351,8 @@ function nvd3Vis(slice, payload) {
chart.x2Axis.tickFormat(xAxisFormatter);
height += 30;
}
if (vizType !== 'dist_bar' && chart.xAxis && chart.xAxis.tickFormat) {
const isXAxisString = ['dist_bar', 'box_plot'].includes(vizType) >= 0;
if (!isXAxisString && chart.xAxis && chart.xAxis.tickFormat) {
chart.xAxis.tickFormat(xAxisFormatter);
}

Expand Down

0 comments on commit 6551893

Please sign in to comment.