|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
var overlayControl = gantt.ext.overlay; |
|
|
|
|
var today = new Date(); |
|
|
|
|
var return_first; |
|
|
|
|
var parts = []; |
|
|
|
|
|
|
|
|
|
var sCurvePayload = { |
|
|
|
|
period: 'week', |
|
|
|
@ -26,7 +27,7 @@ function getSCurveData(){
|
|
|
|
|
const path = parentUrl.replace("https://adw.ospro.id/#/dashboard-project/", ""); |
|
|
|
|
|
|
|
|
|
// Split the remaining path by "/"
|
|
|
|
|
const parts = path.split("/"); |
|
|
|
|
parts = path.split("/"); |
|
|
|
|
if (parts[2] && parts[2] == "1") { |
|
|
|
|
$.ajax({ |
|
|
|
|
headers: { |
|
|
|
@ -92,7 +93,8 @@ function getProgressLine(){
|
|
|
|
|
getSCurveData(); |
|
|
|
|
var cumulativePlannedDurations = return_first.data[0].data.percentagePlan; |
|
|
|
|
var cumulativeRealDurations = return_first.data[0].data.percentageReal; |
|
|
|
|
return {planned: cumulativePlannedDurations, real: cumulativeRealDurations}; |
|
|
|
|
var dates = return_first.data[0].data.dates; |
|
|
|
|
return {planned: cumulativePlannedDurations, real: cumulativeRealDurations, dates: dates}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getScalePaddings(){ |
|
|
|
@ -119,16 +121,21 @@ function getScalePaddings(){
|
|
|
|
|
|
|
|
|
|
var myChart; |
|
|
|
|
var lineOverlay = overlayControl.addOverlay(function(container) { |
|
|
|
|
|
|
|
|
|
var values = getProgressLine(); |
|
|
|
|
var scaleLabels = []; |
|
|
|
|
|
|
|
|
|
if(parts[2] && parts[2] == '1'){ |
|
|
|
|
values.dates.forEach(function(date){ |
|
|
|
|
var dateScale = new Date(date); |
|
|
|
|
scaleLabels.push(dateToStr(dateScale)); |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
var chartScale = getChartScaleRange(); |
|
|
|
|
|
|
|
|
|
chartScale.forEach(function(date){ |
|
|
|
|
scaleLabels.push(dateToStr(date)); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var values = getProgressLine(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var canvas = document.createElement("canvas"); |
|
|
|
|
container.appendChild(canvas); |
|
|
|
@ -220,7 +227,7 @@ var lineOverlay = overlayControl.addOverlay(function(container) {
|
|
|
|
|
ticks: { |
|
|
|
|
display: true, |
|
|
|
|
min: 0, |
|
|
|
|
stepSize: 100, |
|
|
|
|
stepSize: 10, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|