@nestjsforge/echarts

Themes

Register and use ECharts themes including the built-in dark theme and custom JSON themes.

ECharts has a built-in dark theme. You can also register custom themes from JSON files.

Built-in dark theme

EChartsModule.forRoot({ defaultTheme: 'dark' })

Custom JSON themes

Download themes from the ECharts Theme Builder and register them:

app.module.ts
import * as macaronsTheme from './themes/macarons.json';

EChartsModule.forRoot({
  defaultTheme: 'macarons',
  themes: [
    { name: 'macarons', theme: macaronsTheme },
    { name: 'corporate', theme: require('./themes/corporate.json') },
  ],
})

Per-render theme override

// Override the default theme for a single render
const buffer = await this.echarts.renderToBuffer(option, { theme: 'macarons' });