i running code , getting nothing in output. there no error in buildup not able find out mistakes. can tell me issue?? regards
<!doctype html> <html> <head> <meta charset="utf-8" /> <script src="dependencies/angular/angular.js"></script> <script src="dependencies/d3/d3.js"></script> <script src="dependencies/nvd3/nv.d3.js"></script> <script src="dependencies/angularjs-nvd3-directives/angularjs-nvd3-directives.js"></script> <link rel="stylesheet"href="dependencies/nvd3/nv.d3.css"> <script> var app = angular.module("nvd3testapp", ['nvd3chartdirectives']); function examplectrl($scope){ $scope.exampledata = [ { "key": "series 1", "values": [ [ 1025409600000 , 0] , [ 1309406400000 , 121.92388706072] , [ 1312084800000 , 116.70036100870] , [ 1314763200000 , 88.367701837033] , [ 1317355200000 , 59.159665765725] , [ 1320033600000 , 79.793568139753] , [ 1322629200000 , 75.903834028417] , [ 1325307600000 , 72.704218209157] , [ 1327986000000 , 84.936990804097] , [ 1330491600000 , 93.388148670744]] }]; } </script> </head> <body ng-app='nvd3testapp'> <div ng-controller="examplectrl"> <nvd3-line-chart data="exampledata" showxaxis="true" showyaxis="true" tooltips="true" interactive="true"> </nvd3-line-chart> </div> </body> </html>
i believe have solved issue code. didn't load css may have add yours make right. move script tags right before closing </body>
tag. way code not run before dom loads. prevent headaches in future.
live preview: http://codepen.io/larryjoelane/pen/omqqmd
javascript/angular code:
var app = angular.module("nvd3testapp", ['nvd3chartdirectives']).controller("examplectrl", function($scope) { $scope.exampledata = [{ "key": "series 1", "values": [ [1025409600000, 0], [1309406400000, 121.92388706072], [1312084800000, 116.70036100870], [1314763200000, 88.367701837033], [1317355200000, 59.159665765725], [1320033600000, 79.793568139753], [1322629200000, 75.903834028417], [1325307600000, 72.704218209157], [1327986000000, 84.936990804097], [1330491600000, 93.388148670744] ] }]; })();
Comments
Post a Comment