Skip to content

Commit 75e50e8

Browse files
authored
fix: improve large chart readability on mobile (#447)
1 parent 7ae58e6 commit 75e50e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/components/PackageDownloadAnalytics.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ const config = computed(() => {
463463
return {
464464
theme: isDarkMode.value ? 'dark' : 'default',
465465
chart: {
466-
height: isMobile.value ? 850 : 600,
466+
height: isMobile.value ? 950 : 600,
467467
userOptions: {
468468
buttons: {
469469
pdf: false,
@@ -508,15 +508,17 @@ const config = computed(() => {
508508
grid: {
509509
stroke: colors.value.border,
510510
labels: {
511+
fontSize: isMobile.value ? 24 : 16,
511512
axis: {
512513
yLabel: $t('package.downloads.y_axis_label', {
513514
granularity: $t(`package.downloads.granularity_${selectedGranularity.value}`),
514515
}),
515516
xLabel: packageName,
516517
yLabelOffsetX: 12,
517-
fontSize: 24,
518+
fontSize: isMobile.value ? 32 : 24,
518519
},
519520
xAxisLabels: {
521+
show: !isMobile.value,
520522
values: chartData.value?.dates,
521523
showOnlyAtModulo: true,
522524
modulo: 12,
@@ -554,7 +556,7 @@ const config = computed(() => {
554556
},
555557
},
556558
zoom: {
557-
maxWidth: 500,
559+
maxWidth: isMobile.value ? 350 : 500,
558560
customFormat:
559561
displayedGranularity.value !== 'weekly'
560562
? undefined

0 commit comments

Comments
 (0)