-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script setup> | ||
const { $api } = useNuxtApp() | ||
const isLoading = ref(false) | ||
onMounted(async () => { | ||
getInitData() | ||
}) | ||
const dimensions = ref([]) | ||
const cities = ref([]) | ||
const challengesStats = ref({}) | ||
const dataFetchDone = ref(false) | ||
const getInitData = async () => { | ||
isLoading.value = true | ||
try { | ||
const [dimensionsData, citiesData, theStatsData] = await Promise.all([ | ||
$api('/utils/dimensions'), | ||
$api('/utils/cities'), | ||
$api('/challenges/stats') | ||
]) | ||
dimensions.value = dimensionsData | ||
cities.value = citiesData | ||
challengesStats.value = theStatsData | ||
dataFetchDone.value = true | ||
} catch (error) { | ||
console.error(error) | ||
} finally { | ||
isLoading.value = false | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<UCard v-if="isLoading"> | ||
<UProgress /> | ||
</UCard> | ||
<div v-else> | ||
<div class="grid grid-cols-1 gap-1"> | ||
<DesafiosChartsDimensions v-if="challengesStats.radarData" :graph-data="challengesStats.radarData"/> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
<script setup> | ||
provide(THEME_KEY, 'dark'); | ||
const props = defineProps({ | ||
graphData: { | ||
type: Object, | ||
required: true | ||
} | ||
}); | ||
console.log(props.graphData); | ||
const option = ref({ | ||
backgroundColor: 'transparent', | ||
title: { | ||
text: 'Cantidad de desafíos por dimensiones', | ||
subtext: 'Cada serie representa una ciudad', | ||
top: 0, | ||
left: 0 | ||
}, | ||
legend: { | ||
data: props.graphData.legendData, | ||
right: 0, | ||
bottom: 0 | ||
}, | ||
tooltip: { | ||
trigger: 'item' | ||
}, | ||
radar: { | ||
// shape: 'circle', | ||
indicator: props.graphData.radarIndicator | ||
}, | ||
series: [ | ||
{ | ||
name: 'Budget vs spending', | ||
type: 'radar', | ||
data: props.graphData.radar.data | ||
} | ||
] | ||
}); | ||
</script> | ||
|
||
<template> | ||
<UCard> | ||
<VChart class="chart" :option="option" /> | ||
</UCard> | ||
</template> | ||
|
||
<style scoped> | ||
.chart { | ||
height: 500px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters