Fix difficulty chart xaxis label

This commit is contained in:
nymkappa 2022-02-17 18:30:52 +09:00
parent 9b4e7a5fe1
commit 6d4458db8b
No known key found for this signature in database
GPG key ID: E155910B16E8BD04

View file

@ -114,15 +114,13 @@ export class DifficultyChartComponent implements OnInit {
axisPointer: { axisPointer: {
type: 'line', type: 'line',
}, },
xAxis: [ xAxis: {
{ type: 'time',
type: 'time', splitNumber: this.isMobile() ? 5 : 10,
} },
],
yAxis: { yAxis: {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
fontSize: 11,
formatter: (val) => { formatter: (val) => {
const diff = val / Math.pow(10, 12); // terra const diff = val / Math.pow(10, 12); // terra
return diff.toString() + 'T'; return diff.toString() + 'T';
@ -150,4 +148,7 @@ export class DifficultyChartComponent implements OnInit {
}; };
} }
isMobile() {
return (window.innerWidth <= 767.98);
}
} }