Created
May 29, 2013 00:37
-
-
Save maowug/5667193 to your computer and use it in GitHub Desktop.
nvd3 in controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getRNIAapp.controller('nvd3TogoCtrlPC',function(rniaWrapper){ | |
| var chart; | |
| nv.addGraph(function() { | |
| chart = nv.models.parallelCoordinates() | |
| .width(nv.utils.windowSize().width*0.6) | |
| // .height(nv.utils.windowSize().height) | |
| // .dimensions(['nausea','temperature','headache','flu']); | |
| .dimensions(rniaWrapper.get('graphPCDataWrapper').dimensions); | |
| // console.log([{nausea:2, flu:"3", temperature:"0", headache:"1"}, | |
| // {nausea:3, flu:"1", temperature:"2", headache:"3"}]); | |
| // | |
| // console.log(rniaWrapper.get('graphPCDataWrapper').data); | |
| d3.select('#chart-nvd3TogoCtrlPC svg') | |
| .datum(rniaWrapper.get('graphPCDataWrapper').data) | |
| .transition() | |
| .duration(1000) | |
| .call(chart); | |
| // .datum([{nausea:2, flu:"3", temperature:"0", headache:"1"}, | |
| // {nausea:3, flu:"1", temperature:"2", headache:"3"}]) | |
| chart.dispatch.on('brush', function(e) { | |
| nv.log(e); | |
| }); | |
| nv.utils.windowResize(chart.update); | |
| return chart; | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment