You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/10/26 19:00:28 UTC

[incubator-superset] branch master updated: Fix box_plot NaN issue (#3722)

This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c4b6324  Fix box_plot NaN issue (#3722)
c4b6324 is described below

commit c4b6324e74398df206abef0f0fd79807a6364252
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Thu Oct 26 12:00:22 2017 -0700

    Fix box_plot NaN issue (#3722)
    
    fixes https://github.com/apache/incubator-superset/issues/3712
---
 superset/assets/visualizations/nvd3_vis.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/superset/assets/visualizations/nvd3_vis.js b/superset/assets/visualizations/nvd3_vis.js
index 42fe9d2..69c7c64 100644
--- a/superset/assets/visualizations/nvd3_vis.js
+++ b/superset/assets/visualizations/nvd3_vis.js
@@ -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;
@@ -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);
     }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].