Skip to content

Commit 0ed9401

Browse files
committed
adjust chart and popup for mobile screens.
1 parent 7def25b commit 0ed9401

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

components/LineChart.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
×
99
</button>
1010

11-
<Line :data="data" :options="options" />
11+
<div class="w-full" style="height: 300px; max-height: 50vh;">
12+
<Line :data="data" :options="options" />
13+
</div>
1214
</div>
1315
</template>
1416

@@ -68,6 +70,7 @@ const data = computed(() => ({
6870
6971
const options = computed(() => ({
7072
responsive: true,
73+
maintainAspectRatio: false,
7174
plugins: {
7275
title: {
7376
display: true,

components/PopupInfo.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
class="absolute bottom-30 left-1/2 transform -translate-x-1/2 bg-white dark:bg-slate-900 text-black dark:text-white p-4 rounded-lg shadow-lg z-[101] w-[90%] max-w-xl"
44
>
55
<div class="relative">
6-
<h2 v-if="title" class="text-lg font-bold text-white text-center">
6+
<p v-if="title" class="pr-10 text-sm md:text-xl lg:text-2xl font-bold text-white text-center">
77
{{ title }}
8-
</h2>
8+
</p>
99
<button
1010
class="absolute top-0 right-0 text-white text-xl hover:text-red-400"
1111
@click="handleClose"

pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
/>
9494
<div
9595
v-if="selectedItem?.properties?.options?.display_option === 'line chart'"
96-
class="absolute bottom-40 left-1/2 transform -translate-x-1/2 bg-slate-900 text-black p-4 rounded-lg shadow-lg z-[101] w-[90%] max-w-2xl"
96+
class="absolute bottom-10 left-1/2 transform -translate-x-1/2 bg-slate-900 text-white p-4 rounded-lg shadow-lg z-[101] w-[95%] max-w-4xl sm:w-4/5 sm:max-w-2xl"
9797
>
9898
<LineChart
9999
v-if="selectedItem" :chart-data="chartData" :selected-item="selectedItem" class="mt-4"

0 commit comments

Comments
 (0)