Browse Source

Add sample for load json from url - #379

pull/394/head
Masayuki Tanaka 11 years ago
parent
commit
8dce101ebb
  1. 6
      htdocs/data/c3_test_3.json
  2. 10
      htdocs/samples/data_url.html

6
htdocs/data/c3_test_3.json

@ -0,0 +1,6 @@
[
{ "id": 1, "name": "abc", "data1": 1200, "data2": 500 },
{ "id": 2, "name": "efg", "data1": 900, "data2": 600 },
{ "id": 3, "name": "pqr", "data1": 1150, "data2": 300 },
{ "id": 4, "name": "xyz", "data1": 1020, "data2": 900 }
]

10
htdocs/samples/data_url.html

@ -37,6 +37,16 @@
}); });
}, 3000); }, 3000);
setTimeout(function () {
chart.load({
url: '/data/c3_test_3.json',
mimeType: 'json',
keys: {
value: ['data1', 'data2']
}
});
}, 4000);
</script> </script>
</body> </body>
</html> </html>

Loading…
Cancel
Save