Stats: hourly
This commit is contained in:
1 parent
3229d54365
commit
9854a17f4e
4 files changed
+87
-11
No files matched your search
+55
-1
@@ -1,7 +1,9 @@
|
||||
$(document).ready(function() {
|
||||
/* TODO select data element with index 0 of each pie-chart */
|
||||
var charts = [];
|
||||
var products_url = '/stats/products/';
|
||||
var order_url = '/stats/orders/';
|
||||
var order_hourly_url = '/stats/orders/hourly';
|
||||
|
||||
/* orders */
|
||||
$.getJSON(order_url, function(data) {
|
||||
@@ -35,7 +37,7 @@ $(document).ready(function() {
|
||||
color: '#000000',
|
||||
connectorColor: '#000000',
|
||||
formatter: function() {
|
||||
return '<b>'+ this.point.name +'</b>: '+ Highcharts.numberFormat(this.percentage, 1) +' %';
|
||||
return '<b>'+ this.point.name +'</b>: '+ this.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,4 +99,56 @@ $(document).ready(function() {
|
||||
charts.push(new Highcharts.Chart(options));
|
||||
}
|
||||
});
|
||||
/* orders hourly */
|
||||
$.getJSON(order_hourly_url, function(data) {
|
||||
var render_to = 'order_hourly_chart';
|
||||
|
||||
// define the options
|
||||
var options = {
|
||||
credits: {
|
||||
enabled: false
|
||||
},
|
||||
chart: {
|
||||
renderTo: render_to,
|
||||
type: 'column'
|
||||
},
|
||||
title: {
|
||||
text: 'Ordre - time for time'
|
||||
},
|
||||
tooltip: {
|
||||
formatter: function() {
|
||||
return this.y + " stk";
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
title: {
|
||||
text: 'Ordre'
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
title: {
|
||||
text: 'Tid (h)'
|
||||
},
|
||||
labels: {
|
||||
formatter: function() {
|
||||
return this.value + ":00";
|
||||
},
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
column: {
|
||||
minPointLength: 3,
|
||||
},
|
||||
series: {
|
||||
groupPadding: 0,
|
||||
pointPadding: 0.05,
|
||||
},
|
||||
},
|
||||
series: [{
|
||||
name: 'Ordre',
|
||||
data: data.hourly
|
||||
}]
|
||||
};
|
||||
charts.push(new Highcharts.Chart(options));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user