ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/2] ignite git commit: IGNITE-843 Enhance chart options: show columns with series color.
Date Thu, 22 Oct 2015 09:06:36 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 b6aa9873f -> 1a8ada11c


IGNITE-843 Enhance chart options: show columns with series color.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/764d3de6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/764d3de6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/764d3de6

Branch: refs/heads/ignite-843-rc1
Commit: 764d3de63c124c83002849dd20a431808100d4ca
Parents: 1f2760c
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Thu Oct 22 16:05:44 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Oct 22 16:05:44 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js        | 15 ++++++++++-----
 .../src/main/js/views/sql/chart-settings.jade        |  2 +-
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/764d3de6/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index 213f64d..1e7ca99 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -61,6 +61,15 @@ consoleModule.controller('sqlController',
     // We need max 1800 items to hold history for 30 mins in case of refresh every second.
     var HISTORY_LENGTH = 1800;
 
+    var CHART_COLORS = [
+        '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f',
'#bcbd22', '#17becf',
+        '#ffbb78', '#98df8a', '#ff9896', '#c5b0d5', '#aec7e8', '#c49c94', '#f7b6d2', '#c7c7c7',
'#dbdb8d', '#9edae5'
+    ];
+
+    $scope.chartColor = function(index) {
+        return {"background-color": CHART_COLORS[index]};
+    };
+
     $scope.chartRemoveKeyColumn = function (paragraph, index) {
         paragraph.chartKeyCols.splice(index, 1);
 
@@ -1015,11 +1024,6 @@ consoleModule.controller('sqlController',
         });
     }
 
-    var CHART_COLORS = [
-        '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f',
'#bcbd22', '#17becf',
-        '#ffbb78', '#98df8a', '#ff9896', '#c5b0d5', '#aec7e8', '#c49c94', '#f7b6d2', '#c7c7c7',
'#dbdb8d', '#9edae5'
-    ];
-
     function _barChart(paragraph) {
         var datum = _chartDatum(paragraph);
 
@@ -1042,6 +1046,7 @@ consoleModule.controller('sqlController',
                         tickFormat: d3.format(',.2f')
                     },
                     color: CHART_COLORS,
+                    stacked: true,
                     showControls: true
                 }
             };

http://git-wip-us.apache.org/repos/asf/ignite/blob/764d3de6/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/sql/chart-settings.jade b/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
index 4b350a4..128828c 100644
--- a/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
+++ b/modules/control-center-web/src/main/js/views/sql/chart-settings.jade
@@ -33,6 +33,6 @@
                 label Y axis (accept only numeric columns)
                 ul.chart-settings-columns-list(dnd-list='paragraph.chartValCols' dnd-drop='chartAcceptValColumn(paragraph,
item)')
                     li(ng-repeat='col in paragraph.chartValCols track by $index')
-                        .btn.btn-success.btn-chart-column {{col.label}}
+                        .btn.btn-success.btn-chart-column(ng-style='chartColor($index)')
{{col.label}}
                             i.fa.fa-close(ng-click='chartRemoveValColumn(paragraph, $index)')
 


Mime
View raw message