Hi Joseph, I'm not exactly sure what you want to do, but here is an example based on your code that might give you something to work from. http://jsfiddle.net/dlaliberte/g08jb8x6/
A good debugging technique is to use a Table to see what you are generating, particularly with groups and joins. The Histogram doesn't have much to show if there is only one item, but it seems to work. On Fri, Mar 11, 2016 at 2:58 PM, 'Joseph Nelson' via Google Visualization API <[email protected]> wrote: > Hi All, > > I have the following snipped that's producing the above error and the > chart doesn't render. I'm new to JS and gViz API as well. What am I doing > wrong? > > <table> > <h1>Software Versions - By Role</h1> > <div id="chart_div"></div> > <script type="text/javascript"> > google.load("visualization", "1", {packages:["corechart"]}); > google.setOnLoadCallback(drawChart); > > > function drawChart(){ > > // Create DataTable object from dremel table > var dt = new google.visualization.DataTable(); > dt.addColumn('string', 'name'); > dt.addColumn('string', 'role'); > dt.addColumn('string', 'vendor'); > dt.addColumn('string', 'hw_rev'); > dt.addColumn('string', 'sw_rev'); > > // Populate with data from Dremel query > > dt.addRow(['ar01.bog01', > 'AR', > 'Juniper', > 'mx960', > '13.3X2' > ]); > > dt.addRow(['ar01.bom05', > 'AR', > 'Juniper', > 't4000', > '13.3X2' > ]); > > dt.addRow(['ar01.bom07', > 'AR', > 'Juniper', > 't4000', > '13.3X2' > ]); > > dt.addRow(['ar01.ctg01', > 'AR', > 'Juniper', > 'mx960', > '13.3X2' > ]); > > // More entries omitted > > var chart = new google.visualization.Histogram( > document.getElementById('chart_div')); > > var column_key = [1, 2]; > //var column_opt = [1, {'column':2, > 'aggregation':google.visualization.data.count, 'type':'number'}]; > > var chart_opts = { > title: 'Sofware Revsions by Role', > } > > var group = google.visualization.data.group( > dt, > column_key > ); > > chart.draw(group); > } > > </script> > </table> > > -- > 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 > https://groups.google.com/group/google-visualization-api. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-visualization-api/6162bdb5-65c8-4579-a1ce-3235574d57df%40googlegroups.com > <https://groups.google.com/d/msgid/google-visualization-api/6162bdb5-65c8-4579-a1ce-3235574d57df%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> [email protected] <[email protected]> 5CC, Cambridge 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 https://groups.google.com/group/google-visualization-api. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJN%3DO6T8URq9kdRjdv7fK%3DtV34HikQ61esGwiT%2BP0%2Bkncg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
