Skip to Content
๐ŸŽ‰ Univer 0.6.7 is released.Read more โ†’
Playground๐Ÿ“Š Univer SheetsCharts

Charts

Loading...
import { createUniver, defaultTheme, LocaleType, merge } from '@univerjs/presets'
import { UniverSheetsAdvancedPreset } from '@univerjs/presets/preset-sheets-advanced'
import UniverPresetSheetsAdvancedEnUS from '@univerjs/presets/preset-sheets-advanced/locales/en-US'
import { UniverSheetsCorePreset } from '@univerjs/presets/preset-sheets-core'
import sheetsCoreEnUS from '@univerjs/presets/preset-sheets-core/locales/en-US'
import { UniverSheetsDrawingPreset } from '@univerjs/presets/preset-sheets-drawing'
import UniverPresetSheetsDrawingEnUS from '@univerjs/presets/preset-sheets-drawing/locales/en-US'
import { WORKBOOK_DATA } from './data'
import { insertChart } from './function'

import './style.css'
import '@univerjs/presets/lib/styles/preset-sheets-core.css'
import '@univerjs/presets/lib/styles/preset-sheets-drawing.css'
import '@univerjs/presets/lib/styles/preset-sheets-advanced.css'

const { univerAPI } = createUniver({
  locale: LocaleType.EN_US,
  locales: {
    [LocaleType.EN_US]: merge(
      {},
      sheetsCoreEnUS,
      UniverPresetSheetsDrawingEnUS,
      UniverPresetSheetsAdvancedEnUS,
    ),
  },
  theme: defaultTheme,
  presets: [
    UniverSheetsCorePreset(),
    UniverSheetsDrawingPreset(),
    UniverSheetsAdvancedPreset({
      license: '1846850823316525117-1-eyJpIjoiMTg0Njg1MDgyMzMxNjUyNTExNyIsInYiOiIxIiwicCI6IkVFNTRrV0NxRkdUOUNWcEJsK2ZNWnBpekgxQ3pDV2dzWEMyKzB1c3RRRFk9IiwiZG0iOlsiKi51bml2ZXIuYWkiLCIqLnVuaXZlci5wbHVzIl0sInJ0IjozLCJmdCI6eyJ1ZiI6eyJtdSI6MjE0NzQ4MzY0NiwiZXQiOjE3Njc4ODc5OTksIm1tIjoyMTQ3NDgzNjQ2LCJjdSI6MjE0NzQ4MzY0Nn0sInNmIjp7ImV0IjoxNzY3ODg3OTk5LCJydiI6dHJ1ZSwicHRuIjoyMTQ3NDgzNjQ2LCJtaXMiOjIxNDc0ODM2NDYsIm1wbiI6MjE0NzQ4MzY0NiwibmMiOjIxNDc0ODM2NDZ9LCJkZiI6eyJldCI6MTc2Nzg4Nzk5OSwicnYiOnRydWUsIm1pcyI6MjE0NzQ4MzY0NiwibXBuIjoyMTQ3NDgzNjQ2fSwid3NmIjp7ImV0IjoxNzY3ODg3OTk5LCJobiI6MjE0NzQ4MzY0Nn19LCJ1ZCI6MTc2Nzg4Nzk5OSwiYXQiOjE3MzYzMzA2ODYsImUiOiJkZXZlbG9wZXJAdW5pdmVyLmFpIiwiZCI6OCwibiI6MTUyfQ==-bjVjDKN3EaHAvf4ySUFxnjHsXiKnk1RSiiOD7RaeXkXRHheSdiMjfctXscfYQxJdleRIA9hSSlc4TO9Ncy/qCQ==-1767887999',
    }),
  ],
})

univerAPI.createWorkbook(WORKBOOK_DATA)

univerAPI.addEvent(univerAPI.Event.LifeCycleChanged, ({ stage }) => {
  if (stage === univerAPI.Enum.LifecycleStages.Rendered) {
    insertChart(univerAPI)
  }
})

Read-only

Was this page helpful?
Last updated on