| Current Path : /var/www/html/dyna-project/views/tasks/ |
| Current File : /var/www/html/dyna-project/views/tasks/chart.php |
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use app\models\Projects;
use app\models\User;
use yii\helpers\Url;
use app\models\Tasks;
use app\assets\HighchartganttAssets;
HighchartganttAssets::register($this);
$this->title = 'Gantt Chart';
$this->registerJs("var dateFormat = Highcharts.dateFormat,
defined = Highcharts.defined,
isObject = Highcharts.isObject,
reduce = Highcharts.reduce;
Highcharts.ganttChart('containerchart', {
title: {text: '" . $projectName . "'},
credits: {enabled: false},
rangeSelector: {enabled: true,},
navigator: {
enabled: true,
series: {type: 'gantt',pointPlacement: 0.5,pointPadding: 0.25},
yAxis: {min: 0,max: 3,reversed: true,categories: []}
},
scrollbar: {enabled: true},
tooltip: {
pointFormatter: function () {
var point = this,
format = '%e %b %Y',
options = point.options,
lines;
lines = [{value: point.name,style: 'font-weight: bold;'},
{title: 'Start',value: dateFormat(format, point.start)},
{title: 'End',value: dateFormat(format, point.end)},
{title: 'Staff PIC',value: options.owner || ''}
];
return reduce(lines, function (str, line) {
var s = '',
style = (defined(line.style) ? line.style : 'font-size: 1em;');
if (line.visible !== false) {
s = (
'<span style=\"' + style + '\">' +
(defined(line.title) ? line.title + ': ' : '') +
(defined(line.value) ? line.value : '') +
'</span><br/>'
);
}
return str + s;
}, '');
}
},
series: [{
name: '" . $projectName . "',
data: [" . $chartSeries . "]
}]
});
");
?>
<div class="kt-subheader kt-grid__item" id="kt_subheader">
<div class="kt-container ">
<div class="kt-subheader__main">
<h3 class="kt-subheader__title"><?= $this->title ?></h3>
<div class="kt-subheader__breadcrumbs">
<span class="kt-subheader__breadcrumbs-separator"></span>
<span class="kt-subheader__breadcrumbs-link"> Project</span>
<span class="kt-subheader__breadcrumbs-separator"></span>
<span class="kt-subheader__breadcrumbs-link"> <?= $this->title ?> </span>
</div>
</div>
<div class="kt-subheader__toolbar">
<div class="kt-subheader__wrapper">
<a href="index.php?r=dashboard/index" class="btn btn-warning kt-subheader__btn-options">
<i class="fa fa-arrow-left"></i> Back to Dashboard
</a>
</div>
</div>
</div>
</div>
<div class="tasks-index">
<div class="kt-container kt-grid__item kt-grid__item--fluid">
<div class="kt-portlet kt-portlet--mobile">
<div class="kt-portlet__body">
<div id="containerchart"></div>
</div>
</div>
</div>
</div>