My web page allows the user to display multiple time series on a chart, and I use queue.js to navigate and get this data asynchronously, for example:
queue()
.defer(d3.json, "api/TransactionCost/?marketCode=" + marketCode1)
.defer(d3.json, "api/TransactionCost/?marketCode=" + marketCode2)
.defer(d3.json, "api/TransactionCost/?marketCode=" + marketCode3)
.await(onDataLoaded);
function onDataLoaded(error, json1, json2, json3) {
}
I want the user to be able to request additional lines if they wish, which would mean that I need to make additional “defer” calls. I would like to know how to dynamically add additional “deferred” calls (if possible), as well as how to create the onDataLoaded function so that it can handle a variable number of parameters.
source
share