I don't think Marvel Entertainment realizes how much work it took to create
custom maps for the GeoChart for resolutions that it doesn't even support =)

1. asgallant is spot on about this. You need to give it a function, not the
result of a function call (unless the result of the function call is a
function).

2. It sounds like it might be easier for you to use the ChartWrapper, since
that would allow you to use a JSON object to represent each chart, and you
could have your server generate that.

- Sergey


On Wed, Jul 24, 2013 at 7:03 PM, asgallant <[email protected]>wrote:

> The race condition is caused by executing "getData" here:
>
> google.load('visualization', '1.1', {packages: ['geochart'],  callback: 
> getData(url) });
>
>
> What the callback expects to have a function as a parameter, not the
> returned value of a function (unless the return value is a function).  What
> you are actually doing here is executing the getData function and passing
> null to the callback parameter.  What you want to do is this:
>
> google.load('visualization', '1.1', {packages: ['geochart'],  callback: 
> function () {
>
>
>     getData(url);
>
> }});
>
>
> Which delays calling getData until the API is loaded.  That should clear
> up your first issue.
>
> Could you elaborate on the problems you are having combining the state and
> county maps together into one function?  There shouldn't be any reason why
> you would need to switch to using the arrayToDataTable function.
>
> On Wednesday, July 24, 2013 6:21:25 PM UTC-4, Bluestreak2k5 wrote:
>>
>> Thanks Sergey!
>>
>> Marvel Entertainment didn't seem too impressed with it on Friday when I
>> showed it to them in my final interview, but it also in phase 1 prototype
>> state and not its current state.
>>
>> Anyway...
>> http://chrisdblumberg.com/**unemployment/<http://chrisdblumberg.com/unemployment/>
>> The year selection works now for Counties, and will persist going between
>> counties and State. So 2012 to 2013 will be selected for counties, and
>> changing it to 2011 to 2013 while in counties will make that data show up
>> in States view.
>> The County and State names now show up instead of their actual Map ID's,
>> making it more useful.
>>
>> I've completely rewritten the JS and it will be optimized when I'm done
>> except I've run into a few issues:
>>
>> 1. Setting the initial URL at the top of index.js
>> to /unemployment/get.php?**fromYear=2013&toYear=2013 creates errors
>> trying to load the data. From what I can tell its a race condition trying
>> to load the Google charts JS files and load my Map data. If my Json call to
>> my get.php file returns before "format+en,default,geochart.I.**js" is
>> loaded, I get undefined functions errors on google.visualization.
>> Anyway around this?
>>
>> 2. I need a way to add all my data without doing "data.addRows()" as I am
>> doing. It doesn't work when I have tried to combine the DrawStateMaps and
>> DrawCountyMaps functions into 1 function called DrawMaps. All 3 methods are
>> in my index.js file. All 3 are called from the getData() function.
>>
>> I have seen other examples about using DataToArray instead of DataTable,
>> but I feel like this would require a major rewrite and am looking to see if
>> you have a better solution.
>>
>> Chris
>>
>>  --
> 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.
>
>
>

-- 
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.


Reply via email to