The #addColumn method appends the column to the end of the table 
automatically.  Much like a SQL database, inserting a new column somewhere 
in the middle of the table is, at best, going to be resource intensive. 
 Plus, with DataViews available, there is virtually no reason to care about 
the order of the columns in a DataTable (beyond knowing which is which).  I 
would avoid using #insertColumn and stick with #addColumn.  The third one 
(insertColumnAfter) doesn't exist.

On Sunday, September 9, 2012 6:48:17 AM UTC-4, Cristiano Maia wrote:
>
> What are the differences between this three methods to add a new column?
>
>
>
> data.addColumn('number', 'heading'); - 
> https://developers.google.com/chart/interactive/docs/reference#DataTable_addColumn
> data.insertColumn(3, 'number', 'heading');   - 
> https://developers.google.com/chart/interactive/docs/reference#DataTable_insertColumn
>   
> data.insertColumnAfter(3, 'number', 'heading');  // does not work.  Object 
> #<U> has no method 'insertColumnAfter' 
>
> What would be the best way to add a new column to the END of the table 
> with values for just some specific rows?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/m_W6foyQ03cJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to