-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAnychart_Load_Data_From_Json.html
45 lines (43 loc) · 1.61 KB
/
Anychart_Load_Data_From_Json.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en" ng-app="MyApp">
<head>
<meta charset="UTF-8">
<title>Anychart AngularJS plugin demo.</title>
<script src="../node_modules/angular/angular.min.js"></script>
<script src="../node_modules/anychart/dist/js/anychart-base.min.js"></script>
<script src="../node_modules/anychart/dist/js/anychart-ui.min.js"></script>
<script src="../node_modules/anychart/dist/js/anychart-exports.min.js"></script>
<script src="../dist/anychart-angularjs.min.js"></script>
<link rel="stylesheet" href="../node_modules/anychart/dist/css/anychart-ui.min.css">
<link rel="stylesheet" href="../node_modules/anychart/dist/fonts/css/anychart-font.min.css">
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script>
(function() {
'use strict';
angular
.module('MyApp', ['anychart-angularjs'])
.controller('MyCtrl', ['$scope', '$http', 'AnychartService', function($scope, $http, AnychartService) {
var service = AnychartService;
$http.get('res/sample1.json').then(function(response) {
if (service.chart) //If the chart has been successfully instantiated.
service.chart.data(response.data);
});
}]);
})();
</script>
</head>
<body ng-controller="MyCtrl">
<div
anychart
ac-type="line"
style="width: 100%; height: 100%">
</div>
</body>
</html>