how to load a json object instead of json file
<p>I am trying to build a web project where I get details in JSON format, for example:</p>

<pre><code>{
    "file_id": 333, 
    "t": "2016-03-08 12:00:56"
}
</code></pre>

<p>I was trying to show the output in d3 js bar chart. The problem I am facing is the code I've got is working for a JSON file but not for an object deserialized from the JSON. Can any one help me out with this?</p>

<p>The part of the working script for JSON file is this:</p>

<pre><code>d3.json("FILENAME", function(error, data) {
    data = JSON.parse(data);
    x.domain(data.map(function(d) { return d.letter }));
    y.domain([0, d3.max(data, function(d) { return d.frequency })]);
</code></pre>

<p>If I change the filename to an object its not working.</p>