The values from the input fields are likely strings.  Parse them as 
integers or floats (as appropriate) :

var t1 = parseInt(oInputField1.getValue());
var t2 = parseInt(oInputField2.getValue());
var t3 = parseInt(oInputField3.getValue());
var t4 = parseInt(oInputField4.getValue());
var t5 = parseInt(oInputField5.getValue());

Use parseFloat to parse them as floating-point numbers instead.

On Thursday, September 11, 2014 3:12:27 AM UTC-4, nikhil joshi wrote:
>
> HI All,
>
> I am trying to use google api with SAPUI5. I am passing dynamic values to 
> the  *google.visualization.DataTable() *method from the text field of 
> UI5. My code is something like
>
> var t1 = oInputField1.getValue();
> var t2 = oInputField2.getValue();
> var t3 = oInputField3.getValue();
> var t4 = oInputField4.getValue();
> var t5 = oInputField5.getValue();
>  var data = google.visualization.arrayToDataTable([
>                                                        ['Task', 'Hours per 
> Day'],
>                                                        ['Work',t1],
>                                                        ['Eat',t2],
>                                                        ['Commute',t3],
>                                                        ['Watch TV',t4],
>                                                        ['Sleep',t5]
>                                                      ]);
>
> When I pass static values I get the output. But for dymanic values the 
> chart is displayed as gray. 
>
>
>
> <https://lh3.googleusercontent.com/-0A_L_eKx_EA/VBFLQ2UmCBI/AAAAAAAAAS8/MPbq47KlmaU/s1600/Capture.PNG>
>
>
> What I am doing wrong here?
>
> Best Regards,
> Nikhil
>

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