Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.controller('line-controller',
- function ($scope, $http) {
- var url = "http://learningbasicnetwork.org/network/";
- setInterval(function(){
- $http.get(url).success( function(response) {
- $scope.data_line = response.net;
- // nvd3
- $scope.options_line = {
- chart: {
- type: 'cumulativeLineChart',
- height: 450,
- margin : {
- top: 20,
- right: 20,
- bottom: 50,
- left: 65
- },
- y: function(d){ return d[0]; },
- x: function(d){ return d[1]; },
- average: function(d) { return d.mean; },
- color: d3.scale.category10().range(),
- duration: 300,
- useInteractiveGuideline: true,
- clipVoronoi: false,
- xAxis: {
- axisLabel: 'Minutes',
- tickFormat: function(d) {
- return d3.time.format('%M:%S')(new Date(d))
- },
- showMaxMin: false,
- staggerLabels: true
- },
- yAxis: {
- axisLabel: 'Bandwidth',
- tickFormat: function(d){
- return d3.format(',.1f')(d)+"kB/s";
- },
- axisLabelDistance: 0
- }
- }
- };
- });
- }, 5000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement