From fb5094758e65e2e0585c94d5389422ae5087b1cc Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Fri, 14 Oct 2022 14:40:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4echart=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E6=A8=AA=E8=BD=B4=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=8C=E4=BD=BF=E7=94=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../charts2/charts/options/echartOption.js | 91 ++++++++++--------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/src/views/charts2/charts/options/echartOption.js b/src/views/charts2/charts/options/echartOption.js index 7ec57acf..91bb2bd7 100644 --- a/src/views/charts2/charts/options/echartOption.js +++ b/src/views/charts2/charts/options/echartOption.js @@ -177,15 +177,15 @@ export const stackedLineChartOption = { xAxis: [ { type: 'time', - splitNumber: 12, - axisLabel: { - formatter: function (value) { - const data = new Date(value) - const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() - const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() - return h + ':' + m - } - } + splitNumber: 12 + // axisLabel: { + // formatter: function (value) { + // const data = new Date(value) + // const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() + // const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() + // return h + ':' + m + // } + // } } ], yAxis: [ @@ -234,15 +234,15 @@ export const linkTrafficLineChartOption = { xAxis: [ { type: 'time', - splitNumber: 12, - axisLabel: { - formatter: function (value) { - const data = new Date(value) - const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() - const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() - return h + ':' + m - } - } + splitNumber: 12 + // axisLabel: { + // formatter: function (value) { + // const data = new Date(value) + // const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() + // const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() + // return h + ':' + m + // } + // } } ], yAxis: [ @@ -326,15 +326,16 @@ export const npmLineChartOption = { xAxis: [ { type: 'time', - splitNumber: 8, - axisLabel: { - formatter: function (value) { - const data = new Date(value) - const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() - const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() - return h + ':' + m - } - } + splitNumber: 8 + // axisLabel: { + // formatter: function (value) { + // const data = new Date(value) + // const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() + // const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() + // console.log(h + ':' + m) + // return h + ':' + m + // } + // } } ], yAxis: [ @@ -397,15 +398,15 @@ export const trafficLineChartOption = { xAxis: [ { type: 'time', - splitNumber: 12, - axisLabel: { - formatter: function (value) { - const data = new Date(value) - const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() - const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() - return h + ':' + m - } - } + splitNumber: 12 + // axisLabel: { + // formatter: function (value) { + // const data = new Date(value) + // const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() + // const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() + // return h + ':' + m + // } + // } } ], yAxis: [ @@ -493,16 +494,16 @@ export const stackedBarChartOption = { }, axisTick: { show: false - }, - axisLabel: { - margin: 12, - formatter: function (value) { - const data = new Date(value) - const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() - const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() - return h + ':' + m - } } + // axisLabel: { + // margin: 12, + // formatter: function (value) { + // const data = new Date(value) + // const h = data.getHours() > 9 ? data.getHours() : '0' + data.getHours() + // const m = data.getMinutes() > 9 ? data.getMinutes() : '0' + data.getMinutes() + // return h + ':' + m + // } + // } }, yAxis: { type: 'value',