external JSON File load

414 views
Skip to first unread message

sumit bansal

unread,
Dec 16, 2013, 5:10:18 AM12/16/13
to javascript-information...@googlegroups.com
Hi Sir,

i am using Jit.js for creating tree map.

if i am try to load json file as external json file then the tree map should not appear.  

can you please tell me how to load external json file inside the js. 

Please provide me solution as soon as possible.

GaryBartlett

unread,
Dec 16, 2013, 10:19:13 PM12/16/13
to javascript-information...@googlegroups.com
Hi Sumit,

Here's what I did:

Find the following code:

=====
function init(){  
    //init data 
    var json = {
=====
 and replace it (and all the jason data)  as far as 
 
     //end
    //init Spacetree
    //Create a new ST instance

with
=====
var json = (function() {
        var json = null;
        $.ajax({
            'async': false,
            'global': false,
            'url': "myjasonfile.json",
            'dataType': "json",
            'success': function (data) {
                json = data;
            }
        });
        return json;
    })();
=====

HTH

Gary

sumit bansal

unread,
Dec 17, 2013, 12:35:09 PM12/17/13
to javascript-information...@googlegroups.com
Hi Gary,

Thanx a lot for your quick response. i solve my issue.

i have one more issue if u can help i really appreciate how i can put legend inside the tree map.i need to define 3 color range according to that color range value should be passing to each node of tree map.

Is it possible to put legend in tree map.


Thanks & Regards
Sumit Bansal


--
You received this message because you are subscribed to a topic in the Google Groups "JavaScript InfoVis Toolkit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/javascript-information-visualization-toolkit/BXt-VOX6QK0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to javascript-information-visua...@googlegroups.com.
To post to this group, send email to javascript-information...@googlegroups.com.
Visit this group at http://groups.google.com/group/javascript-information-visualization-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Sudhakar sekar

unread,
Apr 8, 2017, 3:13:07 AM4/8/17
to JavaScript InfoVis Toolkit
i am facing the same problem in SpaceTree?

if i am try to load json file as external json file then the SpaceTree map should not appear.  

can you please tell me how to load external json file inside the js. 

Please provide me solution as soon as possible.
                Thank You....
Reply all
Reply to author
Forward
0 new messages