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