From c26693f9335f06f946e9475c7f8abb41f764d3e3 Mon Sep 17 00:00:00 2001 From: chiayin Date: Mon, 25 Mar 2024 12:03:23 +0800 Subject: [PATCH] fix: Issues #262 done. --- src/views/Compare/Dashboard/index.vue | 14 ++++++++------ src/views/Discover/Performance/index.vue | 12 +++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/views/Compare/Dashboard/index.vue b/src/views/Compare/Dashboard/index.vue index b38864b..638f852 100644 --- a/src/views/Compare/Dashboard/index.vue +++ b/src/views/Compare/Dashboard/index.vue @@ -292,12 +292,12 @@ export default { }, time: { displayFormats: { - second: 'hh:mm:ss', // ex: 01:01:01 - minute: 'MM/dd hh:mm', // ex: 01/01 01:01 - hour: 'MM/dd hh:00', // ex: 01/01 01:00 - day: 'yyyy/MM/dd', // ex: 1911/01/01 - month: 'yyyy/MM', // ex: 1911/01 - } + 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 + }, }, ticks: { display: true, @@ -355,6 +355,7 @@ export default { } break; case 'count': + setOption.scales.y.ticks.precision = 0; // y 軸顯示小數點後 0 位 setOption.plugins.tooltip.callbacks.label = function(context) { let value = context.parsed.y; @@ -660,6 +661,7 @@ export default { }; break; case 'count': + setOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位 setOption.plugins.tooltip.callbacks.label = function(context) { let value = context.parsed.y; diff --git a/src/views/Discover/Performance/index.vue b/src/views/Discover/Performance/index.vue index df9198e..29ab0b0 100644 --- a/src/views/Discover/Performance/index.vue +++ b/src/views/Discover/Performance/index.vue @@ -287,11 +287,11 @@ export default { }, time: { displayFormats: { - second: 'hh:mm:ss', // ex: 01:01:01 - minute: 'MM/dd hh:mm', // ex: 01/01 01:01 - hour: 'MM/dd hh:00', // ex: 01/01 01:00 - day: 'MM/dd', // ex: 01/01 - month: 'yyyy/MM', // ex: 1911/01 + 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 }, @@ -341,6 +341,7 @@ export default { }; break; case 'count': + setOption.scales.y.ticks.precision = 0; // y 軸顯示小數點後 0 位 setOption.plugins.tooltip.callbacks.label = function(context) { return `${content.y}: ${context.parsed.y}`; }; @@ -573,6 +574,7 @@ export default { }; break; case 'count': + setOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位 setOption.plugins.tooltip.callbacks.label = function(context) { return `${content.x}: ${context.parsed.x}`; }