ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-1762 Save bar chart and area chart settings.
Date Mon, 16 Nov 2015 08:37:43 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 3e4b0ab0d -> 796489001


IGNITE-1762 Save bar chart and area chart settings.


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

Branch: refs/heads/ignite-843-rc1
Commit: 7964890013ad9740fb6c8075fd5f146d98cbd44c
Parents: 3e4b0ab
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Mon Nov 16 15:38:05 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Mon Nov 16 15:38:05 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 25 ++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/79648900/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 bf1a41e..4d36893 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
@@ -386,6 +386,8 @@ consoleModule.controller('sqlController',
         if (paragraph.result === new_result)
             return;
 
+        _saveChartSettings(paragraph);
+
         paragraph.result = new_result;
 
         if (paragraph.chart())
@@ -1089,6 +1091,24 @@ consoleModule.controller('sqlController',
         return '1';
     };
 
+    function _saveChartSettings(paragraph) {
+        if (!$common.isEmptyArray(paragraph.charts)) {
+            var chart = paragraph.charts[0].api.getScope().chart;
+
+            switch (paragraph.result) {
+                case 'bar':
+                    paragraph.barCharOptions = {stacked: chart.stacked()};
+
+                    break;
+
+                case 'area':
+                    paragraph.areaCharOptions = {style: chart.style()};
+
+                    break;
+            }
+        }
+    }
+
     function _chartApplySettings(paragraph, resetCharts) {
         if (resetCharts)
             paragraph.charts = [];
@@ -1239,7 +1259,7 @@ consoleModule.controller('sqlController',
                         tickFormat: _yAxisFormat
                     },
                     color: CHART_COLORS,
-                    stacked: true,
+                    stacked: paragraph.barCharOptions ? paragraph.barCharOptions.stacked
: true,
                     showControls: true
                 }
             };
@@ -1340,7 +1360,8 @@ consoleModule.controller('sqlController',
                         axisLabel:  _yAxisLabel(paragraph),
                         tickFormat: _yAxisFormat
                     },
-                    color: CHART_COLORS
+                    color: CHART_COLORS,
+                    style: paragraph.areaCharOptions ? paragraph.areaCharOptions.style :
'stack'
                 }
             };
 


Mime
View raw message