Advertisement
pendekar_langit

belajar angular

Feb 14th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. app.controller('line-controller',
  2. function ($scope, $http) {
  3. var url = "http://learningbasicnetwork.org/network/";
  4. setInterval(function(){
  5. $http.get(url).success( function(response) {
  6. $scope.data_line = response.net;
  7. // nvd3
  8. $scope.options_line = {
  9. chart: {
  10. type: 'cumulativeLineChart',
  11. height: 450,
  12. margin : {
  13. top: 20,
  14. right: 20,
  15. bottom: 50,
  16. left: 65
  17. },
  18. y: function(d){ return d[0]; },
  19. x: function(d){ return d[1]; },
  20. average: function(d) { return d.mean; },
  21.  
  22. color: d3.scale.category10().range(),
  23. duration: 300,
  24. useInteractiveGuideline: true,
  25. clipVoronoi: false,
  26.  
  27. xAxis: {
  28. axisLabel: 'Minutes',
  29. tickFormat: function(d) {
  30. return d3.time.format('%M:%S')(new Date(d))
  31. },
  32. showMaxMin: false,
  33. staggerLabels: true
  34. },
  35.  
  36. yAxis: {
  37. axisLabel: 'Bandwidth',
  38. tickFormat: function(d){
  39. return d3.format(',.1f')(d)+"kB/s";
  40. },
  41. axisLabelDistance: 0
  42. }
  43. }
  44. };
  45. });
  46. }, 5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement