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].
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/9c5a4509-84a1-4f53-8ca7-cc2a9e0d9570%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.