UNPKG

@neabyte/chart-to-image

Version:

Convert trading charts to images using Node.js canvas with advanced features: 6 chart types, VWAP/EMA/SMA indicators, custom colors, themes, hide elements, scaling, and PNG/JPEG export formats.

27 lines (26 loc) 782 B
import { Canvas } from 'canvas'; import type { NodeChartData } from '../renderer/types.js'; export declare class NodeChartRenderer { private canvas; private ctx; private width; private height; private chartData?; constructor(width: number, height: number); renderChart(data: NodeChartData): Promise<void>; private drawChart; private drawChartType; exportChart(options: { format: 'png' | 'jpeg' | 'jpg'; quality?: number; }): Promise<Buffer>; saveChart(outputPath: string, options: { format: 'png' | 'jpeg' | 'jpg'; quality?: number; }): Promise<void>; chartElement(): Canvas; } export * from './types.js'; export * from './utils.js'; export * from './charts.js'; export * from './elements.js';