Topic: Json and jvector map

hello,

I want use jvectorMap (http://jvectormap.owl-hollow.net/) in my application to generate automatic data map.

I make a table, I create javascript, all work fine but

In my controler, i generate json for the data map like this :

def show ...
respond_to do |format|
      ...
      format.json { render :json => @users.data }
    end

and my config for JvectorMap

$('#example-map-3').vectorMap({
    values: 1.json,
    scaleColors: ['#C8EEFF', '#006491'],
    normalizeFunction: 'polynomial',
    hoverOpacity: 0.7,
    hoverColor: false
});

the json file say (name 1.json) : [{"d01":213,"d02":899,"d03":561....}]

So 2 questions :

- the data doesn't work if i have brackets [] in the file. How to erase or no generate ?

- Can I have a generic name, like data.json, for the json file what I can put in the config of Jvector ?

Last edited by pasqal (2011-11-24 11:07:17)

Re: Json and jvector map

Did you get a solution to this?? Have you successfully used Jvectormap to render Json data? Please let me know soon.

Thanks!