rapportrage dbois
This commit is contained in:
@@ -21,13 +21,17 @@ class EmployeeHoursController extends MY_Controller {
|
||||
$this->load->model( $models );
|
||||
$this->load->library( $libraries );
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getMonthlyEmployeeHoursPerProject()
|
||||
public function getMonthlyEmployeeHoursPerProject( $employeeID, $year )
|
||||
{
|
||||
$monthlyhours = Projecthour::getMonthlyEmployeeHoursPerProject( $employeeID, $year );
|
||||
|
||||
$this->json( $monthlyhours );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
||||
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 14/02/2018
|
||||
* Time: 11:18
|
||||
*/
|
||||
class ReportsdefaultController extends MY_Controller {
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if ( AUTHENTICATED == FALSE ) die( 'NO ACCES' );
|
||||
|
||||
$models = [];
|
||||
$libraries = [];
|
||||
|
||||
$this->load->model( $models );
|
||||
$this->load->library( $libraries );
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function getUsedYears()
|
||||
{
|
||||
$years = Projecthour::getUsedYears();
|
||||
|
||||
$this->json( $years );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,6 +15,47 @@ class Projecthour extends BaseModel {
|
||||
$this->belongsTo( 'Projectemployee' );
|
||||
}
|
||||
|
||||
public static function getUsedYears()
|
||||
{
|
||||
$years = Projecthour::selectRaw( "YEAR(hourdate) AS year" )
|
||||
->distinct()
|
||||
->orderByRaw( 'YEAR( hourdate )' )
|
||||
->get();
|
||||
|
||||
return $years;
|
||||
}
|
||||
|
||||
public static function getMonthlyEmployeeHoursPerProject( $employeeID, $year )
|
||||
{
|
||||
$projectHours = Projecthour::selectRaw( "
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-1', projecthours.hours, 0)) AS januari,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-2', projecthours.hours, 0)) AS februari,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-3', projecthours.hours, 0)) AS maart,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-4', projecthours.hours, 0)) AS april,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-5', projecthours.hours, 0)) AS mei,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-6', projecthours.hours, 0)) AS juni,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-7', projecthours.hours, 0)) AS juli,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-8', projecthours.hours, 0)) AS augustus,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-9', projecthours.hours, 0)) AS september,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-10', projecthours.hours, 0)) AS oktober,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-11', projecthours.hours, 0)) AS november,
|
||||
SUM(IF(CONCAT(YEAR(hourdate), '-', MONTH(hourdate)) = '{$year}-12', projecthours.hours, 0)) AS december,
|
||||
SUM(IF(YEAR(hourdate) = {$year},projecthours.hours, 0)) AS totalyear,
|
||||
SUM(IF(YEAR(hourdate) != {$year},projecthours.hours, 0)) AS totalotheryears,
|
||||
SUM(projecthours.hours) AS totalhours,
|
||||
PEM.tarif,
|
||||
PRJ.projectname" )
|
||||
->join( 'projectemployees AS PEM', 'PEM.id', '=', 'projecthours.projectemployee_id' )
|
||||
->join( 'projects AS PRJ', 'PRJ.id', '=', 'PEM.project_id' )
|
||||
->where( 'PEM.user_id', '=', $employeeID )
|
||||
->groupBy('PRJ.id')
|
||||
->groupBy('PEM.tarif')
|
||||
->groupBy('PRJ.projectname')
|
||||
->get();
|
||||
|
||||
return $projectHours;
|
||||
}
|
||||
|
||||
public static function saveProjecthour( $projecthourID, $projecthour )
|
||||
{
|
||||
$projecthour = (array) $projecthour;
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
<div class="MONTHLYEMPLOYEEHOURS">
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
<label>jaar</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select class="form-control form-control-sm"
|
||||
data-bind="options:years,
|
||||
optionsText:'year',
|
||||
optionsValue: 'id',
|
||||
value:selectedYear,
|
||||
event:{change:refreshTab}"></select>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="nav-tabs-horizontal">
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
<script src="js/lib/dataservices/projectsDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/vatDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/employeehoursDataservice.js"></script>
|
||||
<script src="js/lib/dataservices/reportsDataService.js"></script>
|
||||
|
||||
<script src="js/lib/services/chartService.js"></script>
|
||||
|
||||
|
||||
@@ -1,3 +1,146 @@
|
||||
<ul data-bind="foreach: myData">
|
||||
<li data-bind="text:test">text</li>
|
||||
</ul>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>uren per project</h2>
|
||||
<table class="table table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr class="table-info">
|
||||
<th>project</th>
|
||||
<th class="align-right">tarief</th>
|
||||
<th class="align-right">jan</th>
|
||||
<th class="align-right">feb</th>
|
||||
<th class="align-right">mrt</th>
|
||||
<th class="align-right">apr</th>
|
||||
<th class="align-right">mei</th>
|
||||
<th class="align-right">juni</th>
|
||||
<th class="align-right">juli</th>
|
||||
<th class="align-right">aug</th>
|
||||
<th class="align-right">sep</th>
|
||||
<th class="align-right">okt</th>
|
||||
<th class="align-right">nov</th>
|
||||
<th class="align-right">dec</th>
|
||||
<th class="align-right">tot jaar</th>
|
||||
<th class="align-right">tot overig</th>
|
||||
<th class="align-right">grand total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody data-bind="foreach:myData">
|
||||
<tr>
|
||||
<td>
|
||||
<span data-bind="text:projectname"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:tarif"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:januari"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:februari"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:maart"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:april"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:mei"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:juni"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:juli"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:augustus"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:september"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:oktober"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:november"></span>
|
||||
</td>
|
||||
<td class="align-right">
|
||||
<span data-bind="text:december"></span>
|
||||
</td>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalyear"></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalotheryears"></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalhours"></span>
|
||||
</th>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="table-info">
|
||||
<th>totaal</th>
|
||||
<th> </th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalJanuari "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalFebruari "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalMaart "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalApril "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalMei "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalJuni "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalJuli "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalAugustus"></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalSeptember "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalOktober "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalNovember "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalDecember "></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalTotal"></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalTotalOtheryears"></span>
|
||||
</th>
|
||||
<th class="align-right">
|
||||
<span data-bind="text:totalTotalOtheryears() + totalTotal()"></span>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="graph-holder">
|
||||
<canvas data-bind="attr:{id: 'hours-per-month-' + slug}" id="" height="300"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="graph-holder">
|
||||
<canvas data-bind="attr:{id: 'hours-per-project-' + slug}" id="" height="300"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,4 +29,11 @@ body{
|
||||
padding-left:10px !important;
|
||||
padding-right:10px !important;
|
||||
}
|
||||
.table-info > th{
|
||||
color:#fff !important;
|
||||
}
|
||||
.table-info > td{
|
||||
background-color: #c2f5ff;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 14/02/2018
|
||||
* Time: 11:14
|
||||
*/
|
||||
|
||||
|
||||
dbo.reportsDataService = {
|
||||
|
||||
getUsedYears: function ( callback ) {
|
||||
$.getJSON( 'index.php/reports/reportsdefaultcontroller/getUsedYears' )
|
||||
.done( function ( data ) {
|
||||
callback( data );
|
||||
} );
|
||||
},
|
||||
|
||||
getEmployeeHours: function ( employeeID, year, callback ) {
|
||||
$.getJSON( 'index.php/reports/EmployeeHoursController/getMonthlyEmployeeHoursPerProject/' + employeeID + '/' + year )
|
||||
.done( function ( data ) {
|
||||
callback( data );
|
||||
} )
|
||||
}
|
||||
|
||||
|
||||
|
||||
// getHoursPerEmployee
|
||||
|
||||
}
|
||||
@@ -704,7 +704,7 @@ $( function () {
|
||||
totalHours += Number( p.hours() );
|
||||
}
|
||||
} );
|
||||
return totalHours;
|
||||
return totalHours.toFixed(2);
|
||||
} );
|
||||
|
||||
dbo.editProjectModal.totalRevenue = ko.pureComputed( function () {
|
||||
|
||||
@@ -17,10 +17,22 @@ dbo.monthlyemployeehoursInit = function () {
|
||||
|
||||
uniqueEmployees: ko.observableArray( [] ),
|
||||
sluggy : ko.observable( 'euro' ),
|
||||
years : ko.observableArray( [] ),
|
||||
selectedYear : ko.observable(),
|
||||
currentTab : false,
|
||||
|
||||
init: function () {
|
||||
var vm = dbo.monthlyEmployeeHoursModel;
|
||||
|
||||
dbo.reportsDataService.getUsedYears( function ( data ) {
|
||||
vm.years.removeAll();
|
||||
$.each( data, function ( i, p ) {
|
||||
vm.years.push( {id: p.year, year: p.year} );
|
||||
} );
|
||||
|
||||
vm.selectedYear( (new Date()).getFullYear() );
|
||||
} );
|
||||
|
||||
vm.initModule();
|
||||
},
|
||||
|
||||
@@ -29,18 +41,76 @@ dbo.monthlyemployeehoursInit = function () {
|
||||
dbo.userDataService.getUniqueProjectEmployees( function ( data ) {
|
||||
vm.uniqueEmployees.removeAll();
|
||||
$.each( data, function ( i, p ) {
|
||||
vm.uniqueEmployees.push(new vm.UniqueEmployee(p) )
|
||||
vm.uniqueEmployees.push( new vm.UniqueEmployee( p ) )
|
||||
} );
|
||||
} );
|
||||
},
|
||||
|
||||
refreshTab: function () {
|
||||
var vm = dbo.monthlyEmployeeHoursModel;
|
||||
|
||||
if ( vm.currentTab == false ) return;
|
||||
|
||||
console.log( vm.currentTab );
|
||||
|
||||
dbo.reportsDataService.getEmployeeHours( vm.currentTab.id, vm.selectedYear(), function ( data ) {
|
||||
vm.currentTab.myData( data );
|
||||
vm.currentTab.totalJanuari( 0 );
|
||||
vm.currentTab.totalFebruari( 0 );
|
||||
vm.currentTab.totalMaart( 0 );
|
||||
vm.currentTab.totalApril( 0 );
|
||||
vm.currentTab.totalMei( 0 );
|
||||
vm.currentTab.totalJuni( 0 );
|
||||
vm.currentTab.totalJuli( 0 );
|
||||
vm.currentTab.totalAugustus( 0 );
|
||||
vm.currentTab.totalSeptember( 0 );
|
||||
vm.currentTab.totalOktober( 0 );
|
||||
vm.currentTab.totalNovember( 0 );
|
||||
vm.currentTab.totalDecember( 0 );
|
||||
vm.currentTab.totalTotal( 0 );
|
||||
vm.currentTab.totalTotalOtheryears( 0 );
|
||||
var totalHoursChart = [];
|
||||
var projectChart = [];
|
||||
$.each( vm.currentTab.myData(), function ( i, q ) {
|
||||
vm.currentTab.tarif( q.tarif );
|
||||
vm.currentTab.totalJanuari( vm.currentTab.totalJanuari() + q.januari );
|
||||
vm.currentTab.totalFebruari( vm.currentTab.totalFebruari() + q.februari );
|
||||
vm.currentTab.totalMaart( vm.currentTab.totalMaart() + q.maart );
|
||||
vm.currentTab.totalApril( vm.currentTab.totalApril() + q.april );
|
||||
vm.currentTab.totalMei( vm.currentTab.totalMei() + q.mei );
|
||||
vm.currentTab.totalJuni( vm.currentTab.totalJuni() + q.juni );
|
||||
vm.currentTab.totalJuli( vm.currentTab.totalJuli() + q.juli );
|
||||
vm.currentTab.totalAugustus( vm.currentTab.totalAugustus() + q.augustus );
|
||||
vm.currentTab.totalSeptember( vm.currentTab.totalSeptember() + q.september );
|
||||
vm.currentTab.totalOktober( vm.currentTab.totalOktober() + q.oktober );
|
||||
vm.currentTab.totalNovember( vm.currentTab.totalNovember() + q.november );
|
||||
vm.currentTab.totalDecember( vm.currentTab.totalDecember() + q.december );
|
||||
vm.currentTab.totalTotal( vm.currentTab.totalTotal() + q.totalyear );
|
||||
vm.currentTab.totalTotalOtheryears( vm.currentTab.totalTotalOtheryears() + q.totalotheryears );
|
||||
totalHoursChart.push(q.totalhours);
|
||||
projectChart.push(q.projectname)
|
||||
} );
|
||||
var chartData = [vm.currentTab.totalJanuari(), vm.currentTab.totalFebruari(), vm.currentTab.totalMaart(), vm.currentTab.totalApril(), vm.currentTab.totalMei(), vm.currentTab.totalJuni(), vm.currentTab.totalJuli(), vm.currentTab.totalAugustus(), vm.currentTab.totalSeptember(), vm.currentTab.totalOktober(), vm.currentTab.totalNovember(), vm.currentTab.totalDecember()]
|
||||
dbo.charts.drawHoursChart( 'hours-per-month-' + vm.currentTab.slug, chartData, dbo.charts.monthLabels, 'uren per maand', '#f28f25' );
|
||||
dbo.charts.drawHoursChart( 'hours-per-project-' + vm.currentTab.slug, totalHoursChart, projectChart, 'uren per project', '#0daef0' );
|
||||
} );
|
||||
},
|
||||
|
||||
setActivetab: function ( tab ) {
|
||||
var vm = dbo.monthlyEmployeeHoursModel;
|
||||
|
||||
$.each( vm.uniqueEmployees(), function ( i, p ) {
|
||||
if ( tab == p.slug ) {
|
||||
vm.currentTab = p;
|
||||
|
||||
vm.refreshTab();
|
||||
}
|
||||
} )
|
||||
|
||||
vm.sluggy( tab );
|
||||
},
|
||||
|
||||
UniqueEmployee : function(data){
|
||||
UniqueEmployee: function ( data ) {
|
||||
var vm = dbo.monthlyEmployeeHoursModel;
|
||||
var self = this;
|
||||
|
||||
@@ -48,15 +118,28 @@ dbo.monthlyemployeehoursInit = function () {
|
||||
self.fullname = data.fullname;
|
||||
self.slug = data.slug;
|
||||
|
||||
self.myData = ko.observableArray([]);
|
||||
self.tarif = ko.observable( 0 );
|
||||
|
||||
for(var i=1; i<5; i++){
|
||||
self.myData.push( new vm.Detail(data.fullname));
|
||||
}
|
||||
self.totalJanuari = ko.observable( 0 );
|
||||
self.totalFebruari = ko.observable( 0 );
|
||||
self.totalMaart = ko.observable( 0 );
|
||||
self.totalApril = ko.observable( 0 );
|
||||
self.totalMei = ko.observable( 0 );
|
||||
self.totalJuni = ko.observable( 0 );
|
||||
self.totalJuli = ko.observable( 0 );
|
||||
self.totalAugustus = ko.observable( 0 );
|
||||
self.totalSeptember = ko.observable( 0 );
|
||||
self.totalOktober = ko.observable( 0 );
|
||||
self.totalNovember = ko.observable( 0 );
|
||||
self.totalDecember = ko.observable( 0 );
|
||||
self.totalTotal = ko.observable( 0 );
|
||||
self.totalOtheryears = ko.observable( 0 );
|
||||
self.totalTotalOtheryears = ko.observable( 0 );
|
||||
|
||||
self.myData = ko.observableArray( [] );
|
||||
},
|
||||
|
||||
Detail : function(data){
|
||||
console.log( data );
|
||||
Detail: function ( data ) {
|
||||
this.test = data;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user