From 6d4458db8b3af0636f9c4eb3eb4854cab77bb104 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Thu, 17 Feb 2022 18:30:52 +0900 Subject: [PATCH] Fix difficulty chart xaxis label --- .../difficulty-chart/difficulty-chart.component.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts b/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts index 0c06c22d6..350e3c4be 100644 --- a/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts +++ b/frontend/src/app/components/difficulty-chart/difficulty-chart.component.ts @@ -114,15 +114,13 @@ export class DifficultyChartComponent implements OnInit { axisPointer: { type: 'line', }, - xAxis: [ - { - type: 'time', - } - ], + xAxis: { + type: 'time', + splitNumber: this.isMobile() ? 5 : 10, + }, yAxis: { type: 'value', axisLabel: { - fontSize: 11, formatter: (val) => { const diff = val / Math.pow(10, 12); // terra return diff.toString() + 'T'; @@ -150,4 +148,7 @@ export class DifficultyChartComponent implements OnInit { }; } + isMobile() { + return (window.innerWidth <= 767.98); + } }