Thanks Viz Kid --- That would make sense. I just created the csv file using the linux vi editor and saving as a .csv file.
Does it have to be created a special way? I thought a csv file was just a text file with comma separating the data fields, with each record on a new line. Am I missing something?. On Nov 29, 5:26 pm, Viz Kid <[email protected]> wrote: > Hi. > > Is it possible that the data table which is constructed from the csv has > both columns type to be 'string' and not one 'string' and one 'number'? If > this is the case, the outcome is indeed that no gauge is being displayed. > > Viz Kid > > On Sun, Nov 29, 2009 at 2:26 PM, gman <[email protected]> wrote: > > I just started playing with this yesterday and have run into a problem > > I just cannot seem to get by. > > > Using the sample code for gauges I can display the gauges fine. When I > > get the data from a csv file, no gauges are displayed. However if I > > change to display a table, it displays just fine. The csv file looks > > like this: > > > Label,Value > > Memory,80 > > CPU,55 > > Network,68 > > > This does work: > > > // var data = response.getDataTable(); > > var data = new google.visualization.DataTable(); > > data.addColumn('string', 'Label'); > > data.addColumn('number', 'Value'); > > data.addRows(3); > > data.setValue(0, 0, 'Memory');// data.setValue(0, 1, > > 80); > > data.setValue(1, 0, 'CPU');// data.setValue(1, 1, > > 55); > > data.setValue(2, 0, 'Network'); > > data.setValue(2, 1, 68); > > > var chart = new google.visualization.Gauge > > (document.getElementById('char > > t_div')); > > chart.draw(data, null); > > > This does not work: > > > var data = response.getDataTable(); > > // var data = new google.visualization.DataTable(); > > // data.addColumn('string', 'Label'); > > // data.addColumn('number', 'Value'); > > // data.addRows(3); > > // data.setValue(0, 0, 'Memory');// data.setValue(0, > > 1, 80); > > // data.setValue(1, 0, 'CPU');// data.setValue(1, 1, > > 55); > > // data.setValue(2, 0, 'Network'); > > // data.setValue(2, 1, 68); > > > var chart = new google.visualization.Gauge > > (document.getElementById('char > > t_div')); > > chart.draw(data, null); > > > Yet --- Exactly the same code, but changing to a table does work: > > > var data = response.getDataTable(); > > // var data = new google.visualization.DataTable(); > > // data.addColumn('string', 'Label'); > > // data.addColumn('number', 'Value'); > > // data.addRows(3); > > // data.setValue(0, 0, 'Memory');// data.setValue(0, > > 1, 80); > > // data.setValue(1, 0, 'CPU');// data.setValue(1, 1, > > 55); > > // data.setValue(2, 0, 'Network'); > > // data.setValue(2, 1, 68); > > > var chart = new google.visualization.Table > > (document.getElementById('char > > t_div')); > > chart.draw(data, null); > > > Any ideas or suggestions? > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Google Visualization API" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<google-visualization-api%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-visualization-api?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. 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.
