DataTable getColumnIndex always return -1

411 views
Skip to first unread message

Vikas Yadav

unread,
Dec 13, 2011, 1:09:11 AM12/13/11
to Google Visualization API
When I call dataTable.getColumnIndex("columnName"), ideally it should
return column index.
But it is returns -1, is it bug?

Thanks in advance,
Vikas

Roni Biran

unread,
Dec 13, 2011, 3:03:54 AM12/13/11
to google-visua...@googlegroups.com
This is because the getColumnIndex searches the column id and not the column label.
Set the column id in your datatable and it will work.




--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Vikas Yadav

unread,
Dec 13, 2011, 5:27:13 AM12/13/11
to Google Visualization API
Thanks a lot for your help.

On Dec 13, 1:03 pm, Roni Biran <roni.bi...@gmail.com> wrote:
> This is because the getColumnIndex searches the column id and not the
> column label.
> Set the column id in your datatable and it will work.
>

Roni Biran

unread,
Dec 13, 2011, 5:32:42 AM12/13/11
to google-visua...@googlegroups.com
You're welcome :-)


Reply all
Reply to author
Forward
0 new messages