Yup, that could screw things up for you easily enough. Try going backwards
through the columns instead:
for (var i = data.getNumberOfColumns() - 1; i > 0; i--) {
if ($.inArray(i, check_box_values) > -1) {
data.removeColumn(i);
}
}
On Friday, November 23, 2012 12:19:29 PM UTC-5, Pedro Guimarães wrote:
>
> Hm, I think is because evertime I do removeColumn(i), column number
> becomes -1
>
> eg:
>
> Column (1)
> Column (2)
> Column (3)
>
> If removeColumn(2)
>
> It turns (old-new):
>
> column (1) - column (1)
> column (3) - cloumn (2)
>
>
--
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/-/jcirNsaetmEJ.
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.