The contents of test.csv file are Date,Percentage 3/1/2009,9.50% 3/2/2009,8.20% 3/3/2009,7.20% 3/4/2009,5.50% 3/5/2009,6.60% 3/6/2009,7.60% 3/7/2009,6.70% 3/8/2009,4.50% 3/9/2009,3.20% 3/10/2009,5.50% 3/1/2010,4.50% 3/2/2010,9.20% 3/3/2010,3.30% 3/4/2010,4.30% 3/5/2010,6.60% 3/6/2010,7.80% 3/7/2010,10.00% 3/8/2010,6.70% 3/9/2010,8.70% 3/10/2010,7.30% 3/1/2008,4.40% 3/2/2008,5.50% 3/3/2008,5.56% 3/4/2008,4.57% 3/5/2008,7.54% 3/6/2008,6.86% 3/7/2008,9.67% 3/8/2008,8.24% 3/9/2008,4.55% 3/10/2008,7.89%
-SK On Jun 28, 6:16 pm, S713K <[email protected]> wrote: > Hi, > > I am new to Viz API and I am trying to display a csv datasource in > annotated timeline chart. But the issue is that my browser doesn't > show annotated timeline chart. Please let me know what is wrong in my > code. > > Here is my code: > > <!DOCTYPE html> > <html> > <head> > <title>All Examples</title> > <!--Load the AJAX API--> > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > > // Load the Visualization API and the ready-made Google table > visualization. > google.load('visualization', '1', {'packages': > ['annotatedtimeline']}); > > // Set a callback to run when the API is loaded. > google.setOnLoadCallback(init); > > // Send the queries to the data sources. > function init() > { > var query = new google.visualization.Query('csv?url=http:// > localhost:8080/myWebApp/test.csv'); > query.send(handleCsvDsResponse); > } > > // Handle the csv data source query response > function handleCsvDsResponse(response) > { > if (response.isError()) > { > alert('Error in query: ' + response.getMessage() + ' ' + > response.getDetailedMessage()); > return; > } > > var data = response.getDataTable(); > var chart = new > google.visualization.AnnotatedTimeLine(document.getElementById('chart_div')); > chart.draw(data, {width: 600, height: 150, is3D: true}); > } > > </script> > </head> > > <body> > > <h1> CSV Data Source </h1> > An annotated timeline. > The data is taken from the csv data source. > <div style="width: 700px; height: 300px;" id="chart_div">please > wait...</div> > > </body> > > </html> > > Thank you all in advance. -- 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.
