Franz,
There is no way to get the column index of the column you are calculating
(which is what I assume you want). It is assumed that you know at the time
you specify the calculation function which column it is, but your request
is very reasonable if you want to use a generic function that works for
multiple columns. I suggest you do something like the following instead.
view.setColumns([0, {calc: makeCalcFunc(1)}]
function makeCalcFunc(colIndex) {
return function (data, rowIndex) {
var value = doSomethingWIth(data, rowIndex, colIndex);
return value;
})
On Fri, Oct 25, 2013 at 10:46 PM, Franz Krauth <[email protected]> wrote:
> Hi,
>
> in a function to calculate values for a column (as in
> view.setColumns([0,{calc:someFunc}]), is it possible to get the current
> column index in the function?
>
> function someFunc(data, row){
> var colIndex = ????; // would like to find 1 here...
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Chart API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-chart-api.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> -
978-394-1058
[email protected] <[email protected]> 562D 5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA
--
You received this message because you are subscribed to the Google Groups
"Google Chart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-chart-api.
For more options, visit https://groups.google.com/groups/opt_out.