You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.2 KiB

  1. <template>
  2. <v-row v-if="!isEmpty">
  3. <v-col
  4. cols="12"
  5. lg="4"
  6. >
  7. <v-card>
  8. <doughnut-chart
  9. :chart-data="stats.progress"
  10. />
  11. </v-card>
  12. </v-col>
  13. <v-col
  14. cols="12"
  15. lg="4"
  16. >
  17. <v-card>
  18. <bar-chart
  19. :chart-data="stats.label"
  20. />
  21. </v-card>
  22. </v-col>
  23. <v-col
  24. cols="12"
  25. lg="4"
  26. >
  27. <v-card>
  28. <bar-chart
  29. :chart-data="stats.user"
  30. />
  31. </v-card>
  32. </v-col>
  33. </v-row>
  34. </template>
  35. <script>
  36. import _ from 'lodash'
  37. import DoughnutChart from '@/components/statistics/ChartDoughnut'
  38. import BarChart from '@/components/statistics/ChartBar'
  39. export default {
  40. layout: 'project',
  41. components: {
  42. DoughnutChart,
  43. BarChart
  44. },
  45. data() {
  46. return {
  47. stats: {}
  48. }
  49. },
  50. computed: {
  51. isEmpty() {
  52. return _.isEmpty(this.stats)
  53. }
  54. },
  55. async created() {
  56. this.stats = await this.$services.statistics.fetchStatistics(
  57. this.$route.params.id,
  58. this.$t('statistics.labelStats'),
  59. this.$t('statistics.userStats'),
  60. this.$t('statistics.progress')
  61. )
  62. },
  63. validate({ params }) {
  64. return /^\d+$/.test(params.id)
  65. }
  66. }
  67. </script>