YOU ARE RIGHT!  If I call drawChart on a button click event it works so I 
am calling it in the wrong event which is obviously running BEFORE the 
chart data is being populated!  Thank you SO MUCH for all of your help!  
I've learned a lot through the process and can confidently tell the boss 
that Google Charts is a go!  

On Friday, November 14, 2014 11:17:39 AM UTC-5, Sergey wrote:
>
> The things you're talking about seem to be specific to your development 
> tools/environment, which is another way of saying, I'm not really sure what 
> you're talking about. It also appears that you either forgot to post the 
> "properties section", so I don't really see what you're talking about 
> either. Try doing console.log(JSON.stringify({dialog.object})) to log the 
> JSON representation of your object to the console, and post back a 
> screenshot.
>
> The best help I can give you at this stage is that perhaps your data is 
> being set after your chart is getting drawn. Try putting console.log calls 
> right before your data is set and right before you actually attempt to use 
> it. I bet that you'll see the latter first.
>
> On Fri Nov 14 2014 at 11:09:22 AM <[email protected] <javascript:>> wrote:
>
>> Hmmmm, that's an interesting thought!  I added the console line you 
>> requested and get the following.  I see that the properties section on the 
>> right DOES NOT list "_data" which puzzles me:
>>
>> :
>>
>>
>>
>> When I drill down on that first line and review the html, I can see the 
>> dialog data is set to my array and loaded with the data I am trying to 
>> chart (dialogId = DLG1 so the development tool renames it accordingly):
>>
>> DLG1_DlgObj._data = [['Type', 'Cost'],['CUSTOMER RETURN', 1405],
>>
>> ['INTER-COMPANY', 100],
>> ['REWORK', 200],
>> ['SCRAP', 100],
>> ['SETUP SCRAP', 110],
>> ['VENDOR RETURN', 5],
>> ['WARRANTY RETURN', 800]];;
>>
>> Please let me know your thoughts as I am running out of time to get this 
>> completed.  Boss wants to purchase a charting tool and quite honestly, the 
>> Google Charts are much prettier and I would prefer we go this route.
>>
>> Thanks again for all your help!
>>
>>
>> On Wednesday, November 12, 2014 3:02:48 PM UTC-5, Sergey wrote:
>>
>>> OK, it looks like your chartdata is undefined. Which is, in fact, not an 
>>> array. It effectively means that the property _data is missing; which in 
>>> turn means that something is iffy with your configuration. Please add the 
>>> line console.log({dialog.object}) and post a screenshot of that, and 
>>> perhaps I can help you further.
>>>
>>> On Wed Nov 12 2014 at 2:57:36 PM <[email protected]> wrote:
>>>
>>>>
>>>> <https://lh4.googleusercontent.com/-T-EoS3SWMgM/VGO7pTTnmYI/AAAAAAAAAAM/41q4PJVJ87U/s1600/js.jpg>
>>>>
>>>>
>>>> <https://lh4.googleusercontent.com/-T-EoS3SWMgM/VGO7pTTnmYI/AAAAAAAAAAM/41q4PJVJ87U/s1600/js.jpg>
>>>>
>>>>
>>>> On Wednesday, November 12, 2014 2:55:44 PM UTC-5, [email protected] 
>>>> wrote:
>>>>>
>>>>> Thanks for the quick reply Sergey.
>>>>>
>>>>> Please forgive my ignorance, I'm literally just figuring out how to 
>>>>> use the debugging tool today so I really am fumbling through it.  I added 
>>>>> the 2 lines you mentioned to my javascript function and here's what I see 
>>>>> in Firefox debugger.  Unfortunately it doesn't tell me much.  Am I not 
>>>>> looking in the right place?:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wednesday, November 12, 2014 2:11:21 PM UTC-5, Sergey wrote:
>>>>>
>>>>>> It's tough to say what's going on here and why it's failing, since it 
>>>>>> looks like your data is in fact an array. My guess is that your 
>>>>>> chartdata 
>>>>>> is an array encoded as a string. Could you perhaps do console.log(typeof 
>>>>>> chartdata) and report back what it says? Or even 
>>>>>> console.log(JSON.stringify(
>>>>>> chartdata))?
>>>>>>
>>>>>> On Wed Nov 12 2014 at 1:58:38 PM <[email protected]> wrote:
>>>>>>
>>>>>>> Long story short, I use Alpha 5 as my development tool and was able 
>>>>>>> test using Google Charts API per some of your examples (and assistance 
>>>>>>> from 
>>>>>>> a previous post).  So using your static chart example, I modified my 
>>>>>>> code 
>>>>>>> to connect to our SQL database and retrieve data to display in the 
>>>>>>> chart, 
>>>>>>> rather than using static, hard coded data.  I can confirm it's 
>>>>>>> connecting 
>>>>>>> to our data source and returning the correct data by stepping through 
>>>>>>> my 
>>>>>>> code and checking the values of the chart data, but the chart doesn't 
>>>>>>> get 
>>>>>>> rendered.   I get a pop up that says:
>>>>>>>
>>>>>>>
>>>>>>>  
>>>>>>> When I check the Firefox debugger, it says:
>>>>>>> ERROR NOT AN ARRAY
>>>>>>> function hga(a,b){var c={};if(!ki(a))throw m("Not an array");
>>>>>>>
>>>>>>> *Here is my JavaScript function:*
>>>>>>>
>>>>>>> function drawChart() {
>>>>>>>    
>>>>>>>   var chartdata = {dialog.object}._data;
>>>>>>>   
>>>>>>>   var data = google.visualization.arrayToDataTable(
>>>>>>>      chartdata
>>>>>>>      );
>>>>>>>      
>>>>>>>   var options = {
>>>>>>>     title : 'Cost of Quality',
>>>>>>>     is3D: true,
>>>>>>>   };
>>>>>>>   
>>>>>>>   var chart = new google.visualization.PieChart(
>>>>>>> document.getElementById('mychart'));
>>>>>>>   
>>>>>>>   chart.draw(data, options);
>>>>>>> };
>>>>>>>
>>>>>>>
>>>>>>> And the value of {dialog.object}._data = [['Type', 
>>>>>>> 'Cost'],['CUSTOMER RETURN', 1405],¶['INTER-COMPANY', 100],¶['REWORK', 
>>>>>>> 200],¶['SCRAP', 100],¶['SETUP SCRAP', 110],¶['VENDOR RETURN', 
>>>>>>> 5],¶['WARRANTY RETURN', 800]];
>>>>>>>
>>>>>>> Can anyone shed some light on this error?  I'm at a loss.  Thanks.
>>>>>>>
>>>>>>>
>>>>>>>  -- 
>>>>>>> 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 google-visualization-api+unsub
>>>>>>> [email protected].
>>>>>>> To post to this group, send email to [email protected]
>>>>>>> om.
>>>>>>> Visit this group at http://groups.google.com/group
>>>>>>> /google-visualization-api.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>  -- 
>>>> 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/d/optout.
>>>>
>>>  -- 
>> 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] 
>> <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/d/optout.

Reply via email to