Hi Scott, The ability to specify value and formatted value applies to any value, not just for the id in the treemap. See the documentation for arrayToDataTable: https://developers.google.com/chart/interactive/docs/reference#google.visualization.arraytodatatable where it is mentioned, but it is not up to date. More documentation on the various ways of specifying datatables are documented at https://developers.google.com/chart/interactive/docs/reference#dataparam and in the separate page: https://developers.google.com/chart/interactive/docs/datatables_dataviews .
On Fri, Feb 20, 2015 at 10:07 AM, Scott Busche <[email protected]> wrote: > I came across this issue today and Tay's response from two years ago > worked wonderfully. Why hasn't the option of passing a value and formatted > value for ID been documented yet? > > On Wednesday, January 2, 2013 at 3:45:48 PM UTC-6, tay wrote: >> >> Each cell in a data table has a Value(used as the id) and >> FormattedValue(what is shown). >> IIRC, this used to be documented but I don't see it in the Treemap page. >> >> The following example does as you wish; >> >> function drawVisualization() { >> // Create and populate the data table. >> var data = google.visualization.arrayToDataTable([ >> ['Child' , 'Parent', 'Size', 'Color'], >> ['Global', null, 0, 0 >> ], >> ['Child1', 'Global', 0, 0 >> ], >> ['Child2', 'Global', 0, 0 >> ], >> [{v:'ChildA1', f:'ChildA'}, 'Child1', 10, >> 0], >> [{v:'ChildB1', f:'ChildB'}, 'Child1', 10, >> 0], >> [{v:'ChildA2', f:'ChildA'}, 'Child2', 10, >> 0], >> [{v:'ChildB2', f:'ChildB'}, 'Child2', 10, >> 0] >> ]); >> >> // Create and draw the visualization. >> var treemap = new google.visualization.TreeMap(document.getElementById( >> 'visualization')); >> treemap.draw(data, { >> minColor: 'red', >> midColor: '#ddd', >> maxColor: '#0d0', >> maxDepth: 2, >> headerHeight: 15, >> fontColor: 'black', >> showScale: true}); >> } >> >> >> On Wed, Jan 2, 2013 at 3:45 PM, Ribardiere Olivier < >> [email protected]> wrote: >> >> Hi, >> >> In a Treemap chart, 2 nodes should be able to have the same name if they >> don't have the same parent. >> >> function drawVisualization() { >> // Create and populate the data table. >> var data = google.visualization.arrayToDataTable([ >> ['Child' , 'Parent', 'Size', 'Color'], >> ['Global', null, 0, 0 >> ], >> ['Child1', 'Global', 0, 0 >> ], >> ['Child2', 'Global', 0, 0 >> ], >> ['ChildA', 'Child1', 10, 0 >> ], >> ['ChildB', 'Child1', 10, 0 >> ], >> ['ChildA', 'Child2', 10, 0 >> ], >> ['ChildB', 'Child2', 10, 0 >> ] >> ]); >> >> // Create and draw the visualization. >> var treemap = new google.visualization.TreeMap(document.getElementById( >> 'visualization')); >> treemap.draw(data, >> >> ... > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization 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-visualization-api. > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> - 978-394-1058 [email protected] <[email protected]> 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 Visualization 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-visualization-api. For more options, visit https://groups.google.com/d/optout.
