Вход Регистрация
Файл: module-assets/admin/js/dash.js
Строк: 158
<?php
/*--------------------------------------------------------
BEGIN DASHBOARD SCRIPTS
---------------------------------------------------------*/
function dashboard () {
    
    
/*----------- BEGIN SPARKLINE CODE -------------------------*/
    /* required jquery.sparkline.min.js*/
    
if (jQuery().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',
            
barWidth5,
            
barColor'#4d6189',
            
negBarColor'#a20051'
        
});

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

        $(
".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',
            
barWidth10,
            
barColor'#4d6189',
            
negBarColor'#a20051'
        
});

    } else{
        
console.log('could not load jquery.sparkline.min.js');
    };
    
/*----------- END SPARKLINE CODE -------------------------*/


    /*----------- BEGIN FULLCALENDAR CODE -------------------------*/

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

        var 
calendar = $('#calendar').fullCalendar({
            
header: {
                
left'prev,today,next,',
                
center'title',
                
right'month,agendaWeek,agendaDay'
            
},
            
selectabletrue,
            
selectHelpertrue,
            
select: function(startendallDay) {
                var 
title prompt('Event Title:');
                if (
title) {
                    
calendar.fullCalendar('renderEvent',
                            {
                                
titletitle,
                                
startstart,
                                
endend,
                                
allDayallDay
                            
},
                    
true // make the event "stick"
                            
);
                }
                
calendar.fullCalendar('unselect');
            },
            
editabletrue,
            
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'
                
},
                {
                    
id999,
                    
title'Repeating Event',
                    
start: new Date(ym3160),
                    
allDayfalse,
                    
className'label label-warning'
                
},
                {
                    
id999,
                    
title'Repeating Event',
                    
start: new Date(ym4160),
                    
allDayfalse,
                    
className'label label-inverse'
                
},
                {
                    
title'Meeting',
                    
start: new Date(ymd1030),
                    
allDayfalse,
                    
className'label label-important'
                
},
                {
                    
title'Lunch',
                    
start: new Date(ymd120),
                    
end: new Date(ymd140),
                    
allDayfalse
                
},
                {
                    
title'Birthday Party',
                    
start: new Date(ym1190),
                    
end: new Date(ym12230),
                    
allDayfalse
                
},
                {
                    
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');
    }
    
/*----------- END FULLCALENDAR CODE -------------------------*/



    /*----------- BEGIN CHART CODE -------------------------*/
    
var sin = [], cos = [];
    for (var 
014+= 0.5) {
        
sin.push([iMath.sin(i)]);
        
cos.push([iMath.cos(i)]);
    }

    var 
plot = $.plot($("#trigo"),
            [
                {
                    
datasin,
                    
label"sin(x)",
                    
points: {
                        
fillColor"#4572A7",
                        
size5
                    
},
                    
color'#4572A7'
                
},
                {
                    
datacos,
                    
label"cos(x)",
                    
points: {
                        
fillColor"#333",
                        
size35
                    
},
                    
color'#AA4643'
                
}
            ], {
        
series: {
            
lines: {
                
showtrue
            
},
            
points: {
                
showtrue
            
}
        },
        
grid: {
            
hoverabletrue,
            
clickabletrue
        
},
        
yaxis: {
            
min: -1.2,
            
max1.2
        
}
    });

    function 
showTooltip(xycontents) {
        $(
'<div id="tooltip">' contents '</div>').css({
            
position'absolute',
            
display'none',
            
top5,
            
left5,
            
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;
        }
    });
    
/*----------- END CHART CODE -------------------------*/


}
/*--------------------------------------------------------
END DASHBOARD SCRIPTS
---------------------------------------------------------*/
?>
Онлайн: 1
Реклама