Found the answer. Here are all the steps 1) Save a copy of http://www.google.com/ig/modules/motionchart.xml 2) Modify the code to insert the following line : function saveState(state) { prefs.set('state', state); window.clipboardData.setData('Text',state); // Add this line to copy the state variable into your clipboard for IE } 3) Save the file to a public server location. Google Docs or Sites does not work. I used www.savefile.com 4) Open so you see the raw XLM in the browser and copy the URL 5) open a google spreadsheet and enter your data. Be sure to format the data correctly. (Best to test it with the standard published motion chart gadget) see example - http://docs.google.com/support/bin/answer.py?answer=92575&cbid=-2ndwfnblgfuo&src=cb&lev=index 6) Next, in your clean spreadsheet with the data only, higlight your range and insert > gadget > custom. Enter the URL for you modified XML. 7) Complete the title preference and your motion chart should come up. Modify all the axis, color, and size option you want to default later. 8) After your last change the "state" variable for the chart should have been copied into your clipboard. Paste into notepad. It should look like:
%7B%22yAxisOption%22%3A%221%22%2C%22xZoomedDataMin%22%3A5%2C%22duration %22%3A%7B%22multiplier%22%3A1%2C%22timeUnit%22%3A%22D%22%7D%2C %22xAxisOption%22%3A%220%22%2C%22xZoomedDataMax%22%3A298%2C %22yZoomedDataMin%22%3A19%2C%22iconType%22%3A%22BUBBLE%22%2C %22showTrails%22%3Atrue%2C%22stateVersion%22%3A3%2C%22sizeOption%22%3A %220%22%2C%22zoomedIn%22%3Afalse%2C%22time%22%3A%222008-11-10%22%2C %22xLambda%22%3A0%2C%22iconKeySettings%22%3A%5B%5D%2C%22yLambda %22%3A1%2C%22yZoomedDataMax%22%3A99%2C%22colorOption%22%3A%221%22%7D 9) From this you can see all the option contained in the "state" variable. 10) Go back into your modified motionchart.xlm and change the following line: options['state'] = "<<Paste your clipboard info between double quotes>>" 11) Repeat steps 3 to 7 and your chart should come up the way you had it! In my case I wanted to load the chart by script and not google doc with the gadget. So using my data in the format of the example: http://code.google.com/apis/visualization/documentation/gallery/motionchart.html I replaced line: chart.draw(data, {width: 600, height:300}); with: var options = []; options['height'] = 300; options['width'] = 600; options['state'] = "<<Paste your clipboard info between double quotes>>" chart.draw(data, options); That did the trick. I'm sure there is a better way to break the "state" option into it components. It would be great if the "state" option could be describe in the API documention. Hope this helps someone with their needs. Dan. On Nov 13, 2:15 am, VizGuy <[EMAIL PROTECTED]> wrote: > This option is not supported, but it is a good idea. Will look into it. > > VizGuy > > > > On Tue, Nov 11, 2008 at 7:02 PM, DanBo <[EMAIL PROTECTED]> wrote: > > > Would be great if the drop down menu selections could be set as > > options on the draw method: > > > x-axis: [column name] > > x-scale: [lin, log] > > y-axis: [column name] > > y-scale: [lin, log] > > color: [same, unique, column name] > > size: [same, column name] > > > Is there anyway to have javascript alter the menus or pass parameters > > on loading? > > > BTW, this API is the best! > > > Dan.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
