Hi VizBoy,
Thanks for your quick response.

Here is my spreadsheet:
http://spreadsheets.google.com/pub?key=pbD-qQOd8BSUVbHnvf7AGUQ

When I publish the Motion Chart that I have on that page, I get this
line to input into my html script:

<script src="http://spreadsheets.google.com/gpub?url=http%3A%2F
%2Foj0ijfii34kccq3ioto7mdspc7r2s7o9.spreadsheets.gmodules.com%2Fgadgets
%2Fifr%3Fup__table_query_url%3Dhttp%253A%252F
%252Fspreadsheets.google.com%252Ftq%253Frange
%253DA1%25253AI17%2526headers%253D-1%2526key%253DpbD-
qQOd8BSUVbHnvf7AGUQ%2526gid%253D0%2526pub%253D1%26up_title%3DGlobal
%2520results%2520across%2520Scenarios%26up_state%3D
%26up__table_query_refresh_interval%3D300%26url%3Dhttp%253A%252F
%252Fwww.google.com%252Fig%252Fmodules
%252Fmotionchart.xml&height=540&width=743"></script>

What comes out is a gadget with the axis variables changed, and the
size variable changed. Luckily the color-coding stays on the variable
I want it to (Scenarios).


I was hoping to avoid programming these charts up, because I am not
typically a developer, so ideally if I could use the charts directly
from the Google Spreadsheets, it would make life a lot easier. So I
have only used the PLAYGROUND, not the AJAX API code independently.
And here is the code I used in the AJAX APIs Playground, which created
the correct outcome. I have not coded this somewhere else separately,
but was instead trying to grab the result and use that figure (but
there does not seem to be such an option unfortunately - but that
would be a nice feature!).

function drawVisualization() {
  new google.visualization.Query(
      'http://spreadsheets.google.com/pub?key=pbD-
qQOd8BSUVbHnvf7AGUQ').send(
      function(response) {
        new google.visualization.MotionChart(
            document.getElementById('visualization')).
          draw(response.getDataTable(), {'width': 800, 'height': 400,
'state':
 
'{"xZoomedIn":false,"orderedByY":false,"xZoomedDataMax":
4102444800000,"sizeOption":"3","dimensions":{"iconDimensions":
["dim0"]},"xZoomedDataMin":1104537600000,"yZoomedDataMin":
0.47,"yZoomedIn":false,"yLambda":1,"iconKeySettings":
[],"colorOption":"4","duration":{"multiplier":
1,"timeUnit":"Y"},"xLambda":1,"stateVersion":
3,"yAxisOption":"2","showTrails":true,"iconType":"BUBBLE","yZoomedDataMax":
0.88,"xAxisOption":"_TIME","playDuration":15,"nonSelectedAlpha":
0.4,"time":"2005","orderedByX":false}'
                                        }
              );
      });
}

Thanks for your help!

Christi


On May 6, 4:54 am, VizBoy <[email protected]> wrote:
> Hi,
>
> So let's map out the issues here...
> One thing you're saying is that you're not able to use the ajax api to put a
> visualization on your page.
> That shouldn't be a problem, just follow the instructions 
> herehttp://code.google.com/apis/visualization/documentation/queries.html
> Or a full page example 
> here:http://code.google.com/apis/visualization/documentation/examples.html
> (just ctrl-F for the word Query)
> Let me know if this works for you.
>
> The other issue is that when you publish a motionchart gadget with saved
> preferences from a spreadsheet to iGoogle it works fine, and when you try to
> publish it to a web page, it doesn't work well.
> This is interesting, but before I open a bug, could you perhaps share your
> spreadsheet with us (or if it's private, create another one, reproduce the
> bug, and share it with us, so we can see?)
>
> Regards,
>       VizBoy.
>
> On Tue, May 5, 2009 at 1:42 AM, Christi <[email protected]> wrote:
>
> > Hello,
>
> > I was having a similar problem, and I have tried to use your solution
> > to get my motion chart to plot the way I would like it to look - and
> > it worked. However I cannot figure out how to get it on my website.
>
> > When I use my google spreadsheet to plot the data using the google
> > motion chart gadget, I am able to get it to plot TIME on the x axis
> > (which I have as column B in the spreadsheet), and one of my selected
> > indicators on the Y axis (column C). When I add this google gadget to
> > my iGoogle, it publishes just fine, maintaining my selections.
>
> > However, when I try to "publish" the gadget from my google
> > spreadsheet, and copy the html script into my website script, the
> > gadget does not display the way I had set it up, and it goes back to
> > plotting two of the indicators against eachother (Column C as X-axis,
> > Column D as Y-axis). (The bubble sizes are also not doing what I
> > wanted either.)
>
> > When I tried putting it into AJAX as Davide suggested, I was able to
> > get my data to come up in a gadget, and the formatting is what I want
> > also. But I don't know how I can embed this into my website. Any
> > ideas?
>
> > Thanks,
> > Christi
>
> > On Mar 31, 7:38 am, dawide <[email protected]> wrote:
> > > sorry, I managed to get what I wanted
> > > maybe my explanation was not clear enough.
>
> > > Instead of creating agadgeton the spreadsheet and then embedding it
> > > in an html page I used the AJAX API
>
> > > like this:
>
> > > function drawVisualization() {
> > >   new google.visualization.Query(
> > >       'http://spreadsheets.google.com/tq?key=pCQbetd-
> > > CptE1ZQeQk8LoNw').send(
> > >       function(response) {
> > >         new google.visualization.MotionChart(
> > >             document.getElementById('visualization')).
> > >             draw(response.getDataTable(), {'width': 800, 'height':
> > > 400});
> > >       });
>
> > > }
>
> > > and added the state string to the draw options
>
> > > draw(response.getDataTable(), {'width': 800, 'height': 400, 'state':
> > > 'your state string'});
>
> > > Davide
>
> > > On Mar 31, 9:04 am, VizBoy <[email protected]> wrote:
>
> > > > Hi,
>
> > > > I do not understand...
> > > > Did you manage to do what you wanted, or not?
>
> > > > - VizBoy.
>
> > > > On Mon, Mar 30, 2009 at 7:27 PM, dawide <[email protected]> wrote:
>
> > > > > What I wanted is very easy to achieve using javascript.
>
> > > > > I used the code from this page
>
> >http://code.google.com/apis/ajax/playground/?type=visualization#motio...
> > > > > put in my spreadsheet key and added the state string to the draw
> > > > > options
>
> > > > > Hope this helps,
> > > > > Davide
>
> > > > > On Mar 25, 7:01 pm, VizBoy <[email protected]> wrote:
> > > > > > Hi,
> > > > > > This is not yet supported but is on our feature request list.
> > > > > > Please keep an eye on the release notes.
>
> > > > > > - VizBoy.
>
> > > > > > On Wed, Mar 25, 2009 at 11:36 AM, dawide <[email protected]> wrote:
>
> > > > > > > Hi,
> > > > > > > how can I publish on a web page amotionchartgadgetwith a custom
> > > > > > > view instead of the default view?
>
> > > > > > > Basically I would like to use the state string (settings -
> > advanced)
>
> > > > > > > {"xZoomedDataMax":20,"orderedByX":false,"time":"2006","xLambda":
>
> > 0,"orderedByY":false,"sizeOption":"4","xZoomedIn":false,"nonSelectedAlpha":
> > > > > > > 0.5,"showTrails":true,"yLambda":0,"dimensions":{"iconDimensions":
> > > > > > > ["dim0"]},"yZoomedIn":false,"stateVersion":
> > > > > > > 3,"iconType":"BUBBLE","xZoomedDataMin":0.05,"yZoomedDataMax":
>
> > 54.8936170212766,"yZoomedDataMin":0,"iconKeySettings":[],"duration":
> > > > > > > {"timeUnit":"Y","multiplier":
>
> > 1},"xAxisOption":"3","colorOption":"5","yAxisOption":"9","playDuration":
> > > > > > > 15}
>
> > > > > > > together with the code to be pasted in any html page:
>
> > > > > > > <script src="http://spreadsheets.google.com/gpub?url=http%3A%2F
> > > > > > > %2Foj0ijfii34kccq3ioto7mdspc7r2s7o9.spreadsheets.gmodules.com
> > > > > %2Fgadgets
> > > > > > > %2Fifr%3Fup__table_query_url%3Dhttp%253A%252F
> > > > > > > %252Fspreadsheets.google.com%252Ftq%253Frange
> > > > > > > %253DA1%25253AK5114%2526headers%253D-1%2526gid%253D0%2526key
>
> > %253DpEFbUSI2qKVpeNTUqU9WfGA%2526pub%253D1%26up_title%3D%26up_state%3D
> > > > > > > %26up__table_query_refresh_interval%3D0%26url%3Dhttp%253A%252F
> > > > > > > %252Fwww.google.com%252Fig%252Fmodules
> > > > > > > %252Fmotionchart.xml&height=815&width=1281"></script>
>
> > > > > > > Thank you for your help,
> > > > > > > Davide
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to