You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/07/06 14:09:27 UTC

[GitHub] mistercrunch closed pull request #5356: added a 'no_trend_line' option

mistercrunch closed pull request #5356: added a 'no_trend_line' option
URL: https://github.com/apache/incubator-superset/pull/5356
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/src/explore/controls.jsx b/superset/assets/src/explore/controls.jsx
index 0281fe10b2..310a0b6055 100644
--- a/superset/assets/src/explore/controls.jsx
+++ b/superset/assets/src/explore/controls.jsx
@@ -1462,6 +1462,14 @@ export const controls = {
     description: t('Whether to display the metric name as a title'),
   },
 
+  show_trend_line: {
+    type: 'CheckboxControl',
+    label: t('Show Trend Line'),
+    renderTrigger: true,
+    default: true,
+    description: t('Whether to display the trend line'),
+  },
+
   x_axis_showminmax: {
     type: 'CheckboxControl',
     label: t('X bounds'),
diff --git a/superset/assets/src/explore/visTypes.js b/superset/assets/src/explore/visTypes.js
index b0037ec5f4..e3b34e94d3 100644
--- a/superset/assets/src/explore/visTypes.js
+++ b/superset/assets/src/explore/visTypes.js
@@ -1239,6 +1239,7 @@ export const visTypes = {
         controlSetRows: [
           ['compare_lag', 'compare_suffix'],
           ['y_axis_format', null],
+          ['show_trend_line', null],
         ],
       },
     ],
diff --git a/superset/assets/src/visualizations/big_number.js b/superset/assets/src/visualizations/big_number.js
index 54d87fafd0..3d81c5545f 100644
--- a/superset/assets/src/visualizations/big_number.js
+++ b/superset/assets/src/visualizations/big_number.js
@@ -93,23 +93,24 @@ function bigNumberVis(slice, payload) {
 
   if (fd.viz_type === 'big_number') {
     // Drawing trend line
-
-    g.append('path')
-    .attr('d', function () {
-      return line(data);
-    })
-    .attr('stroke-width', 5)
-    .attr('opacity', 0.5)
-    .attr('fill', 'none')
-    .attr('stroke-linecap', 'round')
-    .attr('stroke', 'grey');
-
-    g = svg.append('g')
-    .attr('class', 'digits')
-    .attr('opacity', 1);
-
-    if (vCompare !== null) {
-      y = (height / 8) * 3;
+    if (fd.show_trend_line) {
+      g.append('path')
+        .attr('d', function () {
+          return line(data);
+        })
+        .attr('stroke-width', 5)
+        .attr('opacity', 0.5)
+        .attr('fill', 'none')
+        .attr('stroke-linecap', 'round')
+        .attr('stroke', 'grey');
+
+      g = svg.append('g')
+        .attr('class', 'digits')
+        .attr('opacity', 1);
+
+      if (vCompare !== null) {
+        y = (height / 8) * 3;
+      }
     }
 
     const c = scaleColor(vCompare);


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org