rapportrage dbois

This commit is contained in:
2018-02-15 21:30:56 +01:00
parent 957bca2e9d
commit f3b40c5bce
11 changed files with 444 additions and 43 deletions
+70 -30
View File
@@ -7,15 +7,17 @@
dbo.charts = {
drawHoursVsBudget : function(hours, budget, element){
monthLabels : ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
drawHoursVsBudget: function ( hours, budget, element ) {
var ctx = document.getElementById( element ).getContext( '2d' );
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["uren", "budget"],
var myChart = new Chart( ctx, {
type : 'bar',
data : {
labels : ["uren", "budget"],
datasets: [{
data: [hours, budget],
data : [hours, budget],
backgroundColor: [
'#f3a921', '#f2770c'
]
@@ -23,35 +25,35 @@ dbo.charts = {
},
options: {
maintainAspectRatio: false,
scales: {
scales : {
yAxes: [{
ticks: {
beginAtZero:true
beginAtZero: true
}
}]
},
legend:{
display : false,
legend : {
display: false,
},
title: {
display: true,
text: 'Uren vs budget',
fontSize:16,
title : {
display : true,
text : 'Uren vs budget',
fontSize : 16,
fontColor: '#b2b2b2'
}
}
});
} );
},
drawInvoicesVsPayed : function(offer, invoice, payed, element){
drawInvoicesVsPayed: function ( offer, invoice, payed, element ) {
var ctx = document.getElementById( element ).getContext( '2d' );
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["offerte", "facturen", "betaald"],
var myChart = new Chart( ctx, {
type : 'bar',
data : {
labels : ["offerte", "facturen", "betaald"],
datasets: [{
data: [offer, invoice, payed],
data : [offer, invoice, payed],
backgroundColor: [
'#f3a921', '#f2770c', '#72221a'
]
@@ -59,23 +61,61 @@ dbo.charts = {
},
options: {
maintainAspectRatio: false,
scales: {
scales : {
yAxes: [{
ticks: {
beginAtZero:true
beginAtZero: true
}
}]
},
legend:{
display : false,
legend : {
display: false,
},
title: {
display: true,
text: 'offerte vs facuren vs betalingen',
fontSize:16,
title : {
display : true,
text : 'offerte vs facuren vs betalingen',
fontSize : 16,
fontColor: '#b2b2b2'
}
}
});
} );
},
drawHoursChart: function (element, chartData, labels, title, colors) {
console.log( chartData );
var ctx = document.getElementById( element ).getContext( '2d' );
var myChart = new Chart( ctx, {
type : 'bar',
data : {
labels : labels,
datasets: [{
data : chartData,
backgroundColor: colors,
}]
},
options: {
maintainAspectRatio: false,
scales : {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
},
legend : {
display: false,
fontColor: '#ffffff',
},
title : {
display : true,
text : title,
fontSize : 16,
fontColor: '#ffffff'
}
}
} );
}
}