Browse Source

Merge branch 'master' of https://git.oslog.id/ordo/adw-gantt

pull/1/head
farhantock 12 months ago
parent
commit
afc0793aec
  1. 1
      view-mode/function/function.js
  2. 2
      view-mode/function/ganttSettings.js
  3. 4
      view-mode/function/overlaySCurve.js

1
view-mode/function/function.js

@ -241,6 +241,7 @@ function initialProperty()
let data = result.data; let data = result.data;
if(data.status && data.status=="not have"){ if(data.status && data.status=="not have"){
toggleCollapseTasks(); toggleCollapseTasks();
gantt.ext.zoom.setLevel("month");
}else{ }else{
if(data.id){ if(data.id){
userToVersionGanttId = data.id userToVersionGanttId = data.id

2
view-mode/function/ganttSettings.js

@ -239,7 +239,7 @@ async function initHolidays(){
async function initGanttSettings() { async function initGanttSettings() {
console.log('initGanttSettings'); console.log('initGanttSettings');
// if zoom is day // if zoom is day
$("#scale1").attr('checked', true); $("#scale3").attr('checked', true);
// toggleCollapseTasks(); // toggleCollapseTasks();
// init to gantt chart view (holidays) // init to gantt chart view (holidays)

4
view-mode/function/overlaySCurve.js

@ -151,12 +151,12 @@ function adjustDataToZoom(dates, data, chartScaleRange, zoomLevel) {
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
aggregateValue = data[i]; aggregateValue = data[i];
if (zoomLevel === 2 && i % 30 === 29) { if (zoomLevel === 2 && i % 30 === 0) {
// Aggregate data for each month (assuming 30 days in a month) // Aggregate data for each month (assuming 30 days in a month)
newData.push(aggregateValue); newData.push(aggregateValue);
newDates.push(dates[i]); newDates.push(dates[i]);
aggregateValue = 0; aggregateValue = 0;
} else if (zoomLevel === 1 && (i + 1) % 7 === 0) { } else if (zoomLevel === 1 && (i + 1) % 7 === 1) {
// Aggregate data for each week // Aggregate data for each week
newData.push(aggregateValue); newData.push(aggregateValue);
newDates.push(dates[i]); newDates.push(dates[i]);

Loading…
Cancel
Save