0

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"}}, 
 };

1 Answer 1

1
c = data.getNumberOfColumns()-2;

var options = { 
   width: 400, 
   height: 240, 
   seriesType: "bars", 
   series: {}
 };

 options.series[c] = {type: "line"};
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.