Home Forums Chart Support How can I plot values from .txt file ? Reply To: How can I plot values from .txt file ?

#14956

Hi @kingbib,

processData(allText) requires an argument. Since you are not passing any argument to it, setInterval(function(){ processData(); }, 1000); an error is thrown when you try to split the variable allText since it is undefined.

Instead of calling the processData() only, you can put the entire ajax call in setInterval.

setInterval(function(){
    $.ajax({
        type: "GET",
        url: "dataSmall.txt",
        dataType: "text",
        success: function (data) { processData(data); }	
    });		
 }, 1000);

This will resolve your issue.

___
Suyash Singh
Team CanvasJS