Hi Daniel,
Thank so much for your help :)
I understand the process, by cons it does not work either and there is no 
chart that appears !
Bellow the new code
function onSuccessStore(values) {
  var header01 = values[0][0];
  var header02 = values[0][4];
  
  var val = [];
  // var columns = ["'" + header01 + "','" + header02 + "'"];
  var columns = ["'" + header01 + "'", "'" + header02 + "'"];
  val.push(columns)
  for (var i = 1 , nb = values.length; i < nb ; i++) {
    var rows = values[i];
    var severity = rows[0];
    var risk = rows[4]
    if ( severity != "" && risk  != "") {
      var value = ["'" + risk + "'," + severity];
      val.push(value);
    }    
  }
  var data = google.visualization.arrayToDataTable(val, false);

Really, it is to not understanding anything ... I'm above since the 
beginning of the week ...
I tested, turned, tried to find a solution ... nothing to do!
I really do not understand why it works with the copy of the log ... but 
not with the output value from the function !?!
Maybe, I do something wrong and I can share the file, no problem ...
Ok, thank you again :)

Le jeudi 27 août 2015 19:47:28 UTC+2, Daniel LaLiberte a écrit :
>
> It looks like your column headers for case 1 are wrong.  You have
>
>   columns = ["'" + header01 + "','" + header02 + "'"];
>
> The comma is in quotes, so you are getting one string rather than two.  
> Should be:
>
> columns = ["'" + header01 + "'", "'" + header02 + "'"];
>
>
> On Thu, Aug 27, 2015 at 1:14 PM, Jean Gorene <[email protected] 
> <javascript:>> wrote:
>
>> Hello everyone, I need help ... 
>> I try to build a dynamic chart from the values of a spreadsheet
>> So, I get my values from this sheet, no problem
>> Where it gets complicated is with "arrayToDataTable" ... I chose this 
>> solution to make it easier ... well it had to be easier :-/
>> In fact, I'd like to understand why my code works in one case (2) and not 
>> in case (1) (which is of course the one that interests me) see below
>> I probably missed something or I'm doing something wrong (!) ... anyway I 
>> do not find a way out of this impasse ... ... ...
>> Any ideas welcome, thank you in advance !
>>
>> Case (1) - this not work see image ... there is only one merged column 
>> when it should be two ???
>> function onSuccessStore(values) { 
>>   var header01 = values[0][0];
>>   var header02 = values[0][4];
>>   
>>   var val = [];
>>   var columns = ["'" + header01 + "','" + header02 + "'"];
>>   val.push(columns)
>>   for (var i = 1 , nb = values.length; i < nb ; i++) {
>>     var rows = values[i];
>>     var severity = rows[0];
>>     var risk = rows[4]
>>     if ( severity != "" && risk  != "") {
>>       var value = ["'" + risk + "'," + severity];
>>       val.push(value);
>>     }    
>>   }
>>   var data = google.visualization.arrayToDataTable(val, false);
>> ... and the next
>>
>> Case (2) - This works properly (a priori, there is no reason to the 
>> contrary)
>> function onSuccessStore(values) {
>> // below the exact copy of "val" in output log from case 1
>>   var val = [ 
>>     ['Severity 1-4','#'], 
>>     ['R1',1], 
>>     ['R2',1], 
>>     ['R3',1], 
>>     ['R4',1], 
>>     ['R5',3.5], 
>>     ['R6',1.5], 
>>     ['R7',2.5], 
>>     ['R8',3]
>>   ];
>>   var data = google.visualization.arrayToDataTable(val, false);
>> ... and the next
>>
>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-visualization-api/9c5a4509-84a1-4f53-8ca7-cc2a9e0d9570%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-visualization-api/9c5a4509-84a1-4f53-8ca7-cc2a9e0d9570%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> 
>  - 978-394-1058
> [email protected] <javascript:>   5CC, Cambridge MA
> [email protected] <javascript:> 9 Juniper Ridge Road, Acton MA
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/7404a1bf-bbf6-4221-8e60-346d1f74b805%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to