There's a problem with the flash-based charts (discussed heavily on this group) with rendering from static local .html files. Try hosting your html file on some server and accessing it from there, and tell me if the problem persists.
- VizBoy. On Wed, Mar 4, 2009 at 6:35 PM, dparish <[email protected]> wrote: > > The following code failes for me. I get a skeleton of the chart with > no data: > > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > var visualization; > google.load('visualization', '1', {'packages': ['motionchart']}); > > function drawVisualization() { > //var query = new google.visualization.Query('/teamworks/ > jsonPump.lsw? > > zProcessName=jsonGetFruitSales&zHandlerFunction=google.visualization.Query.setResponse'); > > // Send the query with a callback function. > //query.send(handleQueryResponse); > var visualization = new google.visualization.MotionChart > (document.getElementById('chart')); > var json_data = new google.visualization.DataTable({"cols": > [{"type":"string","label":"Fruit","pattern":null,"id":"Fruit"}, > {"type":"datetime","label":"Date","pattern":null,"id":"Date"}, > {"type":"number","label":"Sales","pattern":null,"id":"Sales"}, > {"type":"number","label":"Expenses","pattern":null,"id":"Expenses"}, > > {"type":"string","label":"Location","pattern":null,"id":"Location"}],"rows": > [{"c":[{"v":"Apples"},{"v":"new Date(568015200000)"},{"v":1000},{"v": > 300},{"v":"East"}]},{"c":[{"v":"Oranges"},{"v":"new Date > (568015200000)"},{"v":950},{"v":200},{"v":"West"}]},{"c": > [{"v":"Bananas"},{"v":"new Date(568015200000)"},{"v":300},{"v":250}, > {"v":"West"}]},{"c":[{"v":"Apples"},{"v":"new Date(570693600000)"}, > {"v":1200},{"v":400},{"v":"East"}]},{"c":[{"v":"Oranges"},{"v":"new > Date(570693600000)"},{"v":900},{"v":150},{"v":"West"}]},{"c": > [{"v":"Bananas"},{"v":"new Date(570693600000)"},{"v":788},{"v":617}, > {"v":"West"}]}]}); > visualization.draw(json_data, null); > } > > > google.setOnLoadCallback(drawVisualization); > </script> > </head> > > > <div id="chart" style="height: 600px; width: 100%;"></div> > > > The above is a test case I wrote when my json response datatable > didn't render properly. I took the json response and just built the > example statically and get the same result. It's the same data as the > motion chart sample data so I'm confused as to where my problem is > coming from. You will notice that I construct Date's differently, but > I've already confirmed that the date object is valid. > > I can use this same methodology to do gViz tables and column charts, > but it's failing the same basic way for Motion Chart as well as > another sample with different data that I used for Annotated Time > Chart. Any help would be appreciated. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
