If you have a local variable it makes no sense using an asynchronous call to pass it. Just pass it straight away as an argument:

var sampleData = [...];//this is your data

makeGraphs(sampleData);//call your function using it as an argument

And then:

function makeGraphs(data){//this is the parameter
     //use 'data' here

Related Query

More Query from same tag