You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2017/03/15 15:37:48 UTC

zeppelin git commit: [ZEPPELIN-2253] Piechart won't render when column selected as 'key' is changed

Repository: zeppelin
Updated Branches:
  refs/heads/master 623b4ace9 -> f2c865aaa


[ZEPPELIN-2253] Piechart won't render when column selected as 'key' is changed

### What is this PR for?
* Fixes issue with pie chart rendering, if user changes pie chart's domain
* When pie chart's key(domain) is changed, this error is logged:
  'Uncaught TypeError: arcs[idx] is not a function at pie.js:358'
* Even if user changes the key and values again, chart remains broken
* Fix: set this.chart to null, which makes render function to initialize new
pie chart constructor
### What type of PR is it?
[Bug Fix]

### What is the Jira issue?
* [ZEPPELIN-533](https://issues.apache.org/jira/browse/ZEPPELIN-2253)

### How should this be tested?
* Create a new pie chart using built in visualization
* Remove column selected as 'key'
* Add a new column as 'key'
* Chart is rendered perfectly

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: ess_ess <sr...@gmail.com>

Closes #2132 from sravan-s/ZEPPELIN-2253 and squashes the following commits:

310aecf [ess_ess] Initialize chart to null inside 'render()'


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

Branch: refs/heads/master
Commit: f2c865aaacb3788286de076246695a35fff277f8
Parents: 623b4ac
Author: ess_ess <sr...@gmail.com>
Authored: Tue Mar 14 13:27:16 2017 +0530
Committer: Lee moon soo <mo...@apache.org>
Committed: Wed Mar 15 08:37:44 2017 -0700

----------------------------------------------------------------------
 .../src/app/visualization/builtins/visualization-piechart.js       | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/f2c865aa/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js b/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js
index 8c8f8f2..9cc7922 100644
--- a/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js
+++ b/zeppelin-web/src/app/visualization/builtins/visualization-piechart.js
@@ -33,6 +33,8 @@ export default class PiechartVisualization extends Nvd3ChartVisualization {
   };
 
   render(pivot) {
+    // [ZEPPELIN-2253] New chart function will be created each time inside super.render()
+    this.chart = null;
     var d3Data = this.d3DataFromPivot(
       pivot.schema,
       pivot.rows,