The problem has been fixed by putting one more condition in for loop in html file where the value extracted from the text file should be non zero. The updated code path is:
The content of data in the file is a simple integer ranging from 1 to 100. These numbers are generated by running a shell script:
//Starting tag for shell script
for(( i=1;i<=300; i++))
shuf -i 1-100 -n 1
//Ending tag for shell script
I am calling an update script function after an interval of 2 seconds. On increasing the interval time to 4 or 5 seconds, the number of missing points in the graph reduces.