charts.js 489 B

123456789101112131415161718
  1. // 本组件参考 arco-pro 的实现
  2. // https://github.com/arco-design/arco-design-pro-vue/blob/main/arco-design-pro-vite/src/hooks/chart-option.ts
  3. import { computed } from 'vue'
  4. import { useAppStore } from '@/pinia'
  5. export default function useChartOption(sourceOption) {
  6. const appStore = useAppStore()
  7. const isDark = computed(() => {
  8. return appStore.isDark
  9. })
  10. const chartOption = computed(() => {
  11. return sourceOption(isDark.value)
  12. })
  13. return {
  14. chartOption
  15. }
  16. }