Resolved.
<script>
Highcharts.chart('graf', {
title: {text: 'Hello darkness my old friend'},
series: [<?echo $allnames;?>],
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top'
},
plotOptions: {
series: {
events: {
legendItemClick: function() {
var jmeno=this.name;
var that=this;
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myData = this.responseText;
var splitData = myData.split(",");
var newData = [];
for(var i = 0;i<splitData.length;i++){
var num = splitData[i];
if(num != ""){
num = parseFloat(num);
newData.push(num);
}
}
that.setData(newData);
}
};
xmlhttp.open("GET","/data.php?q="+jmeno,true);
xmlhttp.send();
}
}
}
},
});
</script>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…