diff --git a/apps/container/src/components/PerformanceCard.vue b/apps/container/src/components/PerformanceCard.vue index dfcfe4b2..ffccd7a4 100644 --- a/apps/container/src/components/PerformanceCard.vue +++ b/apps/container/src/components/PerformanceCard.vue @@ -11,13 +11,13 @@

{{ description }} - {{tooltip}} + {{tooltip}}

diff --git a/apps/container/src/views/Performance/PerformanceView.vue b/apps/container/src/views/Performance/PerformanceView.vue index 93f32675..0a7e3e05 100644 --- a/apps/container/src/views/Performance/PerformanceView.vue +++ b/apps/container/src/views/Performance/PerformanceView.vue @@ -9,29 +9,14 @@ import { theme } from '@/bootstrap'; import { CenteredLoading } from '@/components/CenteredLoading'; import { formatSeason } from 'utils'; -const { data: crHistoryData, isPending: isPendingCrHistory } = useQuery({ - queryKey: ['crHistory'], - queryFn: Performance.getCrHistory, - select: (response) => response.data, -}); - -const crHistorySeries = computed(() => { - const arrCrHistory = crHistoryData.value?.map((quad) => { - const roundedCr = parseFloat(quad.cr_acumulado.toFixed(2)); - return [formatSeason(quad.season), roundedCr]; - }); - return arrCrHistory; -}); -const crHistoryOptions = ref({ +const areaGraphOptions = { accessibility: { enabled: true, }, - chart: { type: 'area', style: { fontFamily: 'Roboto, sans-serif' }, }, - plotOptions: { area: { fillOpacity: 0.45, @@ -41,18 +26,32 @@ const crHistoryOptions = ref({ }, }, }, - colors: [theme.colors?.primary], - - title: { - text: 'Seu CR ao longo do tempo', - }, - tooltip: { borderRadius: 10, padding: 12, }, +}; + +const { data: crHistoryData, isPending: isPendingCrHistory } = useQuery({ + queryKey: ['crHistory'], + queryFn: Performance.getCrHistory, + select: (response) => response.data, +}); + +const crHistorySeries = computed(() => { + const arrCrHistory = crHistoryData.value?.map((quad) => { + const roundedCr = parseFloat(quad.cr_acumulado.toFixed(2)); + return [formatSeason(quad.season), roundedCr]; + }); + return arrCrHistory; +}); +const crHistoryOptions = ref({ + ...areaGraphOptions, + title: { + text: 'Seu CR ao longo do tempo', + }, yAxis: { title: { text: 'CR', @@ -61,7 +60,6 @@ const crHistoryOptions = ref({ min: 0, max: 4, }, - xAxis: { title: { text: 'Quadrimestre', @@ -69,17 +67,15 @@ const crHistoryOptions = ref({ crosshair: true, type: 'category', }, - - legend: { - verticalAlign: 'top', - }, - series: [ { name: 'Seu CR', data: crHistorySeries, }, ], + legend: { + verticalAlign: 'top', + }, }); const currentCpCourse = ref(); @@ -108,36 +104,10 @@ const cpHistorySeries = computed(() => { return result; }); const cpHistoryOptions = ref({ - accessibility: { - enabled: true, - }, - - chart: { - type: 'area', - style: { fontFamily: 'Roboto, sans-serif' }, - }, - - plotOptions: { - area: { - fillOpacity: 0.45, - lineWidth: 2, - marker: { - radius: 4, - }, - }, - }, - - colors: [theme.colors?.primary], - + ...areaGraphOptions, title: { text: 'Seu CP ao longo do tempo', }, - - tooltip: { - borderRadius: 10, - padding: 12, - }, - yAxis: { title: { text: 'CP', @@ -145,7 +115,6 @@ const cpHistoryOptions = ref({ min: 0, max: 1, }, - xAxis: { title: { text: 'Quadrimestre', @@ -153,11 +122,6 @@ const cpHistoryOptions = ref({ crosshair: true, type: 'category', }, - - legend: { - verticalAlign: 'top', - }, - series: [ { name: 'Seu CP', @@ -192,43 +156,16 @@ const closeCrs = computed( ); const crDistributionOptions = ref({ - accessibility: { - enabled: true, - }, - - chart: { - type: 'area', - style: { fontFamily: 'Roboto, sans-serif' }, - }, - - plotOptions: { - area: { - fillOpacity: 0.45, - lineWidth: 2, - marker: { - radius: 4, - }, - }, - }, - - colors: [theme.colors?.primary], - + ...areaGraphOptions, title: { text: 'DistribuiĆ§Ć£o de CR', }, - - tooltip: { - borderRadius: 10, - padding: 12, - }, - yAxis: { title: { text: 'Quantidade de alunos', }, tickInterval: 50, }, - xAxis: { title: { text: 'CR', @@ -237,11 +174,6 @@ const crDistributionOptions = ref({ type: 'category', tickInterval: 0.5, }, - - legend: { - verticalAlign: 'top', - }, - series: [ { name: 'Quantidade de alunos', @@ -250,6 +182,7 @@ const crDistributionOptions = ref({ ], annotations: [ { + draggable: '', labelOptions: { crop: false, }, @@ -356,15 +289,14 @@ const cards = computed(() => [ -
- -
@@ -374,7 +306,7 @@ const cards = computed(() => [ + \ No newline at end of file