?
Solved

Refresh a container in PHP/Javascript

Posted on 2011-05-12
5
Medium Priority
?
246 Views
Last Modified: 2012-05-11
Hello,
I am trying to build a web page using PHP and Javascript to display an activity graph.  I want the graph to update every X minutes(lets go with 5 minutes for now).  Currently I have a timer that reloads the entire page, but this is a horrible solution.  I would like to just reload the container that has the graph.  Is there some way i can do this?  

I am very new to PHP and Javascript, so my code is not the best, but I have attached it so you can see what I'm working with.


Thank you in advance for any help you can provide.

<?php

  //-- GRAPH STUFF HERE --\\

  $Date = array(); //x axis
  $logicalio = array();

  //---- POPULATE GRAPH DATA ----\\
////////DBA
  $query="select * from moniter_data order by time;";
  $result = pg_query($link, $query);
  $total=0;

  while($pdone = pg_fetch_array($result))
  {
    $Date[$total] = $pdone['time'];
    $logicalio[$total] = $pdone['logicalio'];
    $physicalio[$total] = $pdone['physicalio'];
         $sessions[$total] = $pdone['sessions'];
         $total++;
  }

  //START JAVASCRIPT
  print "<script id=\"source\" language=\"javascript\" type=\"text/javascript\">
  $(function () {
";

//INSERT logical IO
  echo "var LogIOData = [";
  for ($i = 1; $i < $total; $i++)
  {
    $date = strtotime($Date[$i])*1000;
    $gets = $logicalio[$i];
    echo "[$date,$gets],";
  }
  print "];
";

  //---- END POPULATE GRAPH DATA ----\\
print "

function timedRefresh(timeoutPeriod) {
          setTimeout(\"location.reload(true);\",timeoutPeriod);
}

var logicalOptionsOld = {
             series: {
               lines: { show: true },
               points: { show: false }
             },
             grid: { hoverable: true, clickable: true },
             xaxis: { mode: 'time', axisLabel: 'Date' },
             yaxis: {labelWidth: 59, tickFormatter: function (v, axis) { return formatNumber(v,0,',','','','','-',''); }, axisLabel: 'Logical IO', axisLabelUseCanvas: true },
             legend: { position: 'nw' },
             selection: { mode: \"x\" }
           };

function generateAverages(xmin, xmax) {
  var x, y, i;
  var mavg = 0;
  var j = 0;
  var total = 0;
  d1 = new Array();

  for (i in LogIOData) {
    if (LogIOData == null) continue;
    x = LogIOData[i][0];
    y = LogIOData[i][1];
    if (xmax != 0 && x > xmax) break;
    if (xmin == 0 || x >= xmin) {
      j++;
      mavg = (j == 1) ? y : ((j - 1)*mavg + y) / j;
      d1.push(new Array(x, mavg));
      total += y;
    }
  }

  var avg = total/j;
  d2 = new Array();
  j = 0;
  for (i in LogIOData) {
    x = LogIOData[i][0];
    if (xmax != 0 && x > xmax) break;
    if (xmin == 0 || x >= xmin) {
      d2.push(new Array(x, avg));
    }
  }
}

function changeZoom(from, to) {
    var ymin = 0;
    var ymax = 0;
    var y2max = 0;
    var y3max = 0;
    var xmin = -1;
    var y2=0;
    var y3=0;
    var xmax, x, y;

    for (i in LogIOData) {
      x = LogIOData[i][0];
      y = LogIOData[i][1];
      if (x > to) break;
      if (x >= from) {
        if (xmin == -1) xmin = x;
        if (y > ymax) ymax = y;
      }

      xmax = x;
    }
    for (i in PhyIOData) {
      y2 = PhyIOData[i][1];
      if (y2 > y2max) y2max = y2;
    }
    for (i in SessData) {
      y3 = SessData[i][1];
      if (y3 > y3max) y3max = y3;
    }
    generateAverages(xmin, xmax);
    var logicalOptions = $.extend(true, {}, logicalOptionsOld, {
      xaxis: {
        min: xmin,
        max: xmax
      },
      yaxis: {
        min: ymin,
        max: ymax
      }
    });
    $.plot($(\"#container\"),[ { data: LogIOData, label: \"Percent Complete\" }], logicalOptions);
}

";
  print "
    var plot = $.plot($(\"#container\"),
           [ { data: LogIOData, label: \"Percent Complete\" }], logicalOptionsOld);


    function showTooltip(x, y, contents) {
        $('<div id=\"tooltip\">' + contents + '</div>').css( {
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 5,
            border: '1px solid #fdd',
            padding: '2px',
            'background-color': '#fee',
            opacity: 0.80
        }).appendTo(\"body\").fadeIn(200);
    }



$(document).ready(function() {
  var total = LogIOData.length;
  if (total >= 10) {
    changeZoom(LogIOData[total - 1][0] - 1800000, LogIOData[total - 1][0]);
    $(\"#zoom-mode\").html(\"Current Zoom Mode: 30 min\");
  }
  else {
    changeZoom(LogIOData[LogIOData.length - 1][0] - 7200000, LogIOData[LogIOData.length - 1][0]);
    $(\"#zoom-mode\").html(\"Current Zoom Mode: 2 hours\");
  }

  if (total == 0) {

  }
  else {
    var previousPoint = null;
    $(\"#container\").bind(\"plothover\", function (event, pos, item) {
        $(\"#x\").text(pos.x.toFixed(2));
        $(\"#y\").text(pos.y.toFixed(2));

            if (item) {
                if (previousPoint != item.datapoint) {
                    previousPoint = item.datapoint;

                    $(\"#tooltip\").remove();
                    var x = item.datapoint[0],
                        y = formatNumber(item.datapoint[1].toFixed(2),2,',','.','','','-','');
                    var d = new Date(x);
                    showTooltip(item.pageX, item.pageY,
                                item.series.label + \" on \" + d.toUTCString() + \" = \" + y);
                }
            }
            else {
                $(\"#tooltip\").remove();
                previousPoint = null;
            }
    });
    $(\"#container\").bind(\"plotselected\", function(event, ranges) {
      changeZoom(ranges.xaxis.from, ranges.xaxis.to);
      $(\"#zoom-mode\").html(\"Current Zoom Mode: Selection\");
    });
    $(\"#zoom-2h\").click(function(event) {
      changeZoom(LogIOData[LogIOData.length - 1][0] - 7200000, LogIOData[LogIOData.length - 1][0]);
      $(\"#zoom-mode\").html(\"Current Zoom Mode: 2 hours\");
    });
    $(\"#zoom-30min\").click(function(event) {
      changeZoom(LogIOData[LogIOData.length - 1][0] - 1800000, LogIOData[LogIOData.length - 1][0]);
      $(\"#zoom-mode\").html(\"Current Zoom Mode: 30 min\");
    });
  }

  timedRefresh(5000);
});
  });
  </script>
";
  //END JAVASCRIPT
  //-- END GRAPH STUFF --\\
echo "<form method=POST action=\"queryDescription.php\">
  <input type=\"hidden\" name=\"action\" value=\"update\"></form>
  <br><center><b><font size=3>Logical IO</font></b></center><br>
  <div id=\"container\" style=\"width:750px;height:300px;\"></div>
  <center><br><button id=\"zoom-2h\" class=\"zoom cronjob\">Show Last 2 hours</button> <button id=\"zoom-30min\" class=\"zoom cronjob\">Show Last 30 min</button></center>";
?>

Open in new window

0
Comment
Question by:Alex Matzinger
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 35751219
open your page in your browser, then take the browser's source code and post it here.  (First, if there's any sensitive info remove it with XXX).
0
 
LVL 4

Author Comment

by:Alex Matzinger
ID: 35751242
Here it is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div id="wrap">
  <div id="content">

<script id="source" language="javascript" type="text/javascript">
  $(function () {
var LogIOData = [[1305208618000,242],[1305208623000,527],[1305208628000,2963],[1305208633000,463],[1305208638000,925],[1305208643000,149],[1305208648000,31],[1305208653000,317],[1305208658000,27],[1305208663000,33],[1305208668000,105],[1305208673000,17],[1305208679000,43],[1305208684000,439],[1305208689000,3253],[1305208694000,268],[1305208699000,417],[1305208704000,28],[1305208709000,29],[1305208714000,319],[1305208719000,1437],[1305208724000,994],[1305208729000,29],[1305208734000,1123],[1305208739000,1285],[1305208744000,378],[1305208749000,3161],[1305208754000,447],[1305208759000,891],[1305208764000,28],[1305208769000,819],[1305208774000,982],[1305208779000,313],[1305208784000,689],[1305208789000,29],[1305208794000,27],[1305208799000,15],[1305208805000,4801],[1305208810000,2086],[1305208815000,1012],[1305208820000,530],[1305208825000,698],[1305208830000,1219],[1305208835000,1384],[1305208840000,880],[1305208845000,16],[1305208850000,31],[1305208855000,28],[1305208860000,32],[1305208865000,186],[1305208870000,2220],[1305208875000,282],[1305208880000,446],[1305208885000,14],[1305208890000,31],[1305208895000,519],[1305208900000,376],[1305208905000,445],[1305208910000,160],[1305208915000,675],[1305208920000,252],[1305208926000,1551],[1305208931000,1908],[1305208936000,843],[1305208941000,27],[1305208946000,692],[1305208951000,17],[1305208956000,2105],[1305208961000,2734],[1305208966000,1358],[1305208971000,42],[1305208976000,171],[1305208981000,220],[1305208986000,1873],[1305208991000,615],[1305208996000,445],[1305209001000,27],[1305209006000,29],[1305209011000,331],[1305209016000,88],[1305209021000,104],[1305209026000,27],[1305209031000,28],[1305209036000,13],[1305209042000,344],[1305209047000,2098],[1305209052000,1809],[1305209057000,1071],[1305209062000,2791],[1305209067000,1221],[1305209072000,1858],[1305209077000,847],[1305209082000,81],[1305209087000,51],[1305209092000,353],[1305209097000,675],[1305209102000,3735],[1305209107000,3825],[1305209112000,1142],[1305209117000,835],[1305209122000,17],[1305209127000,26],[1305209132000,1119],[1305209137000,191],[1305209142000,18],[1305209147000,408],[1305209152000,716],[1305209157000,216],[1305209163000,870],[1305209168000,2474],[1305209173000,266],[1305209178000,418],[1305209183000,221],[1305209188000,1419],[1305209193000,3081],[1305209198000,1037],[1305209203000,459],[1305209208000,969],[1305209213000,29],[1305209218000,24],[1305209223000,200],[1305209228000,2491],[1305209233000,26],[1305209238000,984],[1305209243000,444],[1305209248000,15],[1305209253000,329],[1305209258000,664],[1305209263000,447],[1305209268000,29],[1305209273000,16],[1305209278000,24],[1305209284000,372],[1305209289000,2530],[1305209294000,414],[1305209299000,492],[1305209304000,27],[1305209309000,1483],[1305209314000,1179],[1305209319000,2243],[1305209324000,1019],[1305209329000,371],[1305209334000,141],[1305209339000,150],[1305209344000,1114],[1305209349000,2513],[1305209354000,405],[1305209359000,558],[1305209364000,28],[1305209369000,26],[1305209374000,959],[1305209379000,351],[1305209384000,29],[1305209389000,30],[1305209394000,561],[1305209399000,432],[1305209405000,4861],[1305209410000,2071],[1305209415000,1211],[1305209420000,1462],[1305209425000,1966],[1305209430000,370],[1305209435000,911],[1305209441000,1439],[1305209446000,595],[1305209451000,17],[1305209456000,27],[1305209461000,192],[1305209466000,1879],[1305209471000,1035],[1305209476000,30],[1305209481000,26],[1305209486000,30],[1305209491000,13],[1305209496000,328],[1305209501000,32],[1305209506000,30],[1305209511000,27],[1305209516000,16],[1305209521000,244],[1305209526000,2045],[1305209531000,994],[1305209536000,19],[1305209541000,865],[1305209547000,2147],[1305209552000,351],[1305209557000,1199],[1305209562000,32],[1305209567000,568],[1305209572000,445],[1305209577000,14],[1305209582000,195],[1305209587000,979],[1305209592000,1975],[1305209597000,19],[1305209602000,29],[1305209607000,29],[1305209612000,327],[1305209617000,15],[1305209622000,33],[1305209627000,27],[1305209632000,30],[1305209637000,25],[1305209642000,233],[1305209647000,2423],[1305209652000,685],[1305209657000,407],[1305209662000,27],[1305209668000,24],[1305209673000,318],[1305209678000,31],[1305209683000,1416],[1305209689000,1617],[1305209694000,1240],[1305209699000,27],[1305209704000,5940],[1305209709000,2459],[1305209714000,441],[1305209720000,25],[1305209725000,766],[1305209730000,244],[1305209735000,346],[1305209740000,33],[1305209745000,14],[1305209750000,107],[1305209755000,27],[1305209760000,120],[1305209765000,955],[1305209770000,2002],[1305209775000,736],[1305209780000,28],[1305209785000,17],[1305209790000,2172],[1305209795000,1337],[1305209800000,1112],[1305209805000,13],[1305209811000,26],[1305209816000,27],[1305209821000,192],[1305209826000,35],[1305209831000,2700],[1305209836000,25],[1305209841000,29],[1305209846000,30],[1305209851000,13],[1305209856000,711],[1305209861000,392],[1305209866000,240],[1305209871000,20],[1305209876000,27],[1305209881000,243],[1305209886000,2054],[1305209891000,1222],[1305209896000,901],[1305209901000,29],[1305209906000,730],[1305209911000,19],[1305209916000,2012],[1305209921000,1907],[1305209926000,206],[1305209932000,606],[1305209937000,991],[1305209942000,194],[1305209947000,1913],[1305209952000,630],[1305209957000,434],[1305209962000,28],[1305209967000,31],[1305209972000,325],[1305209977000,14],[1305209982000,35],[1305209987000,25],[1305209992000,30],[1305209997000,29],[1305210002000,3611],[1305210007000,4419],[1305210012000,658],[1305210017000,387],[1305210022000,993],[1305210027000,1064],[1305210032000,337],[1305210037000,2682],[1305210042000,34],[1305210047000,27],[1305210053000,25],[1305210058000,27],[1305210063000,182],[1305210068000,2221],[1305210073000,697],[1305210078000,27],[1305210083000,16],[1305210088000,30],[1305210093000,328],[1305210098000,29],[1305210103000,30],[1305210108000,16],[1305210113000,29],[1305210118000,27],[1305210123000,461],[1305210128000,2584],[1305210133000,416],[1305210138000,581],[1305210143000,717],[1305210148000,1669],[1305210153000,1080],[1305210158000,1061],[1305210163000,30],[1305210168000,15],[1305210173000,30],[1305210179000,23],[1305210184000,197],[1305210189000,2311],[1305210194000,443],[1305210199000,28],[1305210204000,27],[1305210209000,30],[1305210214000,328],[1305210219000,19],[1305210224000,29],[1305210229000,29],[1305210234000,16],[1305210239000,27],[1305210244000,558],[1305210249000,2656],[1305210254000,861],[1305210259000,15],[1305210264000,2708],[1305210269000,1352],[1305210274000,321],[1305210279000,19],[1305210284000,29],[1305210289000,30],[1305210294000,27],[1305210300000,13],[1305210305000,5846],[1305210310000,2311],[1305210315000,432],[1305210320000,16],[1305210325000,27],[1305210330000,29],[1305210335000,339],[1305210340000,31],[1305210345000,17],[1305210351000,25],[1305210356000,27],[1305210361000,245],[1305210366000,597],[1305210371000,2329],[1305210376000,423],[1305210381000,27],[1305210386000,771],[1305210391000,1564],[1305210396000,3303],[1305210401000,31],[1305210406000,30],[1305210411000,17],[1305210416000,27],[1305210421000,195],[1305210426000,1873],[1305210431000,1032],[1305210436000,30],[1305210441000,27],[1305210446000,27],[1305210451000,17],[1305210456000,351],[1305210461000,31],[1305210466000,28],[1305210472000,25],[1305210477000,13],[1305210482000,312],[1305210487000,2270],[1305210492000,712],[1305210497000,407],[1305210502000,621],[1305210507000,26],[1305210512000,1983],[1305210517000,2158],[1305210522000,31],[1305210527000,573],[1305210532000,246],[1305210537000,12],[1305210542000,199],[1305210547000,1878],[1305210552000,627],[1305210557000,435],[1305210562000,27],[1305210567000,27],[1305210572000,349],[1305210577000,13],[1305210582000,32],[1305210587000,28],[1305210593000,24],[1305210598000,24],[1305210603000,5591],[1305210608000,2397],[1305210613000,655],[1305210618000,623],[1305210623000,751],[1305210628000,1092],[1305210633000,2325],[1305210638000,29],[1305210643000,42],[1305210648000,28],[1305210653000,28],[1305210658000,50],[1305210663000,199],[1305210668000,2212],[1305210673000,813],[1305210678000,863],[1305210683000,51],[1305210688000,17],[1305210693000,329],[1305210698000,31],[1305210703000,31],[1305210708000,17],[1305210713000,28],[1305210719000,22],[1305210724000,249],[1305210729000,2036],[1305210734000,604],[1305210739000,420],[1305210744000,26],[1305210749000,464],[1305210754000,844],[1305210759000,29],[1305210764000,29],[1305210769000,1254],[1305210774000,1046],[1305210779000,27],[1305210784000,1383],[1305210789000,2213],[1305210794000,278],[1305210799000,446],[1305210804000,23],[1305210809000,80],[1305210814000,371],[1305210819000,19],[1305210824000,564],[1305210829000,285],[1305210834000,184],[1305210840000,16],[1305210845000,465],[1305210850000,2212],[1305210855000,266],[1305210860000,764],[1305210865000,24],[1305210870000,30],[1305210876000,1931],[1305210881000,2232],[1305210886000,48],[1305210891000,31],[1305210896000,23],[1305210902000,129],[1305210907000,7882],[1305210912000,694],[1305210917000,16],[1305210922000,28],[1305210927000,27],[1305210933000,13],[1305210938000,553],[1305210943000,31],[1305210948000,27],[1305210953000,29],[1305210958000,25],[1305210963000,447],[1305210968000,2953],[1305210973000,415],[1305210978000,27],[1305210983000,2086],[1305210988000,956],[1305210993000,1363],[1305210998000,33],[1305211003000,28],[1305211008000,15],[1305211013000,30],[1305211018000,25],[1305211023000,197],[1305211029000,1937],[1305211034000,414],[1305211039000,27],[1305211044000,28],[1305211049000,15],[1305211054000,342],[1305211059000,33],[1305211064000,29],[1305211069000,28],[1305211074000,17],[1305211079000,23],[1305211084000,708],[1305211089000,2435],[1305211094000,654],[1305211099000,1264],[1305211104000,2045],[1305211109000,559],[1305211114000,325],[1305211119000,21],[1305211124000,29],[1305211129000,27],[1305211134000,16],[1305211139000,25],[1305211145000,165],[1305211150000,1895],[1305211155000,458],[1305211160000,404],[1305211165000,27],[1305211170000,27],[1305211175000,324],[1305211180000,21],[1305211185000,29],[1305211190000,28],[1305211195000,27],[1305211200000,14],[1305211205000,5987],[1305211210000,2941],[1305211215000,26],[1305211220000,2741],[1305211225000,1209],[1305211230000,27],[1305211235000,687],[1305211240000,37],[1305211245000,13],[1305211250000,29],[1305211255000,26],[1305211260000,26],[1305211266000,909],[1305211271000,1428],[1305211276000,419],[1305211281000,26],[1305211286000,15],[1305211291000,29],[1305211296000,354],[1305211301000,37],[1305211306000,13],[1305211311000,29],[1305211316000,25],[1305211321000,245],[1305211326000,1515],[1305211331000,1558],[1305211336000,25],[1305211341000,762],[1305211346000,1512],[1305211351000,2049],[1305211356000,332],[1305211361000,37],[1305211366000,25],[1305211371000,17],[1305211376000,24],[1305211381000,195],[1305211387000,1491],[1305211392000,598],[1305211397000,419],[1305211402000,26],[1305211407000,27],[1305211412000,16],[1305211417000,323],[1305211422000,39],[1305211427000,24],[1305211432000,28],[1305211437000,13],[1305211442000,633],[1305211447000,3707],[1305211452000,2557],[1305211457000,331],[1305211463000,1945],[1305211468000,1446],[1305211473000,325],[1305211478000,16],[1305211483000,709],[1305211488000,281],[1305211493000,273],[1305211498000,24],[1305211503000,5879],[1305211508000,2630],[1305211513000,2261],[1305211518000,860],[1305211523000,27],[1305211528000,15],[1305211533000,341],[1305211539000,25],[1305211544000,1124],[1305211549000,14],[1305211554000,51],[1305211559000,24],[1305211564000,1090],[1305211569000,2731],[1305211574000,1560],[1305211579000,2695],[1305211584000,413],[1305211589000,15],[1305211594000,543],[1305211599000,31],[1305211604000,30],[1305211609000,50],[1305211614000,16],[1305211619000,24],[1305211624000,215],[1305211629000,2321],[1305211634000,416],[1305211639000,222],[1305211644000,790],[1305211649000,26],[1305211654000,333],[1305211659000,19],[1305211665000,26],[1305211670000,29],[1305211675000,16],[1305211680000,24],[1305211685000,556],[1305211690000,2307],[1305211695000,428],[1305211700000,591],[1305211705000,1695],[1305211710000,2123],[1305211715000,321],[1305211720000,21],[1305211725000,30],[1305211730000,30],[1305211735000,26],[1305211740000,104],[1305211745000,1006],[1305211750000,1427],[1305211755000,419],[1305211760000,16],[1305211765000,26],[1305211770000,28],[1305211775000,339],[1305211780000,35],[1305211785000,17],[1305211791000,25],[1305211796000,25],[1305211801000,160],[1305211806000,5863],[1305211811000,2987],[1305211816000,1448],[1305211821000,2122],[1305211826000,953],[1305211831000,15],[1305211837000,319],[1305211842000,36],[1305211847000,27],[1305211852000,28],[1305211857000,14],[1305211862000,194],[1305211867000,1913],[1305211872000,451],[1305211877000,407],[1305211882000,27],[1305211887000,28],[1305211892000,323],[1305211898000,11],[1305211903000,35],[1305211908000,29],[1305211913000,28],[1305211918000,25],[1305211923000,547],[1305211928000,2117],[1305211933000,658],[1305211938000,541],[1305211943000,802],[1305211948000,2207],[1305211953000,1527],[1305211958000,446],[1305211963000,34],[1305211968000,30],[1305211973000,104],[1305211978000,25],[1305211983000,184],[1305211988000,2332],[1305211993000,416],[1305211998000,829],[1305212003000,994],[1305212008000,1342],[1305212013000,2857],[1305212019000,291],[1305212024000,29],[1305212029000,20],[1305212034000,190],[1305212039000,26],[1305212044000,1242],[1305212049000,3188],[1305212054000,414],[1305212059000,569],[1305212064000,1495],[1305212069000,1039],[1305212074000,1201],[1305212079000,28],[1305212084000,28],[1305212090000,29],[1305212095000,14],[1305212100000,26],[1305212105000,5883],[1305212110000,2710],[1305212115000,37],[1305212120000,21],[1305212125000,978],[1305212130000,27],[1305212135000,323],[1305212140000,18],[1305212145000,28],[1305212150000,35],[1305212155000,25],[1305212160000,36],[1305212165000,658],[1305212170000,3123],[1305212175000,640],[1305212180000,1955],[1305212185000,1284],[1305212190000,27],[1305212195000,1194],[1305212200000,794],[1305212205000,13],[1305212210000,35],[1305212216000,20],[1305212221000,97],[1305212226000,1839],[1305212231000,993],[1305212236000,26],[1305212241000,31],[1305212246000,14],[1305212251000,26],[1305212256000,342],[1305212261000,32],[1305212266000,13],[1305212271000,227],[1305212276000,786],[1305212281000,304],[1305212286000,2033],[1305212291000,995],[1305212296000,614],[1305212301000,3172],[1305212306000,508],[1305212311000,27],[1305212316000,541],[1305212321000,33],[1305212326000,26],[1305212331000,21],[1305212336000,25],[1305212342000,161],[1305212347000,2281],[1305212352000,1025],[1305212357000,416],[1305212362000,29],[1305212367000,29],[1305212372000,13],[1305212377000,324],[1305212382000,33],[1305212387000,27],[1305212392000,18],[1305212397000,27],[1305212402000,3519],[1305212407000,4342],[1305212412000,826],[1305212417000,690],[1305212422000,1463],[1305212427000,1890],[1305212432000,863],[1305212438000,362],[1305212443000,32],[1305212448000,27],[1305212453000,29],[1305212458000,15],[1305212463000,388],[1305212468000,2299],[1305212473000,822],[1305212478000,407],[1305212483000,28],[1305212488000,29],[1305212493000,341],[1305212498000,15],[1305212503000,225],[1305212508000,789],[1305212513000,30],[1305212518000,26],[1305212523000,537],[1305212528000,2357],[1305212533000,419],[1305212538000,2186],[1305212543000,2370],[1305212548000,30],[1305212553000,324],[1305212558000,14],[1305212564000,29],[1305212569000,27],[1305212574000,28],[1305212579000,27],[1305212584000,182],[1305212589000,2327],[1305212594000,417],[1305212599000,28],[1305212604000,26],[1305212609000,556],[1305212614000,741],[1305212619000,29],[1305212624000,30],[1305212629000,17],[1305212634000,48],[1305212639000,27],[1305212644000,557],[1305212649000,2310],[1305212654000,1174],[1305212659000,29],[1305212664000,26],[1305212669000,1236],[1305212674000,2118],[1305212679000,17],[1305212684000,1465],[1305212690000,25],[1305212695000,15],[1305212700000,27],[1305212705000,5918],[1305212710000,2323],[1305212715000,26],[1305212720000,419],[1305212725000,567],[1305212730000,283],[1305212735000,505],[1305212740000,17],[1305212745000,29],[1305212750000,30],[1305212755000,16],[1305212760000,48],[1305212765000,1164],[1305212770000,1674],[1305212775000,739],[1305212780000,17],[1305212785000,653],[1305212790000,869],[1305212795000,1165],[1305212800000,1330],[1305212805000,14],[1305212810000,367],[1305212816000,23],[1305212821000,15],[1305212826000,919],[1305212831000,1758],[1305212836000,445],[1305212841000,17],[1305212846000,28],[1305212851000,28],[1305212856000,326],[1305212861000,31],[1305212866000,15],[1305212871000,32],[1305212876000,27],[1305212881000,244],[1305212886000,2163],[1305212891000,810],[1305212896000,416],[1305212901000,2093],[1305212906000,1466],[1305212911000,1371],[1305212916000,342],[1305212921000,33],[1305212926000,14],[1305212931000,143],[1305212936000,26],[1305212942000,162],[1305212947000,1743],[1305212952000,1009],[1305212958000,22],[1305212963000,28],[1305212968000,29],[1305212973000,324],[1305212978000,16],[1305212983000,31],[1305212989000,22],[1305212994000,987],[1305212999000,26],[1305213004000,4623],[1305213009000,3629],[1305213014000,413],[1305213020000,1052],[1305213025000,2007],[1305213030000,1216],[1305213035000,538],[1305213040000,563],[1305213045000,446],[1305213050000,28],[1305213055000,19],[1305213060000,109],[1305213065000,127],[1305213070000,2701],[1305213075000,37],[1305213080000,14],[1305213085000,29],[1305213090000,27],[1305213095000,341],[1305213100000,19],[1305213105000,226],[1305213110000,28],[1305213115000,573],[1305213120000,349],[1305213125000,727],[1305213131000,1893],[1305213136000,1197],[1305213141000,493],[1305213146000,2055],[1305213151000,711],[1305213156000,342],[1305213161000,232],[1305213166000,775],[1305213171000,28],[1305213176000,27],[1305213181000,194],[1305213186000,1903],[1305213191000,870],[1305213196000,27],[1305213201000,27],[1305213206000,19],[1305213211000,28],[1305213216000,323],[1305213221000,229],[1305213226000,615],[1305213231000,191],[1305213236000,26],[1305213241000,246],[1305213246000,2362],[1305213252000,696],[1305213257000,612],[1305213262000,622],[1305213267000,2542],[1305213272000,29],[1305213277000,515],[1305213282000,632],[1305213287000,28],[1305213292000,17],[1305213297000,188],[1305213302000,2812],[1305213307000,4963],[1305213312000,985],[1305213317000,28],[1305213322000,27],[1305213327000,29],[1305213332000,17],[1305213337000,322],[1305213342000,32],[1305213347000,28],[1305213352000,17],[1305213357000,218],[1305213362000,1256],[1305213367000,2228],[1305213373000,912],[1305213378000,17],[1305213383000,3456],[1305213388000,29],[1305213393000,343],[1305213398000,14],[1305213403000,32],[1305213408000,28],[1305213413000,28],[1305213418000,315],[1305213423000,853],[1305213428000,2331],[1305213433000,414],[1305213438000,18],[1305213443000,27],[1305213448000,28],[1305213453000,326],[1305213458000,13],[1305213463000,33],[1305213468000,27],[1305213473000,29],[1305213478000,25],[1305213483000,672],[1305213488000,3028],[1305213494000,768],[1305213499000,651],[1305213504000,2272],[1305213509000,756],[1305213514000,342],[1305213519000,12],[1305213524000,34],[1305213529000,27],[1305213534000,31],[1305213539000,26],[1305213544000,185],[1305213550000,1944],[1305213555000,466],[1305213560000,29],[1305213565000,27],[1305213570000,28],[1305213575000,872],[1305213580000,434],[1305213585000,30],[1305213590000,51],[1305213595000,16],[1305213600000,121],[1305213605000,6151],[1305213610000,2029],[1305213615000,429],[1305213620000,433],[1305213625000,218],[1305213630000,2441],[1305213636000,2570],[1305213641000,31],[1305213646000,15],[1305213651000,30],[1305213656000,52],[1305213661000,105],[1305213666000,1952],[1305213671000,616],[1305213676000,456],[1305213681000,17],[1305213686000,27],[1305213691000,28],[1305213696000,328],[1305213701000,32],[1305213706000,210],[1305213711000,213],[1305213716000,444],[1305213721000,407],[1305213726000,2669],[1305213731000,835],[1305213736000,1981],[1305213741000,644],[1305213746000,815],[1305213751000,29],[1305213757000,449],[1305213762000,32],[1305213767000,15],[1305213772000,30],[1305213777000,26],[1305213782000,195],[1305213787000,1899],[1305213792000,835],[1305213797000,28],[1305213802000,27],[1305213807000,28],[1305213812000,17],[1305213817000,324],[1305213822000,34],[1305213827000,27],[1305213832000,17],[1305213837000,25],[1305213842000,456],[1305213847000,2205],[1305213852000,254],[1305213857000,852],[1305213862000,1582],[1305213867000,662],[1305213872000,294],[1305213877000,1295],[1305213883000,26],[1305213888000,27],[1305213893000,30],[1305213898000,13],[1305213903000,4756],[1305213908000,3248],[1305213913000,373],[1305213918000,271],[1305213923000,26],[1305213928000,446],[1305213933000,328],[1305213938000,18],[1305213943000,32],[1305213948000,26],[1305213953000,28],[1305213958000,15],[1305213963000,698],[1305213968000,2354],[1305213973000,415],[1305213978000,1312],[1305213983000,2452],[1305213988000,29],[1305213993000,325],[1305213998000,17],[1305214004000,26],[1305214009000,27],[1305214014000,27],[1305214019000,27],[1305214024000,184],[1305214029000,1916],[1305214034000,445],[1305214039000,406],[1305214044000,26],[1305214049000,29],[1305214054000,332],[1305214059000,17],[1305214064000,357],[1305214069000,1788],[1305214074000,275],[1305214079000,27],[1305214084000,549],[1305214089000,2961],[1305214094000,1830],[1305214099000,1700],[1305214104000,26],[1305214109000,18],[1305214114000,339],[1305214119000,43],[1305214124000,43],[1305214130000,14],[1305214135000,27],[1305214140000,27],[1305214145000,196],[1305214150000,2319],[1305214155000,415],[1305214160000,28],[1305214165000,50],[1305214170000,69],[1305214175000,333],[1305214180000,22],[1305214185000,29],[1305214190000,29],[1305214195000,14],[1305214200000,66],[1305214205000,6342],[1305214210000,2473],[1305214215000,1030],[1305214220000,2534],[1305214225000,26],[1305214230000,29],[1305214235000,312],[1305214240000,34],[1305214245000,29],[1305214250000,28],[1305214256000,13],[1305214261000,196],[1305214266000,570],[1305214271000,1782],[1305214276000,428],[1305214281000,14],[1305214286000,27],[1305214291000,29],[1305214296000,322],[1305214301000,38],[1305214306000,15],[1305214311000,28],[1305214316000,26],[1305214321000,234],[1305214326000,2242],[1305214331000,1168],[1305214336000,1275],[1305214341000,2076],[1305214346000,16],[1305214351000,29],[1305214356000,340],[1305214361000,62],[1305214366000,15],[1305214371000,35],[1305214376000,26],[1305214382000,162],[1305214387000,1742],[1305214392000,998],[1305214397000,27],[1305214402000,26],[1305214407000,15],[1305214412000,29],[1305214417000,320],[1305214422000,37],[1305214427000,14],[1305214432000,29],[1305214437000,26],[1305214442000,545],[1305214447000,2072],[1305214452000,1398],[1305214458000,805],[1305214463000,2038],[1305214468000,130],[1305214473000,17],[1305214478000,539],[1305214483000,37],[1305214488000,27],[1305214493000,27],[1305214498000,14],[1305214503000,4612],[1305214508000,3031],[1305214513000,453],[1305214518000,406],[1305214523000,27],[1305214528000,28],[1305214533000,342],[1305214538000,12],[1305214544000,31],[1305214549000,27],[1305214554000,28],[1305214559000,24],[1305214564000,545],[1305214569000,2322],[1305214574000,419],[1305214579000,1349],[1305214584000,2479],[1305214589000,27],[1305214594000,343],[1305214599000,13],[1305214604000,35],[1305214609000,28],[1305214614000,27],[1305214619000,24],[1305214624000,185],[1305214629000,2332],[1305214634000,418],[1305214639000,29],[1305214644000,15],[1305214649000,26],[1305214654000,325],[1305214659000,13],[1305214664000,35],[1305214669000,29],[1305214675000,23],[1305214680000,23],[1305214685000,556],[1305214690000,2625],[1305214695000,1331],[1305214700000,33],[1305214705000,632],[1305214710000,375],[1305214715000,948],[1305214720000,972],[1305214725000,30],[1305214730000,31],[1305214735000,16],[1305214740000,164],[1305214745000,990],[1305214750000,1334],[1305214755000,278],[1305214760000,449],[1305214765000,15],[1305214770000,37],[1305214775000,327],[1305214780000,19],[1305214785000,29],[1305214790000,32],[1305214796000,12],[1305214801000,631],[1305214806000,5879],[1305214811000,1536],[1305214816000,278],[1305214821000,409],[1305214826000,573],[1305214831000,25],[1305214836000,1789],[1305214841000,652],[1305214846000,921],[1305214851000,450],[1305214856000,25],[1305214861000,181],[1305214866000,1888],[1305214871000,370],[1305214876000,290],[1305214881000,18],[1305214886000,444],[1305214891000,25],[1305214896000,573],[1305214901000,34],[1305214906000,14],[1305214911000,31],[1305214917000,22],[1305214922000,242],[1305214927000,2071],[1305214932000,608],[1305214937000,306],[1305214942000,416],[1305214947000,815],[1305214952000,25],[1305214957000,320],[1305214962000,624],[1305214967000,14],[1305214972000,31],[1305214977000,28],[1305214982000,2356],[1305214987000,1870],[1305214992000,629],[1305214997000,444],[1305215002000,26],[1305215007000,29],[1305215012000,15],[1305215017000,338],[1305215022000,635],[1305215027000,189],[1305215032000,94],[1305215037000,27],[1305215043000,314],[1305215048000,1955],[1305215053000,838],[1305215058000,16],[1305215063000,414],[1305215068000,31],[1305215073000,15],[1305215078000,386],[1305215083000,739],[1305215088000,27],[1305215093000,2263],[1305215098000,928],[1305215103000,6635],[1305215108000,2095],[1305215113000,629],[1305215118000,16],[1305215123000,444],[1305215128000,30],[1305215133000,347],[1305215138000,13],[1305215143000,36],[1305215148000,27],[1305215153000,27],[1305215158000,16],[1305215164000,252],[1305215169000,2440],[1305215174000,270],[1305215179000,748],[1305215184000,25],[1305215189000,29],[1305215194000,884],[1305215199000,342],[1305215204000,35],[1305215209000,777],[1305215214000,2691],[1305215219000,27],[1305215224000,183],[1305215229000,2388],[1305215234000,334],[1305215239000,515],[1305215244000,26],[1305215249000,30],[1305215254000,545],[1305215259000,13],[1305215264000,37],[1305215269000,78],[1305215274000,27],[1305215279000,27],[1305215285000,462],[1305215290000,2110],[1305215295000,659],[1305215300000,27],[1305215305000,598],[1305215310000,1510],[1305215315000,1244],[1305215320000,950],[1305215325000,48],[1305215330000,15],[1305215335000,27],[1305215340000,27],[1305215345000,201],[1305215350000,2206],[1305215355000,699],[1305215360000,53],[1305215365000,25],[1305215370000,18],[1305215375000,573],[1305215380000,1749],[1305215385000,783],[1305215390000,28],[1305215395000,14],[1305215400000,144],[1305215406000,4865],[1305215411000,2397],[1305215416000,1005],[1305215421000,418],[1305215426000,881],[1305215431000,620],[1305215436000,381],[1305215441000,337],[1305215446000,393],[1305215451000,644],[1305215456000,986],[1305215461000,105],[1305215466000,1955],[1305215471000,618],[1305215476000,39],[1305215481000,434],[1305215486000,26],[1305215491000,28],[1305215496000,1807],[1305215501000,1503],[1305215506000,15],[1305215511000,31],[1305215516000,24],[1305215521000,233],[1305215527000,2280],[1305215532000,1544],[1305215537000,202],[1305215542000,2122],[1305215547000,1225],[1305215552000,28],[1305215557000,323],[1305215562000,58],[1305215567000,17],[1305215572000,32],[1305215577000,25],[1305215582000,194],[1305215587000,2077],[1305215592000,690],[1305215597000,30],[1305215602000,30],[1305215607000,15],[1305215612000,27],[1305215617000,340],[1305215622000,33],[1305215627000,17],[1305215632000,30],[1305215637000,26],[1305215642000,243],[1305215647000,2036],[1305215653000,503],[1305215658000,227],[1305215663000,800],[1305215668000,2431],[1305215673000,616],[1305215678000,1065],[1305215683000,224],[1305215688000,31],[1305215693000,140],[1305215699000,13],[1305215704000,7589],[1305215709000,3792],[1305215714000,292],[1305215719000,489],[1305215724000,27],[1305215729000,53],[1305215734000,328],[1305215739000,14],[1305215744000,31],[1305215749000,29],[1305215755000,26],[1305215760000,26],[1305215765000,846],[1305215770000,2069],[1305215776000,245],[1305215781000,426],[1305215786000,27],[1305215791000,26],[1305215796000,2445],[1305215801000,1797],[1305215806000,775],[1305215811000,52],[1305215816000,17],[1305215821000,193],[1305215826000,1942],[1305215831000,616],[1305215836000,454],[1305215841000,1485],[1305215846000,1421],[1305215851000,27],[1305215856000,345],[1305215861000,32],[1305215866000,13],[1305215871000,705],[1305215876000,445],[1305215881000,143],[1305215886000,1953],[1305215891000,615],[1305215897000,231],[1305215902000,417],[1305215907000,843],[1305215912000,498],[1305215917000,861],[1305215922000,33],[1305215927000,1102],[1305215932000,1051],[1305215937000,1799],[1305215942000,410],[1305215947000,1894],[1305215952000,628],[1305215957000,443],[1305215963000,23],[1305215968000,32],[1305215973000,14],[1305215978000,1509],[1305215983000,34],[1305215988000,27],[1305215993000,18],[1305215998000,29],[1305216003000,4850],[1305216008000,3269],[1305216013000,1353],[1305216018000,16],[1305216023000,348],[1305216028000,728],[1305216033000,1709],[1305216038000,1374],[1305216043000,452],[1305216048000,28],[1305216053000,28],[1305216058000,19],[1305216063000,193],[1305216068000,2214],[1305216073000,900],[1305216078000,360],[1305216084000,369],[1305216089000,33],[1305216094000,323],[1305216099000,13],[1305216104000,33],[1305216109000,27],[1305216114000,27],[1305216119000,20],[1305216124000,312],[1305216129000,2346],[1305216134000,762],[1305216139000,1295],[1305216144000,187],[1305216149000,32],[1305216154000,921],[1305216159000,1194],[1305216164000,1296],[1305216169000,28],[1305216174000,27],[1305216179000,418],[1305216184000,183],[1305216189000,2115],[1305216194000,464],[1305216199000,1372],[1305216205000,1470],[1305216210000,34],[1305216215000,336],[1305216220000,15],[1305216225000,31],[1305216230000,702],[1305216235000,444],[1305216240000,114],[1305216245000,691],[1305216250000,2844],[1305216255000,1806],[1305216260000,1955],[1305216265000,2342],[1305216270000,836],[1305216275000,332],[1305216280000,4],[1305216285000,86],[1305216290000,1066],[1305216295000,50],[1305216300000,642],[1305216305000,5848],[1305216310000,2457],[1305216315000,24],[1305216320000,27],[1305216325000,27],[1305216331000,17],[1305216336000,1151],[1305216341000,816],[1305216346000,28],[1305216351000,29],[1305216356000,177],[1305216361000,160],[1305216366000,2217],[1305216371000,1151],[1305216376000,415],[1305216381000,1252],[1305216386000,2025],[1305216391000,34],[1305216396000,320],[1305216401000,34],[1305216406000,14],[1305216411000,29],[1305216416000,210],[1305216421000,2365],[1305216426000,2583],[1305216431000,648],[1305216436000,37],[1305216441000,14],[1305216446000,27],[1305216451000,905],[1305216457000,471],[1305216462000,35],[1305216467000,13],[1305216472000,155],[1305216477000,27],[1305216482000,229],[1305216487000,2198],[1305216492000,597],[1305216497000,1138],[1305216502000,25],[1305216507000,17],[1305216512000,278],[1305216517000,1803],[1305216522000,527],[1305216527000,637],[1305216532000,29],[1305216537000,27],[1305216542000,195],[1305216547000,2058],[1305216552000,501],[1305216557000,443],[1305216562000,28],[1305216567000,16],[1305216572000,224],[1305216578000,273],[1305216583000,33],[1305216588000,120],[1305216593000,687],[1305216598000,26],[1305216603000,3734],[1305216608000,4618],[1305216613000,952],[1305216618000,380],[1305216623000,2843],[1305216628000,221],[1305216633000,1375],[1305216638000,1200],[1305216643000,1988],[1305216648000,343],[1305216653000,77],[1305216658000,27],[1305216663000,192],[1305216668000,2412],[1305216673000,704],[1305216678000,820],[1305216683000,52],[1305216688000,29],[1305216693000,12],[1305216699000,294],[1305216704000,34],[1305216709000,26],[1305216714000,29],[1305216719000,15],[1305216724000,693],[1305216729000,2608],[1305216734000,415],[1305216739000,614],[1305216744000,2789],[1305216749000,826],[1305216754000,484],[1305216759000,20],[1305216764000,33],[1305216769000,27],[1305216774000,27],[1305216779000,27],[1305216784000,181],[1305216789000,2378],[1305216794000,416],[1305216799000,16],[1305216804000,25],[1305216809000,29],[1305216814000,330],[1305216820000,16],[1305216825000,34],[1305216830000,26],[1305216835000,27],[1305216840000,111],[1305216845000,526],[1305216850000,2372],[1305216855000,416],[1305216860000,1112],[1305216865000,224],[1305216870000,29],[1305216875000,1049],[1305216880000,1523],[1305216885000,43],[1305216890000,26],[1305216895000,28],[1305216900000,722],[1305216905000,6383],[1305216910000,2136],[1305216915000,280],[1305216920000,448],[1305216925000,27],[1305216930000,17],[1305216935000,874],[1305216941000,355],[1305216946000,44],[1305216951000,29],[1305216956000,15],[1305216961000,234],[1305216966000,2135],[1305216971000,600],[1305216976000,26],[1305216981000,419],[1305216986000,222],[1305216991000,779],[1305216996000,328],[1305217001000,1315],[1305217006000,755],[1305217011000,113],[1305217016000,2078],[1305217021000,533],[1305217026000,1969],[1305217031000,369],[1305217036000,277],[1305217041000,29],[1305217046000,929],[1305217051000,500],[1305217056000,343],[1305217062000,53],[1305217067000,39],[1305217072000,77],[1305217077000,52],[1305217082000,772],[1305217087000,2466],[1305217092000,330],[1305217097000,483],[1305217102000,443],[1305217107000,42],[1305217112000,27],[1305217117000,345],[1305217122000,1927],[1305217127000,1141],[1305217132000,863],[1305217137000,938],[1305217142000,193],[1305217147000,2094],[1305217152000,1421],[1305217157000,52],[1305217162000,470],[1305217167000,40],[1305217173000,24],[1305217178000,362],[1305217183000,61],[1305217188000,40],[1305217193000,58],[1305217198000,23],[1305217203000,4456],[1305217208000,3463],[1305217213000,805],[1305217218000,627],[1305217223000,654],[1305217228000,188],[1305217233000,43],[1305217238000,1730],[1305217243000,1520],[1305217248000,53],[1305217253000,94],[1305217258000,1074],[1305217263000,142],[1305217268000,1977],[1305217273000,227],[1305217278000,229],[1305217283000,280],[1305217289000,44],[1305217294000,459],[1305217299000,360],[1305217304000,251],[1305217309000,817],[1305217314000,26],[1305217319000,40],[1305217324000,265],[1305217329000,2057],[1305217334000,455],[1305217339000,286],[1305217344000,414],[1305217349000,363],[1305217354000,382],[1305217359000,14],[1305217364000,35],[1305217369000,30],[1305217374000,25],[1305217379000,15],[1305217384000,193],[1305217389000,2198],[1305217394000,28],[1305217399000,185],[1305217405000,181],[1305217410000,1418],[1305217415000,609],[1305217420000,505],[1305217425000,36],[1305217430000,507],[1305217435000,26],[1305217440000,52],[1305217445000,1719],[1305217450000,2267],[1305217455000,505],[1305217460000,17],[1305217465000,480],[1305217470000,27],[1305217475000,558],[1305217480000,5],[1305217485000,675],[1305217490000,134],[1305217495000,521],[1305217500000,272],[1305217505000,5813],[1305217510000,2234],[1305217516000,164],[1305217521000,223],[1305217526000,13],[1305217531000,295],[1305217536000,739],[1305217541000,3],[1305217546000,495],[1305217551000,45],[1305217556000,12],[1305217561000,137],[1305217566000,2854],[1305217571000,1601],[1305217576000,341],[1305217581000,374],[1305217586000,123],[1305217591000,372],[1305217596000,359],[1305217601000,4],[1305217606000,45],[1305217611000,33],[1305217616000,556],[1305217621000,113],[1305217626000,2521],[1305217631000,66],[1305217637000,24],[1305217642000,201],[1305217647000,223],[1305217652000,25],[1305217657000,595],[1305217662000,18],[1305217667000,31],[1305217672000,517],[1305217677000,529],[1305217682000,135],[1305217687000,3017],[1305217692000,85],[1305217697000,360],[1305217702000,1015],[1305217707000,326],[1305217712000,25],[1305217717000,328],[1305217722000,626],[1305217727000,16],[1305217732000,334],[1305217737000,27],[1305217742000,748],[1305217747000,3146],[1305217752000,25],[1305217757000,423],[1305217763000,25],[1305217768000,332],[1305217773000,25],[1305217778000,353],[1305217783000,563],[1305217788000,17],[1305217793000,32],[1305217798000,29],[1305217803000,4421],[1305217808000,3991],[1305217813000,103],[1305217818000,678],[1305217823000,28],[1305217828000,386],[1305217833000,14],[1305217838000,319],[1305217843000,32],[1305217848000,585],[1305217853000,18],[1305217858000,29],[1305217863000,115],[1305217868000,3529],[1305217873000,37],[1305217879000,378],[1305217884000,28],[1305217889000,377],[1305217894000,1166],[1305217899000,791],[1305217904000,31],[1305217909000,651],[1305217914000,19],[1305217919000,27],[1305217924000,222],[1305217929000,3468],[1305217934000,1628],[1305217939000,17],[1305217944000,374],[1305217949000,33],[1305217954000,3142],[1305217959000,73],[1305217964000,31],[1305217969000,29],[1305217974000,747],[1305217979000,17],[1305217984000,195],[1305217989000,2126],[1305217995000,387],[1305218000000,444],[1305218005000,26],[1305218010000,32],[1305218015000,339],[1305218020000,13],[1305218025000,31],[1305218030000,29],[1305218035000,27],[1305218040000,29],[1305218045000,1859],[1305218050000,2476],[1305218055000,278],[1305218060000,441],[1305218065000,26],[1305218070000,581],[1305218075000,401],[1305218080000,3],[1305218085000,861],[1305218090000,1577],[1305218095000,27],[1305218100000,926],[1305218105000,5795],[1305218110000,2398],[1305218116000,1380],[1305218121000,489],[1305218126000,719],[1305218131000,30],[1305218136000,355],[1305218141000,3],[1305218146000,1467],[1305218151000,27],[1305218156000,189],[1305218161000,240],[1305218166000,2167],[1305218171000,1962],[1305218176000,25],[1305218181000,808],[1305218186000,27],[1305218191000,18],[1305218196000,1615],[1305218201000,141],[1305218206000,649],[1305218211000,31],[1305218216000,15],[1305218221000,194],[1305218226000,1945],[1305218231000,2208],[1305218237000,20],[1305218242000,29],[1305218247000,27],[1305218252000,467],[1305218257000,329],[1305218262000,6],[1305218267000,49],[1305218272000,31],[1305218277000,26],[1305218282000,231],[1305218287000,2141],[1305218292000,597],[1305218297000,676],[1305218302000,28],[1305218307000,16],[1305218312000,2270],[1305218317000,981],[1305218322000,20],[1305218327000,27],[1305218332000,31],[1305218337000,1260],[1305218342000,181],[1305218347000,1791],[1305218352000,607],[1305218358000,658],[1305218363000,28],[1305218368000,15],[1305218373000,26],[1305218378000,325],[1305218383000,35],[1305218388000,25],[1305218393000,19],[1305218398000,25],[1305218403000,6637],[1305218408000,2594],[1305218414000,357],[1305218419000,417],[1305218424000,621],[1305218429000,832],[1305218434000,14],[1305218439000,1924],[1305218444000,109],[1305218449000,25],[1305218454000,19],[1305218459000,24],[1305218464000,193],[1305218469000,2564],[1305218474000,445],[1305218479000,15],[1305218484000,28],[1305218489000,27],[1305218494000,561],[1305218499000,32],[1305218504000,34],[1305218509000,26],[1305218514000,30],[1305218519000,13],[1305218524000,563],[1305218529000,2370],[1305218535000,347],[1305218540000,2862],[1305218545000,664],[1305218550000,27],[1305218555000,323],[1305218560000,17],[1305218565000,35],[1305218570000,26],[1305218575000,28],[1305218580000,26],[1305218585000,181],[1305218590000,2366],[1305218595000,418],[1305218600000,16],[1305218605000,27],[1305218610000,29],[1305218615000,332],[1305218620000,5],[1305218625000,35],[1305218630000,27],[1305218635000,28],[1305218640000,233],[1305218645000,1126],[1305218651000,1528],[1305218656000,1212],[1305218661000,211],[1305218666000,1163],[1305218671000,398],[1305218676000,354],[1305218681000,5],[1305218686000,657],[1305218691000,528],[1305218696000,27],[1305218701000,2706],[1305218706000,5180],[1305219432000,1213],[1305219437000,153],[1305219442000,464],[1305219447000,27],[1305219452000,31],[1305219457000,329],[1305219462000,764],[1305219467000,72],[1305219472000,190],[1305219477000,104],[1305219482000,285],[1305219487000,1617],[1305219492000,1109],[1305219497000,1410],[1305219502000,671],[1305219507000,256],[1305219513000,1144],[1305219518000,1839],[1305219523000,28],[1305219528000,640],[1305219533000,26],[1305219538000,1079],[1305219543000,250],[1305219548000,1358],[1305219553000,1382],[1305219558000,110],[1305219563000,675],[1305219568000,183],[1305219573000,435],[1305219578000,347],[1305219583000,29],[1305219588000,29],[1305219593000,15],[1305219598000,54],[1305219603000,5732],[1305219608000,2023],[1305219613000,1238],[1305219618000,368],[1305219624000,415],[1305219629000,380],[1305219634000,1444],[1305219639000,2329],[1305219644000,1880],[1305219649000,1790],[1305219655000,296],[1305219660000,26],[1305219665000,219],[1305219670000,1980],[1305219675000,844],[1305219680000,510],[1305219685000,105],[1305219690000,511],[1305219695000,31],[1305219700000,503],[1305219705000,31],[1305219711000,128],[1305219716000,82],[1305219721000,227],[1305219726000,919],[1305219731000,2468],[1305219736000,1907],[1305219741000,2169],[1305219746000,24],[1305219751000,1551],[1305219756000,17],[1305219761000,343],[1305219766000,705],[1305219771000,445],[1305219776000,227],[1305219781000,376],[1305219786000,3019],[1305219791000,778],[1305219796000,1053],[1305219801000,408],[1305219806000,590],[1305219811000,1096],[1305219816000,15],[1305219821000,327],[1305219826000,32],[1305219832000,23],[1305219837000,521],[1305219842000,155],[1305219847000,953],[1305219852000,1926],[1305219857000,273],[1305219862000,512],[1305219867000,515],[1305219872000,224],[1305219877000,976],[1305219882000,126],[1305219887000,33],[1305219892000,1227],[1305219897000,219],[1305219902000,4576],[1305219907000,4257],[1305219912000,3039],[1305219917000,310],[1305219922000,489],[1305219927000,206],[1305219932000,319],[1305219937000,701],[1305219943000,309],[1305219948000,18],[1305219953000,28],[1305219958000,101],[1305219963000,276],[1305219968000,1949],[1305219973000,1217],[1305219978000,938],[1305219983000,793],[1305219988000,111],[1305219993000,29],[1305219998000,1878],[1305220003000,1229],[1305220008000,31],[1305220013000,557],[1305220018000,442],[1305220023000,193],[1305220028000,2177],[1305220033000,630],[1305220038000,1044],[1305220043000,191],[1305220048000,23],[1305220053000,16],[1305220058000,354],[1305220063000,61],[1305220069000,25],[1305220074000,18],[1305220079000,24],[1305220084000,451],[1305220089000,1686],[1305220094000,277],[1305220099000,1341],[1305220104000,723],[1305220109000,23],[1305220114000,2443],[1305220119000,1614],[1305220124000,34],[1305220129000,605],[1305220134000,30],[1305220139000,13],[1305220144000,115],[1305220149000,2216],[1305220154000,272],[1305220159000,405],[1305220164000,27],[1305220169000,26],[1305220174000,28],[1305220179000,312],[1305220185000,28],[1305220190000,30],[1305220195000,225],[1305220200000,968],[1305220205000,6115],[1305220210000,2588],[1305220216000,47],[1305220221000,1346],[1305220226000,583],[1305220231000,1364],[1305220237000,550],[1305220242000,1078],[1305220248000,31],[1305220253000,29],[1305220258000,30],[1305220263000,191],[1305220268000,2186],[1305220273000,312],[1305220278000,580],[1305220283000,84],[1305220288000,15],[1305220293000,27],[1305220298000,350],[1305220303000,30],[1305220308000,20],[1305220313000,28],[1305220318000,29],[1305220323000,448],[1305220328000,1034],[1305220333000,1683],[1305220338000,742],[1305220343000,29],[1305220348000,374],[1305220353000,1900],[1305220358000,1174],[1305220363000,110],[1305220369000,27],[1305220374000,17],[1305220379000,249],[1305220384000,220],[1305220389000,2836],[1305220394000,847],[1305220399000,29],[1305220404000,30],[1305220409000,26],[1305220414000,27],[1305220419000,314],[1305220424000,29],[1305220429000,33],[1305220434000,28],[1305220439000,17],[1305220444000,461],[1305220449000,2406],[1305220454000,267],[1305220459000,409],[1305220464000,27],[1305220469000,1172],[1305220474000,786],[1305220479000,1869],[1305220484000,29],[1305220490000,27],[1305220495000,29],[1305220500000,27],[1305220505000,6078],[1305220510000,2243],[1305220515000,697],[1305220520000,29],[1305220525000,16],[1305220530000,27],[1305220535000,29],[1305220540000,327],[1305220545000,19],[1305220550000,31],[1305220555000,32],[1305220560000,59],[1305220565000,535],[1305220570000,3104],[1305220575000,976],[1305220580000,28],[1305220585000,672],[1305220590000,1547],[1305220595000,654],[1305220600000,538],[1305220605000,33],[1305220611000,13],[1305220616000,32],[1305220621000,191],[1305220626000,565],[1305220631000,1544],[1305220636000,267],[1305220641000,418],[1305220646000,27],[1305220651000,13],[1305220656000,31],[1305220661000,339],[1305220666000,33],[1305220671000,15],[1305220676000,31],[1305220681000,163],[1305220686000,953],[1305220691000,1787],[1305220696000,667],[1305220701000,27],[1305220706000,55],[1305220711000,1576],[1305220716000,17],[1305220721000,1817],[1305220726000,34],[1305220732000,22],[1305220737000,20],[1305220742000,191],[1305220747000,1022],[1305220752000,1496],[1305220757000,13],[1305220762000,446],[1305220767000,29],[1305220772000,26],[1305220778000,281],[1305220783000,31],[1305220788000,18],[1305220793000,28],[1305220798000,31],[1305220803000,3969],[1305220809000,3137],[1305220814000,1199],[1305220819000,417],[1305220824000,27],[1305220829000,515],[1305220834000,587],[1305220840000,1489],[1305220845000,840],[1305220850000,30],[1305220855000,29],[1305220860000,39],[1305220865000,174],[1305220870000,2481],[1305220875000,481],[1305220880000,28],[1305220885000,16],[1305220890000,29],[1305220895000,25],[1305220900000,327],[1305220905000,35],[1305220911000,14],[1305220916000,30],[1305220921000,157],[1305220926000,844],[1305220931000,2032],[1305220936000,417],[1305220941000,29],[1305220946000,1224],[1305220951000,47],[1305220956000,2548],[1305220961000,332],[1305220966000,35],[1305220971000,14],[1305220976000,29],[1305220981000,197],[1305220986000,555],[1305220991000,1384],[1305220996000,828],[1305221001000,28],[1305221006000,24],[1305221011000,33],[1305221016000,12],[1305221021000,342],[1305221026000,35],[1305221032000,23],[1305221037000,16],[1305221042000,316],[1305221047000,1993],[1305221052000,611],[1305221057000,406],[1305221062000,27],[1305221067000,692],[1305221072000,1389],[1305221077000,768],[1305221082000,1042],[1305221087000,34],[1305221092000,27],[1305221097000,27],[1305221102000,2804],[1305221107000,5047],[1305221112000,1136],[1305221117000,24],[1305221122000,19],[1305221127000,26],[1305221132000,32],[1305221137000,323],[1305221142000,15],[1305221147000,32],[1305221153000,25],[1305221158000,27],[1305221163000,433],[1305221168000,1633],[1305221173000,1205],[1305221178000,415],[1305221183000,31],[1305221188000,1179],[1305221193000,1383],[1305221198000,334],[1305221203000,674],[1305221208000,19],[1305221213000,30],[1305221218000,28],[1305221223000,197],[1305221228000,1527],[1305221233000,971],[1305221238000,442],[1305221243000,31],[1305221248000,14],[1305221253000,33],[1305221258000,325],[1305221263000,28],[1305221269000,25],[1305221274000,18],[1305221279000,28],[1305221284000,559],[1305221289000,2035],[1305221294000,434],[1305221299000,416],[1305221304000,411],[1305221309000,651],[1305221314000,820],[1305221319000,2102],[1305221324000,27],[1305221329000,30],[1305221334000,16],[1305221339000,32],[1305221344000,195],[1305221349000,2243],[1305221354000,694],[1305221359000,16],[1305221364000,28],[1305221369000,28],[1305221374000,29],[1305221379000,328],[1305221384000,26],[1305221389000,31],[1305221395000,26],[1305221400000,19],[1305221405000,6233],[1305221410000,2668],[1305221415000,413],[1305221420000,566],[1305221425000,739],[1305221430000,1991],[1305221435000,29],[1305221440000,1071],[1305221445000,15],[1305221450000,31],[1305221455000,29],[1305221460000,29],[1305221466000,167],[1305221471000,2139],[1305221476000,594],[1305221481000,28],[1305221486000,26],[1305221491000,19],[1305221496000,28],[1305221501000,324],[1305221506000,30],[1305221511000,16],[1305221516000,29],[1305221521000,247],[1305221526000,882],[1305221531000,1569],[1305221536000,1353],[1305221541000,29],[1305221546000,1002],[1305221551000,506],[1305221556000,1443],[1305221561000,326],[1305221566000,29],[1305221571000,28],[1305221576000,212],[1305221581000,118],[1305221587000,1001],[1305221592000,1235],[1305221597000,401],[1305221602000,29],[1305221607000,26],[1305221612000,31],[1305221617000,17],[1305221622000,341],[1305221627000,30],[1305221632000,28],[1305221637000,16],[1305221642000,440],[1305221647000,1090],[1305221652000,1445],[1305221657000,413],[1305221662000,561],[1305221667000,1538],[1305221672000,1531],[1305221677000,327],[1305221682000,14],[1305221687000,31],[1305221692000,27],[1305221697000,27],[1305221702000,3977],[1305221708000,3893],[1305221713000,661],[1305221718000,333],[1305221723000,124],[1305221728000,26],[1305221733000,31],[1305221738000,335],[1305221743000,14],[1305221748000,31],[1305221753000,27],[1305221758000,29],[1305221763000,305],[1305221768000,1914],[1305221773000,1846],[1305221778000,1471],[1305221783000,137],[1305221788000,1972],[1305221793000,1511],[1305221798000,1220],[1305221803000,134],[1305221808000,19],[1305221813000,497],[1305221818000,172],[1305221823000,195],[1305221829000,538],[1305221834000,2097],[1305221839000,27],[1305221844000,462],[1305221849000,211],[1305221854000,72],[1305221859000,743],[1305221864000,29],[1305221869000,30],[1305221874000,16],[1305221879000,27],[1305221884000,584],[1305221889000,2982],[1305221894000,646],[1305221899000,520],[1305221904000,772],[1305221909000,1979],[1305221914000,17],[1305221919000,879],[1305221924000,31],[1305221930000,26],[1305221935000,29],[1305221940000,13],[1305221945000,195],[1305221950000,2329],[1305221955000,609],[1305221960000,562],[1305221965000,137],[1305221970000,134],[1305221975000,30],[1305221980000,332],[1305221985000,31],[1305221990000,29],[1305221995000,28],[1305222000000,48],[1305222005000,6164],[1305222010000,1905],[1305222015000,993],[1305222020000,835],[1305222025000,1088],[1305222030000,661],[1305222035000,1136],[1305222040000,933],[1305222045000,20],];

function formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2) 
{
	var x = Math.round(num * Math.pow(10,dec));
	if (x >= 0) 
		n1=n2='';
	var y = (''+Math.abs(x)).split('');
	var z = y.length - dec; 
	if (z<0) 
		z--; 
	for(var i = z; i < 0; i++) 
		y.unshift('0'); 
	if (z<0) 
		z = 1; 
	y.splice(z, 0, pnt); 
	if(y[0] == pnt) 
		y.unshift('0'); 
	while (z > 3) 
	{
		z-=3; 
		y.splice(z,0,thou);
	}
	var r = curr1+n1+y.join('')+n2+curr2;
	return r;
}

function timedRefresh(timeoutPeriod) {
	  setTimeout("location.reload(true);",timeoutPeriod);
}

var logicalOptionsOld = {
             series: {
               lines: { show: true },
               points: { show: false }
             },
             grid: { hoverable: true, clickable: true },
             xaxis: { mode: 'time', axisLabel: 'Date' },
             yaxis: {labelWidth: 59, tickFormatter: function (v, axis) { return formatNumber(v,0,',','','','','-',''); }, axisLabel: 'Logical IO', axisLabelUseCanvas: true },
             legend: { position: 'nw' },
             selection: { mode: "x" }
           };

function generateAverages(xmin, xmax) {
  var x, y, i;
  var mavg = 0;
  var j = 0;
  var total = 0;
  d1 = new Array();
  
  for (i in LogIOData) {
    if (LogIOData == null) continue;
    x = LogIOData[i][0];
    y = LogIOData[i][1];
    if (xmax != 0 && x > xmax) break;
    if (xmin == 0 || x >= xmin) {
      j++;
      mavg = (j == 1) ? y : ((j - 1)*mavg + y) / j;
      d1.push(new Array(x, mavg));
      total += y;
    }
  }

  var avg = total/j;
  d2 = new Array();
  j = 0;
  for (i in LogIOData) {
    x = LogIOData[i][0];
    if (xmax != 0 && x > xmax) break;
    if (xmin == 0 || x >= xmin) {
      d2.push(new Array(x, avg));
    }
  }
}

function changeZoom(from, to) {
  if (from != 0 && to != 0) {
    var ymin = 0;
    var ymax = 0;
    var y2max = 0;
    var y3max = 0;
    var xmin = -1;
    var y2=0;
    var y3=0;
    var xmax, x, y;
    
    for (i in LogIOData) {
      x = LogIOData[i][0];
      y = LogIOData[i][1];
      if (x > to) break;
      if (x >= from) {
        if (xmin == -1) xmin = x;
        if (y > ymax) ymax = y;
      }

      xmax = x;
    }
    generateAverages(xmin, xmax);
    var logicalOptions = $.extend(true, {}, logicalOptionsOld, {
      xaxis: {
        min: xmin,
        max: xmax
      },
      yaxis: {
        min: ymin,
        max: ymax
      }
    });
    $.plot($("#container"),[ { data: LogIOData, label: "Percent Complete" }], logicalOptions);
  }
  else {
    generateAverages(0, 0);
    $.plot($("#container"), [ { data: LogIOData, label: "Percent Complete" }], logicalOptionsOld);
  }
}


    var plot = $.plot($("#container"),
           [ { data: LogIOData, label: "Percent Complete" }], logicalOptionsOld);

    function showTooltip(x, y, contents) {
        $('<div id="tooltip">' + contents + '</div>').css( {
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 5,
            border: '1px solid #fdd',
            padding: '2px',
            'background-color': '#fee',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
    }



$(document).ready(function() {
  var total = LogIOData.length;
  if (total >= 10) {
    changeZoom(LogIOData[total - 1][0] - 1800000, LogIOData[total - 1][0]);
    $("#zoom-mode").html("Current Zoom Mode: 30 min");
  }
  else {
    changeZoom(LogIOData[LogIOData.length - 1][0] - 7200000, LogIOData[LogIOData.length - 1][0]);
    $("#zoom-mode").html("Current Zoom Mode: 2 hours");
  }

  if (total == 0) {

  }
  else {
    var previousPoint = null;
    $("#container").bind("plothover", function (event, pos, item) {
        $("#x").text(pos.x.toFixed(2));
        $("#y").text(pos.y.toFixed(2));

            if (item) {
                if (previousPoint != item.datapoint) {
                    previousPoint = item.datapoint;

                    $("#tooltip").remove();
                    var x = item.datapoint[0],
                        y = formatNumber(item.datapoint[1].toFixed(2),2,',','.','','','-','');
                    var d = new Date(x);
                    showTooltip(item.pageX, item.pageY,
                                item.series.label + " on " + d.toUTCString() + " = " + y);
                }
            }
            else {
                $("#tooltip").remove();
                previousPoint = null;
            }
    });
    $("#container").bind("plotselected", function(event, ranges) {
      changeZoom(ranges.xaxis.from, ranges.xaxis.to);
      $("#zoom-mode").html("Current Zoom Mode: Selection");
    });
    $("#zoom-2h").click(function(event) {
      changeZoom(LogIOData[LogIOData.length - 1][0] - 7200000, LogIOData[LogIOData.length - 1][0]);
      $("#zoom-mode").html("Current Zoom Mode: 2 hours");
    });
    $("#zoom-30min").click(function(event) {
      changeZoom(LogIOData[LogIOData.length - 1][0] - 1800000, LogIOData[LogIOData.length - 1][0]);
      $("#zoom-mode").html("Current Zoom Mode: 30 min");
    });
  }
  timedRefresh(5000);
});
  });
  </script>
<form method=POST action="queryDescription.php">
  <input type="hidden" name="action" value="update"></form>
  <br><center><b><font size=3>Logical IO</font></b></center><br>
  <div id="container" style="width:750px;height:300px;"></div>

  <center><br><button id="zoom-2h" class="zoom cronjob">Show Last 2 hours</button> <button id="zoom-30min" class="zoom cronjob">Show Last 30 min</button></center>  </div>
</div>
</body>
</html>

Open in new window

0
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 35751355
read comments in code. Save the file as hielo.php and give it a try
<?php //you may NOT send any output BEFORE this line, otherwise the javascript will not work.

if( isset($_GET['cb']) )
{
  //-- GRAPH STUFF HERE --\\

  $Date = array(); //x axis
  $logicalio = array();

  //---- POPULATE GRAPH DATA ----\\
////////DBA

//HERE, CONNECT TO DB FIRST 
//...

  $query="select * from moniter_data order by time;";
  $result = pg_query($link, $query);
  $total=0;

  while($pdone = pg_fetch_array($result))
  {
    $Date[$total] = $pdone['time'];
    $logicalio[$total] = $pdone['logicalio'];
    $physicalio[$total] = $pdone['physicalio'];
         $sessions[$total] = $pdone['sessions'];
         $total++;
  }
  echo "[";
  //a. I believe you need to start from zero, not from 1
  //b. You need to do -1 to avoit that trailing comma - otherwise IE will choke on it.
  for ($i = 0, $limit=$total-1; $i < $limit; $i++)
  {
    $date = strtotime($Date[$i])*1000;
    $gets = $logicalio[$i];
    echo "[$date,$gets],";
  }
  	//this "repeated" block is due to the "-1". Notice that there is no trailing comma
    $date = strtotime($Date[$i])*1000;
    $gets = $logicalio[$i];
    echo "[$date,$gets]";
	echo ']';
	exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div id="wrap">
  <div id="content">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://people.iola.dk/olau/flot/jquery.flot.js"></script>
<script id="source" type="text/javascript">
var refreshInterval=3*60000;
var LogIOData=null;
$(function () {
	fetch();
});

function fetch(){
	$.getJSON("<?php echo $_SERVER['PHP_SELF'];?>?cb="+(new Date()).valueOf(),function(o){
		LogIOData=o;
		processIt();
	});
}

function formatNumber(num,dec,thou,pnt,curr1,curr2,n1,n2) 
{
	var x = Math.round(num * Math.pow(10,dec));
	if (x >= 0) 
		n1=n2='';
	var y = (''+Math.abs(x)).split('');
	var z = y.length - dec; 
	if (z<0) 
		z--; 
	for(var i = z; i < 0; i++) 
		y.unshift('0'); 
	if (z<0) 
		z = 1; 
	y.splice(z, 0, pnt); 
	if(y[0] == pnt) 
		y.unshift('0'); 
	while (z > 3) 
	{
		z-=3; 
		y.splice(z,0,thou);
	}
	var r = curr1+n1+y.join('')+n2+curr2;
	return r;
}

function timedRefresh(timeoutPeriod) {
	setTimeout(fetch,timeoutPeriod);
}

var logicalOptionsOld = {
             series: {
               lines: { show: true },
               points: { show: false }
             },
             grid: { hoverable: true, clickable: true },
             xaxis: { mode: 'time', axisLabel: 'Date' },
             yaxis: {labelWidth: 59, tickFormatter: function (v, axis) { return formatNumber(v,0,',','','','','-',''); }, axisLabel: 'Logical IO', axisLabelUseCanvas: true },
             legend: { position: 'nw' },
             selection: { mode: "x" }
           };

function generateAverages(xmin, xmax) {
  var x, y, i;
  var mavg = 0;
  var j = 0;
  var total = 0;
  d1 = new Array();
  
  for (i in LogIOData) {
    if (LogIOData == null) continue;
    x = LogIOData[i][0];
    y = LogIOData[i][1];
    if (xmax != 0 && x > xmax) break;
    if (xmin == 0 || x >= xmin) {
      j++;
      mavg = (j == 1) ? y : ((j - 1)*mavg + y) / j;
      d1.push(new Array(x, mavg));
      total += y;
    }
  }

  var avg = total/j;
  d2 = new Array();
  j = 0;
  for (i in LogIOData) {
    x = LogIOData[i][0];
    if (xmax != 0 && x > xmax) break;
    if (xmin == 0 || x >= xmin) {
      d2.push(new Array(x, avg));
    }
  }
}

function changeZoom(from, to) {
  if (from != 0 && to != 0) {
    var ymin = 0;
    var ymax = 0;
    var y2max = 0;
    var y3max = 0;
    var xmin = -1;
    var y2=0;
    var y3=0;
    var xmax, x, y;
    
    for (i in LogIOData) {
      x = LogIOData[i][0];
      y = LogIOData[i][1];
      if (x > to) break;
      if (x >= from) {
        if (xmin == -1) xmin = x;
        if (y > ymax) ymax = y;
      }

      xmax = x;
    }
    generateAverages(xmin, xmax);
    var logicalOptions = $.extend(true, {}, logicalOptionsOld, {
      xaxis: {
        min: xmin,
        max: xmax
      },
      yaxis: {
        min: ymin,
        max: ymax
      }
    });
    $.plot($("#container"),[ { data: LogIOData, label: "Percent Complete" }], logicalOptions);
  }
  else {
    generateAverages(0, 0);
    $.plot($("#container"), [ { data: LogIOData, label: "Percent Complete" }], logicalOptionsOld);
  }
}


    var plot = $.plot($("#container"),
           [ { data: LogIOData, label: "Percent Complete" }], logicalOptionsOld);

    function showTooltip(x, y, contents) {
        $('<div id="tooltip">' + contents + '</div>').css( {
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 5,
            border: '1px solid #fdd',
            padding: '2px',
            'background-color': '#fee',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
    }



function processIt() {
  var total = LogIOData.length;
  if (total >= 10) {
    changeZoom(LogIOData[total - 1][0] - 1800000, LogIOData[total - 1][0]);
    $("#zoom-mode").html("Current Zoom Mode: 30 min");
  }
  else {
    changeZoom(LogIOData[LogIOData.length - 1][0] - 7200000, LogIOData[LogIOData.length - 1][0]);
    $("#zoom-mode").html("Current Zoom Mode: 2 hours");
  }

  if (total == 0) {

  }
  else {
    var previousPoint = null;
    $("#container").bind("plothover", function (event, pos, item) {
        $("#x").text(pos.x.toFixed(2));
        $("#y").text(pos.y.toFixed(2));

            if (item) {
                if (previousPoint != item.datapoint) {
                    previousPoint = item.datapoint;

                    $("#tooltip").remove();
                    var x = item.datapoint[0],
                        y = formatNumber(item.datapoint[1].toFixed(2),2,',','.','','','-','');
                    var d = new Date(x);
                    showTooltip(item.pageX, item.pageY,
                                item.series.label + " on " + d.toUTCString() + " = " + y);
                }
            }
            else {
                $("#tooltip").remove();
                previousPoint = null;
            }
    });
    $("#container").bind("plotselected", function(event, ranges) {
      changeZoom(ranges.xaxis.from, ranges.xaxis.to);
      $("#zoom-mode").html("Current Zoom Mode: Selection");
    });
    $("#zoom-2h").click(function(event) {
      changeZoom(LogIOData[LogIOData.length - 1][0] - 7200000, LogIOData[LogIOData.length - 1][0]);
      $("#zoom-mode").html("Current Zoom Mode: 2 hours");
    });
    $("#zoom-30min").click(function(event) {
      changeZoom(LogIOData[LogIOData.length - 1][0] - 1800000, LogIOData[LogIOData.length - 1][0]);
      $("#zoom-mode").html("Current Zoom Mode: 30 min");
    });
  }
  timedRefresh(refreshInterval);
}
  </script>
<form method='post' action="queryDescription.php">
  <input type="hidden" name="action" value="update"></form>
  <br><center><b><font size=3>Logical IO</font></b></center><br>
  <div id="container" style="width:750px;height:300px;"></div>

  <center><br><button id="zoom-2h" class="zoom cronjob">Show Last 2 hours</button> <button id="zoom-30min" class="zoom cronjob">Show Last 30 min</button></center>  </div>
</div>
</body>
</html>

Open in new window

0
 
LVL 4

Author Closing Comment

by:Alex Matzinger
ID: 35755469
Thank you so much...You are truly amazing.  You solution works perfectly.  I can't emphasize enough how helpful this...Thank you
0
 
LVL 82

Expert Comment

by:hielo
ID: 35757742
Glad to help.

Regards,
Hielo
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month16 days, 13 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question