Вход Регистрация
Файл: module-assets/admin/js/dashboard.js
Строк: 164
<?php
$(function () {

    
/* required jquery.sparkline.min.js*/
    
if (jQuery().sparkline) {

        
/*  div#right sparkline*/
        /** This code runs when everything has been loaded on the page */
        /* Inline sparklines take their values from the contents of the tag */
        
$('.inlinesparkline').sparkline();

        
/* Sparklines can also take their values from the first argument
         passed to the sparkline() function */
        
var myvalues = [10857441];
        $(
'.dynamicsparkline').sparkline(myvalues);

        
/* The second argument gives options such as chart type */
        
$('.dynamicbar').sparkline(myvalues, {type:'bar'barColor:'green'});

        
/* Use 'html' instead of an array of values to pass options
         to a sparkline with data in the tag */
        
$('.inlinebar').sparkline('html', {type:'bar'barColor:'red'});


        $(
".sparkline.bar_week").sparkline([56720, -4, -24], {
            
type:'bar',
            
height:'40',
            
barWidth:5,
            
barColor:'#4d6189',
            
negBarColor:'#a20051'
        
});

        $(
".sparkline.line_day").sparkline([567995466467], {
            
type:'line',
            
height:'40',
            
drawNormalOnTop:false
        
});

        $(
".sparkline.pie_week").sparkline([112], {
            
type:'pie',
            
width:'40',
            
height:'40'
        
});

        $(
'.sparkline.stacked_month').sparkline(['0:2''2:4''4:2''4:1'], {
            
type:'bar',
            
height:'40',
            
barWidth:10,
            
barColor:'#4d6189',
            
negBarColor:'#a20051'
        
});

    } else {
        
console.log('could not load jquery.sparkline.min.js');
    }


    
/* required jquery.tablesorter.min.js*/
    
if (jQuery().tablesorter) {
        $(
".sortableTable").tablesorter();
    } else {
        
console.log('could not load jquery.tablesorter.min.js');
    }

    
//  Full Calendar

    
if (jQuery().fullCalendar) {
        var 
date = new Date();
        var 
date.getDate();
        var 
date.getMonth();
        var 
date.getFullYear();

        var 
calendar = $('#calendar').fullCalendar({
            
header:{
                
left:'prev,next today',
                
center:'title',
                
right:'month,agendaWeek,agendaDay'
            
},
            
selectable:true,
            
selectHelper:true,
            
select:function (startendallDay) {
                var 
title prompt('Event Title:');
                if (
title) {
                    
calendar.fullCalendar('renderEvent',
                        {
                            
title:title,
                            
start:start,
                            
end:end,
                            
allDay:allDay
                        
},
                        
true // make the event "stick"
                    
);
                }
                
calendar.fullCalendar('unselect');
            },
            
editable:true,
            
events:[
                {
                    
title:'All Day Event',
                    
start:new Date(ym1),
                    
className:'label label-success'
                
},
                {
                    
title:'Long Event',
                    
start:new Date(ym5),
                    
end:new Date(ym2),
                    
className:'label label-info'
                
},
                {
                    
id:999,
                    
title:'Repeating Event',
                    
start:new Date(ym3160),
                    
allDay:false,
                    
className:'label label-warning'
                
},
                {
                    
id:999,
                    
title:'Repeating Event',
                    
start:new Date(ym4160),
                    
allDay:false,
                    
className:'label label-inverse'
                
},
                {
                    
title:'Meeting',
                    
start:new Date(ymd1030),
                    
allDay:false,
                    
className:'label label-important'
                
},
                {
                    
title:'Lunch',
                    
start:new Date(ymd120),
                    
end:new Date(ymd140),
                    
allDay:false
                
},
                {
                    
title:'Birthday Party',
                    
start:new Date(ym1190),
                    
end:new Date(ym12230),
                    
allDay:false
                
},
                {
                    
title:'Click for Google',
                    
start:new Date(ym28),
                    
end:new Date(ym29),
                    
url:'http://google.com/'
                
}
            ]
        });
    } else {
        
console.log('could not load fullcalendar.min.js');
    }


//  Chart
    
var sin = [], cos = [];
    for (var 
014+= 0.5) {
        
sin.push([iMath.sin(i)]);
        
cos.push([iMath.cos(i)]);
    }

    var 
plot = $.plot($("#trigo"),
        [
            {
                
data:sin,
                
label:"sin(x)",
                
points:{
                    
fillColor:"#4572A7",
                    
size:5
                
},
                
color:'#4572A7'
            
},
            {
                
data:cos,
                
label:"cos(x)",
                
points:{
                    
fillColor:"#333",
                    
size:35
                
},
                
color:'#AA4643'
            
}
        ], {
            
series:{
                
lines:{
                    
show:true
                
},
                
points:{
                    
show:true
                
}
            },
            
grid:{
                
hoverable:true,
                
clickable:true
            
},
            
yaxis:{
                
min:-1.2,
                
max:1.2
            
}
        });

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

    var 
previousPoint null;
    $(
"#trigo").bind("plothover", function (eventpositem) {
        $(
"#x").text(pos.x.toFixed(2));
        $(
"#y").text(pos.y.toFixed(2));

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

                $(
"#tooltip").remove();
                var 
item.datapoint[0].toFixed(2),
                    
item.datapoint[1].toFixed(2);

                
showTooltip(item.pageXitem.pageY,
                    
item.series.label " of " " = " y);
            }
        }
        else {
            $(
"#tooltip").remove();
            
previousPoint null;
        }
    });
});
?>
Онлайн: 1
Реклама