2016-03-06 20:53:42 +00:00
|
|
|
.xxs{ position: fixed; margin: 15px; right: 0; float: right; width: 400px; z-index: 4000; bottom: 0 } .dsp_none{ display: none; }
|
2015-05-19 06:25:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- flot -->
|
|
|
|
<script type="text/javascript">
|
2016-03-06 20:53:42 +00:00
|
|
|
//define chart clolors ( you maybe add more colors if you want or flot will add it automatic )
|
|
|
|
var chartColours = ['#96CA59', '#3F97EB', '#72c380', '#6f7a8a', '#f7cb38', '#5a8022', '#2c7282'];
|
2015-05-19 06:25:00 +00:00
|
|
|
|
2016-03-06 20:53:42 +00:00
|
|
|
//generate random number for charts
|
|
|
|
randNum = function() {
|
|
|
|
return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
|
|
|
|
}
|
2015-05-19 06:25:00 +00:00
|
|
|
|
2016-03-06 20:53:42 +00:00
|
|
|
$(function() {
|
|
|
|
var d1 = [];
|
|
|
|
//var d2 = [];
|
2015-05-19 06:25:00 +00:00
|
|
|
|
2016-03-06 20:53:42 +00:00
|
|
|
//here we generate data for chart
|
|
|
|
for (var i = 0; i < 30; i++) {
|
|
|
|
d1.push([new Date(Date.today().add(i).days()).getTime(), randNum() + i + i + 10]);
|
|
|
|
// d2.push([new Date(Date.today().add(i).days()).getTime(), randNum()]);
|
|
|
|
}
|
2015-05-19 06:25:00 +00:00
|
|
|
|
2016-03-06 20:53:42 +00:00
|
|
|
var chartMinDate = d1[0][0]; //first day
|
|
|
|
var chartMaxDate = d1[20][0]; //last day
|
2015-05-19 06:25:00 +00:00
|
|
|
|
2016-03-06 20:53:42 +00:00
|
|
|
var tickSize = [1, "day"];
|
|
|
|
var tformat = "%d/%m/%y";
|
2015-05-19 06:25:00 +00:00
|
|
|
|
2016-03-06 20:53:42 +00:00
|
|
|
//graph options
|
|
|
|
var options = {
|
|
|
|
grid: {
|
|
|
|
show: true,
|
|
|
|
aboveData: true,
|
|
|
|
color: "#3f3f3f",
|
|
|
|
labelMargin: 10,
|
|
|
|
axisMargin: 0,
|
|
|
|
borderWidth: 0,
|
|
|
|
borderColor: null,
|
|
|
|
minBorderMargin: 5,
|
|
|
|
clickable: true,
|
|
|
|
hoverable: true,
|
|
|
|
autoHighlight: true,
|
|
|
|
mouseActiveRadius: 100
|
|
|
|
},
|
|
|
|
series: {
|
|
|
|
lines: {
|
|
|
|
show: true,
|
|
|
|
fill: true,
|
|
|
|
lineWidth: 2,
|
|
|
|
steps: false
|
|
|
|
},
|
|
|
|
points: {
|
|
|
|
show: true,
|
|
|
|
radius: 4.5,
|
|
|
|
symbol: "circle",
|
|
|
|
lineWidth: 3.0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
legend: {
|
|
|
|
position: "ne",
|
|
|
|
margin: [0, -25],
|
|
|
|
noColumns: 0,
|
|
|
|
labelBoxBorderColor: null,
|
|
|
|
labelFormatter: function(label, series) {
|
|
|
|
// just add some space to labes
|
|
|
|
return label + ' ';
|
|
|
|
},
|
|
|
|
width: 40,
|
|
|
|
height: 1
|
|
|
|
},
|
|
|
|
colors: chartColours,
|
|
|
|
shadowSize: 0,
|
|
|
|
tooltip: true, //activate tooltip
|
|
|
|
tooltipOpts: {
|
|
|
|
content: "%s: %y.0",
|
|
|
|
xDateFormat: "%d/%m",
|
|
|
|
shifts: {
|
|
|
|
x: -30,
|
|
|
|
y: -50
|
|
|
|
},
|
|
|
|
defaultTheme: false
|
|
|
|
},
|
|
|
|
yaxis: {
|
|
|
|
min: 0
|
|
|
|
},
|
|
|
|
xaxis: {
|
|
|
|
mode: "time",
|
|
|
|
minTickSize: tickSize,
|
|
|
|
timeformat: tformat,
|
|
|
|
min: chartMinDate,
|
|
|
|
max: chartMaxDate
|
|
|
|
}
|
|
|
|
};
|
|
|
|
var plot = $.plot($("#placeholder33x"), [{
|
|
|
|
label: "Email Sent",
|
|
|
|
data: d1,
|
|
|
|
lines: {
|
|
|
|
fillColor: "rgba(150, 202, 89, 0.12)"
|
|
|
|
}, //#96CA59 rgba(150, 202, 89, 0.42)
|
|
|
|
points: {
|
|
|
|
fillColor: "#fff"
|
|
|
|
}
|
|
|
|
}], options);
|
|
|
|
});
|
2015-05-19 06:25:00 +00:00
|
|
|
</script>
|
2016-03-06 20:53:42 +00:00
|
|
|
<!-- /flot -->
|