diff --git a/frontend/src/views/chat/chat-block/ChartBlock.vue b/frontend/src/views/chat/chat-block/ChartBlock.vue index 86ab2b36..d1cc908e 100644 --- a/frontend/src/views/chat/chat-block/ChartBlock.vue +++ b/frontend/src/views/chat/chat-block/ChartBlock.vue @@ -2,7 +2,7 @@ import type { ChatMessage } from '@/api/chat.ts' import DisplayChartBlock from '@/views/chat/component/DisplayChartBlock.vue' import ChartPopover from '@/views/chat/chat-block/ChartPopover.vue' -import { computed, ref } from 'vue' +import { computed, ref, watch } from 'vue' import { concat } from 'lodash-es' import type { ChartTypes } from '@/views/chat/component/BaseChart.ts' import ICON_BAR from '@/assets/svg/chart/icon_bar_outlined.svg' @@ -246,6 +246,7 @@ function exportToExcel() { }) exportRef.value?.hide() } + function exportToImage() { const obj = document.getElementById('chart-component-' + chartId.value) if (obj) { @@ -265,6 +266,15 @@ function exportToImage() { } exportRef.value?.hide() } + +watch( + () => chartObject.value.type, + (val) => { + if (val) { + currentChartType.value = val + } + } +)