betodealmeida commented on a change in pull request #4756: Improve xAxis ticks, 
thinner bottom margin
URL: 
https://github.com/apache/incubator-superset/pull/4756#discussion_r179228737
 
 

 ##########
 File path: superset/assets/visualizations/nvd3_vis.js
 ##########
 @@ -160,31 +145,57 @@ function nvd3Vis(slice, payload) {
       svg = d3.select(slice.selector).append('svg');
     }
     let height = slice.height();
+    const isTimeSeries = [
+      'line', 'dual_line', 'area', 'compare', 'bar', 
'time_pivot'].indexOf(vizType) >= 0;
+
+    // Handling xAxis ticks settings
+    let xLabelRotation = 0;
+    let staggerLabels = false;
+    if (fd.x_ticks_layout === 'auto') {
+      if (['column', 'dist_bar'].indexOf(vizType) >= 0) {
+        xLabelRotation = 45;
+      } else if (isTimeSeries) {
+        staggerLabels = true;
+      }
+    } else if (fd.x_ticks_layout === 'staggered') {
+      staggerLabels = true;
+    } else if (fd.x_ticks_layout === '45°') {
+      if (fd.show_brush === true || fd.show_brush === 'yes') {
+        const error = t('You cannot use 45° tick layout along with the time 
range filter');
+        slice.error(error);
+        return null;
+      }
+      xLabelRotation = 45;
+    }
+    const showBrush = (
+      fd.show_brush === true ||
+      fd.show_brush === 'yes' ||
 
 Review comment:
   ^ here it is, the other use for `isTruthy`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to