Вход Регистрация
Файл: templates/backend/default/assets/js/charts.js
Строк: 183
<?php
/* Webarch Admin Dashboard 
/* This JS is Only DEMO Purposes 
-----------------------------------------------------------------*/    
$(document).ready(function() {        

    var 
d2 = [ [130],
            [
220],
            [
310],
            [
430],
            [
5,15],
            [
625],
            [
740]

];
    var 
d1 = [
            [
130],
            [
230],
            [
320],
            [
440],
            [
530],
            [
645],
            [
750],
];
    var 
plot = $.plotAnimator($("#placeholder"), [
            {      
label"Label 1",
                
datad2,     
                
lines: {                
                    
fill0.6,
                    
lineWidth0,                
                },
                
color:['#f89f9f']
            },{ 
                
datad1
                
animator: {steps60duration1000start:0},         
                
lines: {lineWidth:2},    
                
shadowSize:0,
                
color'#f35958'
            
},{
                
datad1
                
points: { showtruefilltrueradius:6,fillColor:"#f35958",lineWidth:},    
                
color'#fff',                
                
shadowSize:0
            
},
            {    
label"Label 2",
                
datad2
                
points: { showtruefilltrueradius:6,fillColor:"#f5a6a6",lineWidth:},    
                
color'#fff',                
                
shadowSize:0
            
}
        ],{    
xaxis: {
        
tickLength0,
        
tickDecimals0,
        
min:2,

                
font :{
                    
lineHeight13,
                    
style"normal",
                    
weight"bold",
                    
family"sans-serif",
                    
variant"small-caps",
                    
color"#6F7B8A"
                
}
            },
            
yaxis: {
                
ticks3,
                
tickDecimals0,
                
tickColor"#f0f0f0",
                
font :{
                    
lineHeight13,
                    
style"normal",
                    
weight"bold",
                    
family"sans-serif",
                    
variant"small-caps",
                    
color"#6F7B8A"
                
}
            },
            
grid: {
                
backgroundColor: { colors: [ "#fff""#fff" ] },
                
borderWidth:1,borderColor:"#f0f0f0",
                
margin:0,
                
minBorderMargin:0,                            
                
labelMargin:20,
                
hoverabletrue,
                
clickabletrue,
                
mouseActiveRadius:6
            
},
            
legend: { showfalse}
        });


    $(
"#placeholder").bind("plothover", function (eventpositem) {
                if (
item) {
                    var 
item.datapoint[0].toFixed(2),
                        
item.datapoint[1].toFixed(2);

                    $(
"#tooltip").html(item.series.label " of " " = " y)
                        .
css({topitem.pageY+5leftitem.pageX+5})
                        .
fadeIn(200);
                } else {
                    $(
"#tooltip").hide();
                }
    
        });
    
    $(
"<div id='tooltip'></div>").css({
            
position"absolute",
            
display"none",
            
border"1px solid #fdd",
            
padding"2px",
            
"background-color""#fee",
            
"z-index":"99999",
            
opacity0.80
    
}).appendTo("body");
    $(
"#mini-chart-orders").sparkline([1,4,6,2,0,5,6,4], {
        
type'bar',
        
height'30px',
        
barWidth6,
        
barSpacing2,
        
barColor'#f35958',
        
negBarColor'#f35958'});

    $(
"#mini-chart-other").sparkline([1,4,6,2,0,5,6,4], {
        
type'bar',
        
height'30px',
        
barWidth6,
        
barSpacing2,
        
barColor'#0aa699',
        
negBarColor'#0aa699'});    
    
    $(
'#ram-usage').easyPieChart({
        
lineWidth:9,
        
barColor:'#f35958',
        
trackColor:'#e5e9ec',
        
scaleColor:false
    
});
    $(
'#disk-usage').easyPieChart({
        
lineWidth:9,
        
barColor:'#7dc6ec',
        
trackColor:'#e5e9ec',
        
scaleColor:false
    
});
    
    
// Moris Charts - Line Charts
    
    
Morris.Line({
      
element'line-example',
      
data: [
        { 
y'2006'a50b40 },
        { 
y'2007'a65,  b55 },
        { 
y'2008'a50,  b40 },
        { 
y'2009'a75,  b65 },
        { 
y'2010'a50,  b40 },
        { 
y'2011'a75,  b65 },
        { 
y'2012'a100b90 }
      ],
      
xkey'y',
      
ykeys: ['a''b'],
      
labels: ['Series A''Series B'],
      
lineColors:['#0aa699','#d1dade'],
    });
    
    
Morris.Area({
      
element'area-example',
      
data: [
        { 
y'2006'a100b90 },
        { 
y'2007'a75,  b65 },
        { 
y'2008'a50,  b40 },
        { 
y'2009'a75,  b65 },
        { 
y'2010'a50,  b40 },
        { 
y'2011'a75,  b65 },
        { 
y'2012'a100b90 }
      ],
      
xkey'y',
      
ykeys: ['a''b'],
      
labels: ['Series A''Series B'],
      
lineColors:['#0090d9','#b7c1c5'],
      
lineWidth:'0',
       
grid:'false',
      
fillOpacity:'0.5'
    
});
    
    
Morris.Donut({
      
element'donut-example',
      
data: [
        {
label"Download Sales"value12},
        {
label"In-Store Sales"value30},
        {
label"Mail-Order Sales"value20}
      ],
      
colors:['#60bfb6','#91cdec','#eceff1']
    });

    $(
'#mysparkline').sparkline([4,3,3,1,4,3,2,2,3], {
            
type'line'
            
width'100%',
            
height:'250px',
            
fillColor'rgba(209, 218, 222, 0.30)',
            
lineColor'#fff',
            
spotRadius4,
            
valueSpots:[4,3,3,1,4,3,2,2,3],
            
minSpotColor'#d1dade',
            
maxSpotColor'#d1dade',
            
highlightSpotColor'#d1dade',
             
highlightLineColor'#bec6ca',
            
normalRangeMin0
    
});
    $(
'#mysparkline').sparkline([3,2,3,4,3,2,4,1,3], {
                    
type'line'
                    
compositetrue,
                    
width'100%',
                    
fillColor' rgba(0, 141, 214, 0.10)',
                    
lineColor'#fff',
                    
minSpotColor'#167db2',
                    
maxSpotColor'#167db2',
                    
highlightSpotColor'#8fcded',
                     
highlightLineColor'#bec6ca',
                    
spotRadius4,
                    
valueSpots:[3,2,3,4,3,2,4,1,3],
                    
normalRangeMin0
    
});    
    
    $(
"#spark-2").sparkline([4,3,3,4,5,4,3,2,4,5,6,4,3,5,2,4,6], {
        
type'line',
        
width'100%',
        
height'200',
        
lineColor'#0aa699',
        
fillColor'#e6f6f5',
        
minSpotColor'#0c948a',
        
maxSpotColor'#78cec7',
        
highlightSpotColor'#78cec7',
        
highlightLineColor'#78cec7',
        
spotRadius5
    
});
    
    $(
"#sparkline-pie").sparkline([8,2,3], {
        
type'pie',
        
width'100%',
        
height'100%',
        
sliceColors: ['#eceff1','#f35958','#dee1e3'],
        
offset10,
        
borderWidth0,
        
borderColor'#000000 '
    
});
    
    var 
seriesData = [ [], []];
    var 
random = new Rickshaw.Fixtures.RandomData(50);

    for (var 
050i++) {
        
random.addData(seriesData);
    }

    
graph = new Rickshaw.Graph( {
        
elementdocument.querySelector("#updatingChart"),
        
height200,
        
renderer'area',
        
series: [
            {
                
dataseriesData[0],
                
color'rgba(0,144,217,0.51)',
                
name:'DB Server'
            
},{
                
dataseriesData[1],
                
color'#eceff1',
                
name:'Web Server'
            
}
        ]
    } );
    var 
hoverDetail = new Rickshaw.Graph.HoverDetail( {
        
graphgraph
    
});

    
setInterval( function() {
        
random.removeData(seriesData);
        
random.addData(seriesData);
        
graph.update();

    },
1000);
    
    
//Bar Chart  - Jquert flot
    
    
var d1_1 = [
        [
1325376000000120],
        [
132805440000070],
        [
1330560000000100],
        [
133323840000060],
        [
133583040000035]
    ];
 
    var 
d1_2 = [
        [
132537600000080],
        [
132805440000060],
        [
133056000000030],
        [
133323840000035],
        [
133583040000030]
    ];
 
    var 
d1_3 = [
        [
132537600000080],
        [
132805440000040],
        [
133056000000030],
        [
133323840000020],
        [
133583040000010]
    ];
 
    var 
d1_4 = [
        [
132537600000015],
        [
132805440000010],
        [
133056000000015],
        [
133323840000020],
        [
133583040000015]
    ];
 
    var 
data1 = [
        {
            
label"Product 1",
            
datad1_1,
            
bars: {
                
showtrue,
                
barWidth12*24*60*60*300,
                
filltrue,
                
lineWidth:0,
                
order1,
                
fillColor:  "rgba(243, 89, 88, 0.7)"
            
},
            
color"rgba(243, 89, 88, 0.7)"
        
},
        {
            
label"Product 2",
            
datad1_2,
            
bars: {
                
showtrue,
                
barWidth12*24*60*60*300,
                
filltrue,
                
lineWidth0,
                
order2,
                
fillColor:  "rgba(251, 176, 94, 0.7)"
            
},
            
color"rgba(251, 176, 94, 0.7)"
        
},
        {
            
label"Product 3",
            
datad1_3,
            
bars: {
                
showtrue,
                
barWidth12*24*60*60*300,
                
filltrue,
                
lineWidth0,
                
order3,
                
fillColor:  "rgba(10, 166, 153, 0.7)"
            
},
            
color"rgba(10, 166, 153, 0.7)"
        
},
        {
            
label"Product 4",
            
datad1_4,
            
bars: {
                    
showtrue,
                
barWidth12*24*60*60*300,
                
filltrue,
                
lineWidth0,
                
order4,
                
fillColor:  "rgba(0, 144, 217, 0.7)"
            
},
            
color"rgba(0, 144, 217, 0.7)"
        
},

    ];
 
    $.
plot($("#placeholder-bar-chart"), data1, {
        
xaxis: {
            
min: (new Date(20111115)).getTime(),
            
max: (new Date(20120418)).getTime(),
            
mode"time",
            
timeformat"%b",
            
tickSize: [1"month"],
            
monthNames: ["Jan""Feb""Mar""Apr""May""Jun""Jul""Aug""Sep""Oct""Nov""Dec"],
            
tickLength0// hide gridlines
            
axisLabel'Month',
            
axisLabelUseCanvastrue,
            
axisLabelFontSizePixels12,
            
axisLabelFontFamily'Verdana, Arial, Helvetica, Tahoma, sans-serif',
            
axisLabelPadding5,
        },
        
yaxis: {
            
axisLabel'Value',
            
axisLabelUseCanvastrue,
            
axisLabelFontSizePixels12,
            
axisLabelFontFamily'Verdana, Arial, Helvetica, Tahoma, sans-serif',
            
axisLabelPadding5
        
},
        
grid: {
            
hoverabletrue,
            
clickablefalse,
            
borderWidth1,
            
borderColor:'#f0f0f0',
            
labelMargin:8,
        },
        
series: {
            
shadowSize1
        
}
    });
 
 
    function 
getMonthName(newTimestamp) {
        var 
= new Date(newTimestamp);
 
        var 
numericMonth d.getMonth();
        var 
monthArray = ["Jan""Feb""Mar""Apr""May""Jun""Jul""Aug""Sep""Oct""Nov""Dec"];
 
        var 
alphaMonth monthArray[numericMonth];
 
        return 
alphaMonth;
    }
 

     
// ORDERED & STACKED CHART
    
var data2 = [
        {
            
label"Product 1",
            
datad1_1,
            
bars: {
                
showtrue,
                
barWidth12*24*60*60*300*2,
                
filltrue,
                
lineWidth:0,
                
order0,
                
fillColor:  "rgba(243, 89, 88, 0.7)"
            
},
            
color"rgba(243, 89, 88, 0.7)"
        
},
        {
            
label"Product 2",
            
datad1_2,
            
bars: {
                
showtrue,
                
barWidth12*24*60*60*300*2,
                
filltrue,
                
lineWidth0,
                
order0,
                
fillColor:  "rgba(251, 176, 94, 0.7)"
            
},
            
color"rgba(251, 176, 94, 0.7)"
        
},
        {
            
label"Product 3",
            
datad1_3,
            
bars: {
                
showtrue,
                
barWidth12*24*60*60*300*2,
                
filltrue,
                
lineWidth0,
                
order0,
                
fillColor:  "rgba(10, 166, 153, 0.7)"
            
},
            
color"rgba(10, 166, 153, 0.7)"
        
},
        {
            
label"Product 4",
            
datad1_4,
            
bars: {
                    
showtrue,
                
barWidth12*24*60*60*300*2,
                
filltrue,
                
lineWidth0,
                
order0,
                
fillColor:  "rgba(0, 144, 217, 0.7)"
            
},
            
color"rgba(0, 144, 217, 0.7)"
        
},

    ];
    $.
plot($('#stacked-ordered-chart'), data2, {        
         
grid: {
            
hoverabletrue,
            
clickablefalse,
            
borderWidth1,
            
borderColor:'#f0f0f0',
            
labelMargin:8

        
},
                
xaxis: {
            
min: (new Date(20111115)).getTime(),
            
max: (new Date(20120418)).getTime(),
            
mode"time",
            
timeformat"%b",
            
tickSize: [1"month"],
            
monthNames: ["Jan""Feb""Mar""Apr""May""Jun""Jul""Aug""Sep""Oct""Nov""Dec"],
            
tickLength0// hide gridlines
            
axisLabel'Month',
            
axisLabelUseCanvastrue,
            
axisLabelFontSizePixels12,
            
axisLabelFontFamily'Verdana, Arial, Helvetica, Tahoma, sans-serif',
            
axisLabelPadding5
        
},
                
stacktrue
    
});
    
// DATA DEFINITION
    
function getData() {
        var 
data = [];

        
data.push({
            
data: [[01], [14], [22]]
        });

        
data.push({
            
data: [[05], [13], [21]]
        });

        return 
data;
    }
    
    
});
?>
Онлайн: 1
Реклама