0
Lately I’ve been trying to use a Highcharts chart but I’ve been facing a problem, where I pass the value for graph generation does not accept "", and my array I capture from php is mounted with "" for example "1","2","3" and there works my code I need it to be 1,2,3 in the array follows my code next
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
rcbCom = this.responseText; // rcbCom = recebe o conteudo da variaves do php e começa a fazer a quebra da informação, rcb = recebe
var spCom = rcbCom.split("|"); // spCom = dividi as colunas separando onde estao as | , sp=Separacao
dataon[0]= spCom[0].split(","); // numero do simcon
sinal[0]= spCom[1].split(",");
on[0]= spCom[2].split(",");
Highcharts.chart('graf', {
title: {
text: 'QUEDAS DE CONEXÃO'
},
xAxis: {
tickInterval: 1,
type: 'logarithmic',
accessibility: {
rangeDescription: 'Range: 1 to 10'
}
},
yAxis: {
type: 'logarithmic',
minorTickInterval: 0.1,
accessibility: {
rangeDescription: 'Range: 0.1 to 1000'
}
},
tooltip: {
headerFormat: '<b>{series.name}</b><br />',
pointFormat: 'x = {point.x}, y = {point.y}'
},
series: [{
data: [1,2,3,4], //aqui preciso passar minha variavel on[0] porem com aspas ela não funciona
pointStart: 1
}]
});
}
}
xmlhttp.open("GET","../GrafCom/php/graf.php?cod="+cod+"&srv="+srv+"&data1="+date1+"&data2="+date2+"&con="+nCon, true); //para capturar o valor da variavel cd e mandar para o php
xmlhttp.send();
where the PHP code?
– novic