Help! - How to use a JSON file - on my webserver - to be used as data in a DataTable for Google Charts?

28 views
Skip to first unread message

JJAsher ASHER

unread,
Nov 11, 2017, 10:36:28 AM11/11/17
to Google Visualization API
Hi,

I have spent days on this with no result.

I want to use Google Charts but instead of hard-coding the data within the Java Script, I want to use data in a file I have placed on my server.

The file called test.json, is located on say www.mysebsite.com/test.json - and contains the following:

{
  cols: [{id: 'A', label: 'Task', type: 'string'},
         {id: 'B', label: 'Hours per Day', type: 'number'}
        ],
  rows: [{c:[{v: 'Work'},    {v: 11}]},
         {c:[{v: 'Eat'},     {v: 2} ]},
         {c:[{v: 'Commute'}, {v: 2} ]},       
         {c:[{v: 'Watch TV'}, {v: 2}]},       
         {c:[{v: 'Sleep'},    {v: 8}]}      
        ]
}


By referring to the URL above, how can I get this to populate into data as a DataTable?

Thanks in Anticipation
Reply all
Reply to author
Forward
0 new messages