This commit is contained in:
Cindy Chang
2024-06-18 09:25:13 +08:00
parent 94dbe1dee6
commit 6c9322d1bc
3 changed files with 4 additions and 9 deletions

View File

@@ -44,7 +44,6 @@ const getTimeUnitAndValueToUse = (secondToDecide) => {
timeValue: secondToDecide / minutes,
};
} else {
console.log('less than one minutes final case timeValue:', secondToDecide, dd, hh, mm);
return {
unitToUse: "s",
timeValue: secondToDecide,
@@ -241,7 +240,7 @@ export function getDateLabelByMinMaxDate(date, maxDate, minDate) {
return moment(date).format('YYYY/MM/DD');
}
else if (diffDays > 1) {
return moment(date).format('MM/DD');
return moment(date).format('YYYY/MM/DD');
}
else if (diffHours > 1) {
return moment(date).format('MM/DD hh:00');

View File

@@ -731,7 +731,7 @@ export default {
ticks: {
...scaleObjectToAlter.x.ticks,
callback: function(value, index) {
// console.log('根據不同的級距客製化 x 軸的時間刻度');
// 根據不同的級距客製化 x 軸的時間刻度
return ticksOfXAxis[index];
},
},

View File

@@ -438,7 +438,6 @@ export default {
const maxX = chartData.x_axis.max;
const minX = chartData.x_axis.min;
const getMoment = (time)=> this.$moment(time).format('YYYY/M/D hh:mm:ss');
const getDateLabel = getDateLabelByMinMaxDate;
let datasets = chartData.data;
let xData;
let yData;
@@ -508,7 +507,7 @@ export default {
color: '#64748b',
callback: function(v, i, t) {
let label = xData[i]
return getDateLabel(label, maxX, minX)
return getDateLabelByMinMaxDate(label, maxX, minX)
},
},
border: {
@@ -756,10 +755,7 @@ export default {
},
},
};
},
getMoment(time){
return this.$moment(time).format('YYYY/M/D hh:mm:ss')
},
},
/**
* 建立Performance頁面的折線圖並且避免同一個畫面中的設定值彼此覆蓋
* @param { object } chartData chart data