Thanks. However I'm just copy-pasting the code Google provides for
publishing the chart, which looks quite a bit different:
<script type="text/javascript"
src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js">
{"dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=[mysheet]&transpose=0&headers=1&range=A1%3AC57&gid=0&pub=1",
"options":{"showChartButtons":true,"vAxes":[{"title":"Left vertical axis
title","useFormatFromData":true,"minValue":null,"viewWindow":{"min":null,"max":null},"maxValue":null},{"useFormatFromData":true,"minValue":null,"viewWindow":{"min":null,"max":null},"maxValue":null}],"titleTextStyle":{"fontSize":16},"title":"Chart
title","booleanRole":"certainty","height":643,"animation":{"duration":500},"width":1468,"showSidePanel":true,"hAxis":{"title":"Horizontal
axis
title","useFormatFromData":true,"minValue":null,"viewWindow":{"min":null,"max":null},"maxValue":null}},
"state":{},"view":{},"isDefaultVisualization":true,"chartType":"MotionChart","chartName":"Chart
1"} </script>
When I paste that into an HTML page on my webserver it displays fine and
links back to my Drive spreadsheet. After getting the initial state how I
want it, I can copy the current State string, containing the Color/Size
options I have set:
{"yLambda":0,"xZoomedDataMax":381835,"colorOption":"_UNIQUE_COLOR","xZoomedIn":false,"showTrails":false,"yZoomedIn":false,"playDuration":15000,"nonSelectedAlpha":0.4,"xLambda":0,"yAxisOption":"2","yZoomedDataMax":381835,"yZoomedDataMin":6213,"iconType":"BUBBLE","time":"2000","orderedByX":false,"iconKeySettings":[{"key":{"dim0":"Metric1"}},{"key":{"dim0":"Metric2"}},{"key":{"dim0":"Metric3"}},{"key":{"dim0":"Metric4"}}],"dimensions":{"iconDimensions":["dim0"]},"orderedByY":false,"duration":{"multiplier":1,"timeUnit":"Y"},"sizeOption":"2","uniColorForNonSelected":false,"xAxisOption":"2","xZoomedDataMin":6213}
However I don't know where to put that string in the script code above, nor
which value to assign it to exactly. I thought perhaps pasting it into the
highlighted 'state:{}' brackets would work, but it doesn't. I tried putting
it under "options": but no luck.
On Wednesday, August 28, 2013 9:34:13 AM UTC-7, asgallant wrote:
>
> To set the initial state, you need to set the "state" option in the
> MotionChart. The state option takes a JSON string representation of a
> javascript object:
>
> var chart = new
> google.visualization.MotionChart(document.querySelector('#motion_chart_div'));
> chart.draw(data, {
> height: 400,
> width: 600,
> state: '<state string>'
> });
>
> On Wednesday, August 28, 2013 12:16:01 PM UTC-4, JPrize wrote:
>>
>> Hi, did you ever figure this out? I'm struggling with the same issue. I
>>> got the initial state string but the various places I've tried putting in
>>> the publishing code haven't worked.
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.