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) 749 B
import type { ChartOptions } from '../types/types.js'; export declare class ImageExporter { exportChart(chart: { chartElement(): HTMLElement; }, outputPath: string, options: ChartOptions): Promise<{ success: boolean; dataUrl?: string; error?: string; }>; private waitForChartRender; private convertToCanvas; private elementToCanvas; private exportToPNG; private exportToJPEG; private exportToSVG; private elementToSVG; private convertPixelsToRects; private findLargestRect; private findMaxWidth; private findMaxHeight; private isSameColor; private isRowValid; private markRowAsVisited; private createFallbackSVG; private getFileExtension; }