Hello,
I am not familiar with JASON nor JQuery, so I am using XML data and basic
JavaScript.
I am trying to add data to a LineChart using addRows, but I am getting
error saying the number of values are different from number of columns:
I have configured the LineChart :
algLineData = new google.visualization.DataTable();
algLineData.addColumn('date' , 'Dia' );
algLineData.addColumn('number', 'Contrato' );
algLineData.addColumn('number', 'Fora Ponta');
algLineData.addColumn('number', 'Total' ); // 4 columns
algLnChart = new google.visualization.LineChart(document.getElementById(
'dlinealg'));
I am adding data to arrays:
var dataRows = [];
for(var chd = 0; chd < chdNodes.length; chd++){
var ponto = [];
// <PTOCRV valor="new Date(2017,4,1),0, 51.3226,51.3226"/> // 4 columns
ponto.push(chdNodes.item(chd).getAttribute("valor"));
dataRows.push(ponto) ;
}
algLineData.addRows(dataRows);
algLnChart.draw( algLineData, lineOptions);
I do not know why dataRows[] or ponto[] have a number of columns different
than 4.
May be I might push to ponto[] each value which are separated by commas.
Thank you very much.
Best regards.
Jayme Jeffman
--
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/93156c2e-0f3c-4939-8c54-e6e89611a315%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.