{"action":"opened","issue":{"url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/434","repository_url":"https://api.github.com/repos/jtblin/angular-chart.js","labels_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/434/labels{/name}","comments_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/434/comments","events_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/434/events","html_url":"https://github.com/jtblin/angular-chart.js/issues/434","id":165813922,"number":434,"title":"More series shifting in one autoupdating chart","user":{"login":"pietro-fragnito","id":7511015,"avatar_url":"https://avatars.githubusercontent.com/u/7511015?v=3","gravatar_id":"","url":"https://api.github.com/users/pietro-fragnito","html_url":"https://github.com/pietro-fragnito","followers_url":"https://api.github.com/users/pietro-fragnito/followers","following_url":"https://api.github.com/users/pietro-fragnito/following{/other_user}","gists_url":"https://api.github.com/users/pietro-fragnito/gists{/gist_id}","starred_url":"https://api.github.com/users/pietro-fragnito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietro-fragnito/subscriptions","organizations_url":"https://api.github.com/users/pietro-fragnito/orgs","repos_url":"https://api.github.com/users/pietro-fragnito/repos","events_url":"https://api.github.com/users/pietro-fragnito/events{/privacy}","received_events_url":"https://api.github.com/users/pietro-fragnito/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-15T15:27:28Z","updated_at":"2016-07-15T15:27:28Z","closed_at":null,"body":"Hi!\r\n\r\nI developed an auto-updating live chart, shifting its serie after each 2 seconds:\r\n\r\n`function (WidgetService, $scope, $interval) {\r\n        var maximum = 60;\r\n        $scope.data = [[]];\r\n        $scope.labels = [];\r\n        $scope.series = ['Consumption1','Consumption2'];\r\n\r\n        $scope.options = {\r\n            animation: false,\r\n            showScale: true,\r\n            showTooltips: false,\r\n            pointDot: false,\r\n            datasetStrokeWidth: 0.5\r\n        };\r\n        \r\n        // Update the dataset at 25FPS for a smoothly-animating chart\r\n        $interval(function () {\r\n            getLiveChartData();\r\n        }, 2000);\r\n\r\n        function getLiveChartData(){\r\n\r\n            if ($scope.data[0].length) {\r\n                $scope.labels = $scope.labels.slice(1);\r\n                $scope.data[0] = $scope.data[0].slice(1);\r\n            }\r\n\r\n            while ($scope.data[0].length < maximum) {\r\n                $scope.labels.push('');\r\n                getLastConsumptionValue();\r\n                $scope.data[0].push($scope.lastValue);\r\n            }\r\n        }\r\n\r\n        function getLastConsumptionValue(){\r\n\r\n            WidgetService.C_04_01_getLastConsumptionSample.query({\r\n                prosumer: \"piefragn\", //da parametrizzare\r\n                status: status\r\n            }, function (result) {\r\n                // response\r\n                $scope.lastValue =  result.liveValue;\r\n            });\r\n        }\r\n}`\r\n\r\nHow can I put in the same chart two shifting series? I try with this (as example)\r\n\r\n`function getLiveChartData(){\r\n\r\n            $scope.data = [[],[]];\r\n            if ($scope.data[0].length) {\r\n                $scope.labels = $scope.labels.slice(1);\r\n                $scope.data[0] = $scope.data[0].slice(1);\r\n                $scope.data[1] = $scope.data[1].slice(1);\r\n\r\n            }\r\n\r\n            while ($scope.data[0].length < maximum) {\r\n                $scope.labels.push('');\r\n                getLastConsumptionValue();\r\n                $scope.data[0].push($scope.lastValue);\r\n                $scope.data[1].push($scope.lastValue+20);  //example here\r\n            }\r\n        }`\r\n\r\nCan you provide a little guide in order to have more series live updating with shifting in one chart?\r\n\r\nThanks a lot"}}
{"actor":{"display_login":"pietro-fragnito"}}