@nestjsforge/echarts

Per-call Overrides

Override global configuration on a per-render basis.

Every render method accepts an optional second argument to override the global configuration for that specific render call:

// Render a thumbnail
const thumb = await this.echarts.renderToBuffer(option, {
  width: 400,
  height: 300,
  theme: 'light',
  deviceScaleFactor: 1,
  timeout: 5_000,
});

// Render a high-res banner
const banner = await this.echarts.renderToBuffer(option, {
  width: 1920,
  height: 600,
  deviceScaleFactor: 2,
  timeout: 30_000,
});