-
Notifications
You must be signed in to change notification settings - Fork 3
/
async_data_load.html
52 lines (45 loc) · 1.37 KB
/
async_data_load.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
46
47
48
49
50
51
52
<!doctype html>
<html>
<head>
<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="../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../dist/anychart-jquery.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 {
margin: 0;
padding: 0;
}
#load {
margin: 15px 0 10px 15px;
}
#container {
width: 640px;
height: 480px;
}
</style>
</head>
<body>
<button id="load">load new data</button>
<div id="container"></div>
<script>
var cnt = $('#container');
cnt.anychart('line', [3, 1, 2]);
$('#load').click(function () {
$.ajax({
url: 'assets/data.json',
type: 'GET',
dataType: 'json'
}).done(function (json) {
cnt.anychart().data(json);
})
});
</script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.6.3/iframeResizer.contentWindow.min.js"></script>
</body>
</html>