From 8dce101ebb9771a03e48f6f818f7d1d1905a5879 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Tue, 24 Jun 2014 10:19:52 +0900 Subject: [PATCH] Add sample for load json from url - #379 --- htdocs/data/c3_test_3.json | 6 ++++++ htdocs/samples/data_url.html | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 htdocs/data/c3_test_3.json diff --git a/htdocs/data/c3_test_3.json b/htdocs/data/c3_test_3.json new file mode 100644 index 0000000..c08c9c7 --- /dev/null +++ b/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 } +] diff --git a/htdocs/samples/data_url.html b/htdocs/samples/data_url.html index c30390a..6a4a66f 100644 --- a/htdocs/samples/data_url.html +++ b/htdocs/samples/data_url.html @@ -37,6 +37,16 @@ }); }, 3000); + setTimeout(function () { + chart.load({ + url: '/data/c3_test_3.json', + mimeType: 'json', + keys: { + value: ['data1', 'data2'] + } + }); + }, 4000); +