GoogleCharts:如何将参数传递到回调(JavaScript)中?

GoogleCharts:如何将参数传递到回调(JavaScript)中?,charts,google-visualization,Charts,Google Visualization,我有以下代码: google.charts.setOnLoadCallback( drawChart ); function drawChart() { ... } 我需要将一个名为chartID的参数传递到drawChart()函数中。我怎么做?谷歌图表似乎不想获得任何参数:)有什么想法吗?一种方法是添加另一个函数 google.charts.setOnLoadCallback(function () { drawChart(chartID); }); function drawCha

我有以下代码:

google.charts.setOnLoadCallback( drawChart );
function drawChart() { ... }

我需要将一个名为chartID的参数传递到drawChart()函数中。我怎么做?谷歌图表似乎不想获得任何参数:)有什么想法吗?

一种方法是添加另一个函数

google.charts.setOnLoadCallback(function () {
  drawChart(chartID);
});

function drawChart(chartID) { ... }