I am creating a reporting tool that uses Google Charts graphics. I want to create Combo Charts, but the data number is dynamic, so I need to pass the nbEGP variable to options.series:
function drawChart(array, title, div, type, nbEGP) {
var data = new google.visualization.arrayToDataTable(array);
var options = {
'title' : title,
'width' : '80%',
'height' : '600',
seriesType : "bars",
series : {
nbEGP : {
type : "line"
}
}
};
...
chart.draw(data, options);
}
but that will not work. If I try to display options.series, I see that this did not put the value of my variable, but the name is "nbEGP".
source
share