sonar qube; ternary if
This commit is contained in:
@@ -147,7 +147,7 @@ import PerformanceStore from '@/stores/performance.js';
|
||||
import ConformanceStore from '@/stores/conformance.js';
|
||||
import StatusBar from '@/components/Discover/StatusBar.vue';
|
||||
import { setLineChartData } from '@/module/setChartData.js';
|
||||
import { simpleTimeLabel, followTimeLabel, getDateLabelByMinMaxDate,
|
||||
import { simpleTimeLabel, followTimeLabel,
|
||||
setTimeStringFormatBaseOnTimeDifference,
|
||||
mapTimestampToAxisTicksByFormat,
|
||||
getStepSizeOfYTicks,
|
||||
@@ -157,58 +157,6 @@ import FreqChart from './FreqChart.vue';
|
||||
import { PRIME_VUE_TICKS_LIMIT } from '../../../constants/constants.js';
|
||||
|
||||
const primeVueTicksLimit = PRIME_VUE_TICKS_LIMIT;
|
||||
const knownScaleLineChartOptions = {
|
||||
x: {
|
||||
type: 'time',
|
||||
title: {
|
||||
display: true,
|
||||
color: '#334155',
|
||||
font: {
|
||||
size: 12,
|
||||
lineHeight: 2
|
||||
}
|
||||
},
|
||||
time: {
|
||||
displayFormats: {
|
||||
second: 'h:mm:ss', // ex: 1:11:11
|
||||
minute: 'M/d h:mm', // ex: 1/1 1:11
|
||||
hour: 'M/d h:mm', // ex: 1/1 1:11
|
||||
day: 'M/d h', // ex: 1/1 1
|
||||
month: 'y/M/d', // ex: 1911/1/1
|
||||
},
|
||||
round: true
|
||||
},
|
||||
ticks: {
|
||||
display: true,
|
||||
maxRotation: 0, // 不旋轉 lable 0~50
|
||||
color: '#64748b',
|
||||
source: 'labels', // 依比例彈性顯示 label 數量
|
||||
},
|
||||
border: {
|
||||
color: '#64748b',
|
||||
},
|
||||
},
|
||||
y: {
|
||||
beginAtZero: true, // scale 包含 0
|
||||
title: {
|
||||
display: true,
|
||||
color: '#334155',
|
||||
font: {
|
||||
size: 12,
|
||||
lineHeight: 2
|
||||
},
|
||||
},
|
||||
ticks:{
|
||||
|
||||
},
|
||||
grid: {
|
||||
color: '#64748b',
|
||||
},
|
||||
border: {
|
||||
display: false, // 隱藏左側多出來的線
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
@@ -830,7 +778,10 @@ export default {
|
||||
callbacks: {
|
||||
title: function(context) {
|
||||
return `${content.x}: ${getMoment(context[0].parsed.x)}`;
|
||||
}
|
||||
},
|
||||
label:function(context) {
|
||||
return `${content.y}: ${getSimpleTimeLabel(context.parsed.y, 2)}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
title: {
|
||||
@@ -903,15 +854,6 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
callbacks:{
|
||||
label:function(context) {
|
||||
return `${content.y}: ${getSimpleTimeLabel(context.parsed.y, 2)}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
return [primeVueSetData, primeVueSetOption]
|
||||
|
||||
Reference in New Issue
Block a user