|
|
@@ -71,7 +71,8 @@ export default {
|
|
|
currentTime: { type: Number, default: 0 },
|
|
|
phaseData: { type: Array, default: () => [] },
|
|
|
showAxis: { type: Boolean, default: true },
|
|
|
- showScanLine: { type: Boolean, default: true }
|
|
|
+ showScanLine: { type: Boolean, default: true },
|
|
|
+ showScanLineLabel: { type: Boolean, default: true }
|
|
|
},
|
|
|
data() {
|
|
|
return { scaleFactor: 1 };
|
|
|
@@ -83,7 +84,8 @@ export default {
|
|
|
currentTime() { if (this.$_chart) this.updateChart(); },
|
|
|
phaseData: { deep: true, handler(newVal) { if (this.$_chart && newVal.length > 0) this.updateChart(); } },
|
|
|
showAxis() { this.updateChart(); },
|
|
|
- showScanLine() { this.updateChart(); }
|
|
|
+ showScanLine() { this.updateChart(); },
|
|
|
+ showScanLineLabel() { this.updateChart(); }
|
|
|
},
|
|
|
methods: {
|
|
|
updateScale() {
|
|
|
@@ -119,8 +121,8 @@ export default {
|
|
|
grid: {
|
|
|
left: 0, right: 0,
|
|
|
// 当隐藏坐标轴/扫描线时(即在表格中显示时),将上下边距设为 0,让色块铺满高度
|
|
|
- top: (this.showAxis || this.showScanLine) ? Math.round(35 * s) : 0,
|
|
|
- bottom: (this.showAxis || this.showScanLine) ? Math.round(10 * s) : 0,
|
|
|
+ top: (this.showAxis || this.showScanLineLabel) ? Math.round(35 * s) : 0,
|
|
|
+ bottom: (this.showAxis || this.showScanLineLabel) ? Math.round(10 * s) : 0,
|
|
|
containLabel: false
|
|
|
},
|
|
|
xAxis: { type: 'value', min: 0, max: realMaxTime, show: false },
|
|
|
@@ -134,9 +136,11 @@ export default {
|
|
|
symbol: ['none', 'none'],
|
|
|
silent: true,
|
|
|
label: {
|
|
|
- show: true, position: 'start', formatter: `${this.currentTime}/${realMaxTime}`,
|
|
|
+ show: this.showScanLineLabel,
|
|
|
+ position: 'start', formatter: `${this.currentTime}/${realMaxTime}`,
|
|
|
color: '#fff', backgroundColor: COLORS.MARK_BLUE, padding: [Math.round(4 * s), Math.round(8 * s)],
|
|
|
- borderRadius: 2, fontSize: Math.max(10, Math.round(10 * s)), fontWeight: 'bold', offset: [0, Math.round(-15 * s)]
|
|
|
+ borderRadius: 2, fontSize: Math.max(10, Math.round(10 * s)),
|
|
|
+ offset: [0, Math.round(1 * s)]
|
|
|
},
|
|
|
lineStyle: { color: COLORS.MARK_BLUE, type: 'solid', width: Math.max(1, Math.round(2 * s)), z: 100 },
|
|
|
data: [ { xAxis: this.currentTime } ]
|