Updated
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<Doughnut :data="chartData" :options="chartOptions" />
|
||||
<div style="position: relative; height: 100%; width: 100%;">
|
||||
<Doughnut :data="chartData" :options="chartOptions" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<Bar :data="chartData" :options="chartOptions" />
|
||||
<div style="position: relative; height: 100%; width: 100%;">
|
||||
<Bar :data="chartData" :options="chartOptions" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<Bar :data="chartData" :options="chartOptions" />
|
||||
<div style="position: relative; height: 100%; width: 100%;">
|
||||
<Bar :data="chartData" :options="chartOptions" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -18,10 +18,26 @@ const selectedTags = ref<string[]>([]);
|
||||
let interval: ReturnType<typeof setInterval> | null = null;
|
||||
|
||||
function formatTime(ms: number) {
|
||||
const totalSeconds = Math.floor(ms / 1000);
|
||||
const hours = Math.floor(totalSeconds / 3600);
|
||||
const minutes = Math.floor((totalSeconds % 3600) / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
|
||||
const timeStr = `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
|
||||
|
||||
// Calculate rounded version
|
||||
const totalMinutes = Math.round(ms / 1000 / 60);
|
||||
const minutes = totalMinutes % 60;
|
||||
const hours = Math.floor(totalMinutes / 60);
|
||||
return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
|
||||
const roundedHours = Math.floor(totalMinutes / 60);
|
||||
const roundedMinutes = totalMinutes % 60;
|
||||
|
||||
let roundedStr = '';
|
||||
if (roundedHours > 0) {
|
||||
roundedStr = roundedMinutes > 0 ? `${roundedHours}h ${roundedMinutes}m` : `${roundedHours}h`;
|
||||
} else {
|
||||
roundedStr = `${roundedMinutes}m`;
|
||||
}
|
||||
|
||||
return `${timeStr} (${roundedStr})`;
|
||||
}
|
||||
|
||||
function toggleTag(tagId: string) {
|
||||
|
||||
Reference in New Issue
Block a user