1

I found cool realtime bandwidth monitor here: http://www.codejungle.org/site/Realtime+bandwidth+meter+with+php+and+jquery.html

What I tried to do is to modify the code so that it could show two series: download and upload speed.

I changed only the last few lines of code in data.php:

echo '[
{
    label: "download",
    data: ['.implode($_SESSION['rx'], ",").']
},
{
    label: "upload",
    data: ['.implode($_SESSION['tx'], ",").']
}
];';

But unfortunately it doesn't work, what's wrong with this piece of code?

Raidri
  • 17,258
  • 9
  • 62
  • 65
skaarj
  • 100
  • 1
  • 3
  • 8

1 Answers1

2

Loose the outer brackets (they are already in the onDataReceived function) and the semicolon at the end:

echo '
{
    label: "download",
    data: ['.implode($_SESSION['rx'], ",").']
},
{
    label: "upload",
    data: ['.implode($_SESSION['tx'], ",").']
}
';
Raidri
  • 17,258
  • 9
  • 62
  • 65