You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2015/10/08 10:34:30 UTC

ignite git commit: ignite-843 Fixed pie chart

Repository: ignite
Updated Branches:
  refs/heads/ignite-843 9b21b9154 -> 1e0010447


ignite-843 Fixed pie chart


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

Branch: refs/heads/ignite-843
Commit: 1e0010447de0aec3f101d9640c96fa1afc939eaf
Parents: 9b21b91
Author: Andrey <an...@gridgain.com>
Authored: Thu Oct 8 15:34:21 2015 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Thu Oct 8 15:34:21 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1e001044/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 9793f90..5f724d7 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
@@ -794,7 +794,7 @@ consoleModule.controller('sqlController',
         return datum;
     }
 
-    function _chartDatumLblNum(paragraph) {
+    function _pieChartDatum(paragraph) {
         var datum = [];
 
         if (paragraph.chartColumnsConfigured() && !paragraph.chartTimeLineEnabled()) {
@@ -803,8 +803,8 @@ consoleModule.controller('sqlController',
 
                 var values = _.map(paragraph.rows, function (row) {
                     return {
-                        lbl: _chartLabel(row, paragraph.chartKeyCols[0].value, index++),
-                        val: _chartNumber(row, valCol.value, 0)
+                        x: row[paragraph.chartKeyCols[0].value],
+                        y: _chartNumber(row, valCol.value, index++)
                     }
                 });
 
@@ -848,14 +848,6 @@ consoleModule.controller('sqlController',
         return $common.isEmptyArray(cols) ? dflt : _.map(cols, _colLabel).join(', ');
     }
 
-    function _xLbl(d) {
-        return d.lbl;
-    }
-
-    function _yVal(d) {
-        return d.val;
-    }
-
     function _xX(d) {
         return d.x;
     }
@@ -922,7 +914,7 @@ consoleModule.controller('sqlController',
     }
 
     function _pieChart(paragraph) {
-        var datum = _chartDatumLblNum(paragraph);
+        var datum = _pieChartDatum(paragraph);
 
         if (datum.length == 0)
             datum = [{values: []}];
@@ -934,8 +926,8 @@ consoleModule.controller('sqlController',
                         type: 'pieChart',
                         height: 400,
                         duration: 0,
-                        x: _xLbl,
-                        y: _yVal,
+                        x: _xX,
+                        y: _yY,
                         showLabels: true,
                         labelThreshold: 0.05,
                         labelType: 'percent',