d3 js - loading json without a http get

前端 未结 3 1378
无人共我
无人共我 2020-11-29 18:57

I am learning d3. There are certain ways of loading the data in d3 js. But all of them seem to make a HTTP GET. In my scenario, I already have the json data in a string. How

3条回答
  •  眼角桃花
    2020-11-29 19:20

    According to this example:

    http://phrogz.net/JS/d3-playground/#StockPrice_HTML

    Here they are storing the graph data within the variable $data, and setting it via the .data($data) function.

    I'd apply this method to whatever graph you are using.

提交回复
热议问题