Вход Регистрация
Файл: admin/skins/lib/flot/examples/visitors.html
Строк: 92
<?php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<
html>
 <
head>
    <
meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <
title>Flot Examples</title>
    <
link href="layout.css" rel="stylesheet" type="text/css">
    <!--[if 
lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]-->
    <
script language="javascript" type="text/javascript" src="../jquery.js"></script>
    <
script language="javascript" type="text/javascript" src="../jquery.flot.js"></script>
    <
script language="javascript" type="text/javascript" src="../jquery.flot.selection.js"></script>
 </
head>
    <
body>
    <
h1>Flot Examples</h1>

    <
div id="placeholder" style="width:600px;height:300px;"></div>

    <
p>Visitors per day to the Flot homepageWeekends are colored. Try zooming.
      
The plot below shows an overview.</p>

    <
div id="overview" style="margin-left:50px;margin-top:20px;width:400px;height:50px"></div>

<
script id="source">
$(function () {
    var 
= [[11964636000000], [11965500000000], [11966364000000], [119672280000077], [11968092000003636], [11968956000003575], [11969820000002736], [11970684000001086], [1197154800000676], [11972412000001205], [1197327600000906], [1197414000000710], [1197500400000639], [1197586800000540], [1197673200000435], [1197759600000301], [1197846000000575], [1197932400000481], [1198018800000591], [1198105200000608], [1198191600000459], [1198278000000234], [11983644000001352], [1198450800000686], [1198537200000279], [1198623600000449], [1198710000000468], [1198796400000392], [1198882800000282], [1198969200000208], [1199055600000229], [1199142000000177], [1199228400000374], [1199314800000436], [1199401200000404], [1199487600000253], [1199574000000218], [1199660400000476], [1199746800000462], [1199833200000448], [1199919600000442], [1200006000000403], [1200092400000204], [1200178800000194], [1200265200000327], [1200351600000374], [1200438000000507], [1200524400000546], [1200610800000482], [1200697200000283], [1200783600000221], [1200870000000483], [1200956400000523], [1201042800000528], [1201129200000483], [1201215600000452], [1201302000000270], [1201388400000222], [1201474800000439], [1201561200000559], [1201647600000521], [1201734000000477], [1201820400000442], [1201906800000252], [1201993200000236], [1202079600000525], [1202166000000477], [1202252400000386], [1202338800000409], [1202425200000408], [1202511600000237], [1202598000000193], [1202684400000357], [1202770800000414], [1202857200000393], [1202943600000353], [1203030000000364], [1203116400000215], [1203202800000214], [1203289200000356], [1203375600000399], [1203462000000334], [1203548400000348], [1203634800000243], [1203721200000126], [1203807600000157], [1203894000000288]];

    
// first correct the timestamps - they are recorded as the daily
    // midnights in UTC+0100, but Flot always displays dates in UTC
    // so we have to add one hour to hit the midnights in the plot
    
for (var 0d.length; ++i)
      
d[i][0] += 60 60 1000;

    
// helper for returning the weekends in a period
    
function weekendAreas(axes) {
        var 
markings = [];
        var 
= new Date(axes.xaxis.min);
        
// go to the first Saturday
        
d.setUTCDate(d.getUTCDate() - ((d.getUTCDay() + 1) % 7))
        
d.setUTCSeconds(0);
        
d.setUTCMinutes(0);
        
d.setUTCHours(0);
        var 
d.getTime();
        do {
            
// when we don't set yaxis, the rectangle automatically
            // extends to infinity upwards and downwards
            
markings.push({ xaxis: { fromito24 60 60 1000 } });
            
+= 24 60 60 1000;
        } while (
axes.xaxis.max);

        return 
markings;
    }
    
    var 
options = {
        
xaxis: { mode"time"tickLength},
        
selection: { mode"x" },
        
grid: { markingsweekendAreas }
    };
    
    var 
plot = $.plot($("#placeholder"), [d], options);
    
    var 
overview = $.plot($("#overview"), [d], {
        
series: {
            
lines: { showtruelineWidth},
            
shadowSize0
        
},
        
xaxis: { ticks: [], mode"time" },
        
yaxis: { ticks: [], min0autoscaleMargin0.1 },
        
selection: { mode"x" }
    });

    
// now connect the two
    
    
$("#placeholder").bind("plotselected", function (eventranges) {
        
// do the zooming
        
plot = $.plot($("#placeholder"), [d],
                      $.
extend(true, {}, options, {
                          
xaxis: { minranges.xaxis.frommaxranges.xaxis.to }
                      }));

        
// don't fire event on the overview to prevent eternal loop
        
overview.setSelection(rangestrue);
    });
    
    $(
"#overview").bind("plotselected", function (eventranges) {
        
plot.setSelection(ranges);
    });
});
</
script>

 </
body>
</
html>
?>
Онлайн: 0
Реклама