Browse Source

Fix s curve

pull/1/head
Wahyu Ramadhan 1 year ago
parent
commit
9a25f8646b
  1. 23
      view-mode/function/overlaySCurve.js

23
view-mode/function/overlaySCurve.js

@ -34,13 +34,22 @@ function getSCurveData(){
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`
},
url: `${base_url}project/get-linear-s-curve`,
url: `${base_url}project/calculate-s-curve`,
type: "POST",
data:JSON.stringify(sCurvePayload),
success: function (data) {
callback(data)
}
});
$.ajax({
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`
},
url: `${base_url}project/s-curve-command`,
type: "POST",
data:JSON.stringify(sCurvePayload),
});
} else {
$.ajax({
headers: {
@ -93,7 +102,19 @@ function getProgressLine(){
getSCurveData();
var cumulativePlannedDurations = return_first.data[0].data.percentagePlan;
var cumulativeRealDurations = return_first.data[0].data.percentageReal;
var maxPlan = cumulativePlannedDurations[cumulativePlannedDurations.length - 1]
var maxReal = cumulativeRealDurations[cumulativeRealDurations.length - 1]
var dates = return_first.data[0].data.date;
if (maxReal > 100 || maxPlan > 100) {
var plannedDurations = cumulativePlannedDurations.map((item) => {
return item/maxPlan*100;
})
var realDurations = cumulativeRealDurations.map((item) => {
return item/maxPlan*100;
})
return {planned: plannedDurations, real: realDurations, dates: dates};
}
return {planned: cumulativePlannedDurations, real: cumulativeRealDurations, dates: dates};
}

Loading…
Cancel
Save