I wish to add an object model to a Google chart dynamically at runtime. I call a php function using AJAX to get the data and based on the number of columns, I wish to make the last column a line chart.
I wish to replace 5 by c as per below script.
c = data.getNumberOfColumns()-2
var options = {
width: 400,
height: 240,
seriesType: "bars",
series: {5: {type: "line"}},
};
Cœur
39k25 gold badges207 silver badges282 bronze badges
asked Jul 9, 2012 at 7:27
Cyril Joudieh
1242 silver badges15 bronze badges
1 Answer 1
c = data.getNumberOfColumns()-2;
var options = {
width: 400,
height: 240,
seriesType: "bars",
series: {}
};
options.series[c] = {type: "line"};
answered Jul 9, 2012 at 7:29
Esailija
140k24 gold badges280 silver badges328 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js