in the line in the example
d3.json("bullets.json", function(data) {
it is pulling the json data from a local file and passing it to the callback as data to be acted on. How can I change this so that a var I have defined previously is the data source as there doe not seem to be a method in the js to accept a pre-formed data object?
Reason? an embedded web viewer in an application which can dynamically create the html to render, but which has no access to the local file system.
EDIT let me be more specific then.. how can this dataset be fed into the code which generates the bullet chart from the data (when it is stored as an external file) ? it can't be by just going d3.select( etc etc as the sag object needs to be created to hang the title onto
var dataset = {"title":"Sales","subtitle":"£, 000","ranges":[50,200,400],"measures":[100,500],"markers":[250]};
d3.json("bullets.json", function(data) {
var svg = d3.select("body").selectAll("svg")
.data(data)
.enter().append("svg")