PatternFormat : Column Index range

62 views
Skip to first unread message

sanj

unread,
Mar 26, 2012, 10:34:06 PM3/26/12
to Google Visualization API
I am working on creating a table that has numbers, these numbers need
to be clickable.
In the sense that each of these table entries are formatted using
google.visualization.PatternFormat to direct me to different page.

var formatter3 = new google.visualization.PatternFormat('<a
href="{7}">{6}</a>');
formatter3.format(data, [6, 7]);

The above only work id the 6 and 7 are replaced with 0 and 1.

I just wan to clarify if there is a limitation that a hyperlink can
only be placed on the first column elements.
Can anyone help me with this?

Thank you,

sanj

unread,
Mar 26, 2012, 11:00:12 PM3/26/12
to Google Visualization API

NA

unread,
Mar 27, 2012, 12:26:22 AM3/27/12
to google-visua...@googlegroups.com
If I remember correctly, the indices used in the Pattern (the ones inside the { }) are not indices into the datatable.  They are indices into the array passed to the formatter.  So they will always start with 0.  The data can be in any column, you specify that in the call to format().

hope that helps,


sanj

unread,
Mar 27, 2012, 7:20:23 PM3/27/12
to Google Visualization API
Thank you, that help me understand the formatter API.
Now I figured out how to do what I wanted to.

Sanj.
Reply all
Reply to author
Forward
0 new messages