Skip to content

Commit

Permalink
fix: cannot download table chart results
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Nov 25, 2024
1 parent 8404319 commit ea285c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src2/charts/components/ChartBuilderTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const drillOn = ref<{ row: QueryResultRow; column: QueryResultColumn } | null>(n
</script>

<template>
<div v-if="chart.doc.chart_type != 'Table'" class="flex h-[18rem] flex-col">
<div v-if="chart.doc.chart_type != 'Table'" class="flex h-[18rem] flex-col overflow-hidden">
<DataTable
class="rounded border bg-white"
:columns="chart.dataQuery.result.columns"
Expand Down
5 changes: 4 additions & 1 deletion frontend/src2/charts/components/TableChart.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script setup lang="ts">
import { computed } from 'vue'
import { computed, inject } from 'vue'
import DataTable from '../../components/DataTable.vue'
import { TableChartConfig } from '../../types/chart.types'
import { QueryResult } from '../../types/query.types'
import { WorkbookChart } from '../../types/workbook.types'
import { Chart } from '../chart'
import ChartBuilderTableColumn from './ChartBuilderTableColumn.vue'
import ChartTitle from './ChartTitle.vue'
Expand All @@ -13,6 +14,7 @@ const props = defineProps<{
result: QueryResult
}>()
const chart = inject<Chart>('chart')!
const tableConfig = computed(() => props.config as TableChartConfig)
</script>

Expand All @@ -26,6 +28,7 @@ const tableConfig = computed(() => props.config as TableChartConfig)
:show-filter-row="tableConfig.show_filter_row"
:show-column-totals="tableConfig.show_column_totals"
:show-row-totals="tableConfig.show_row_totals"
:on-export="chart ? chart.dataQuery.downloadResults : undefined"
>
<template #column-header="{ column }">
<ChartBuilderTableColumn :config="props.config" :column="column" />
Expand Down

0 comments on commit ea285c3

Please sign in to comment.