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.

63 lines (62 loc) 1.82 kB
import type { ChartConfig as IChartConfig, HorizontalLevel, WatermarkConfig } from '../types/types.js'; export declare class ChartConfig implements IChartConfig { symbol: string; timeframe: string; exchange?: string; outputPath: string; width: number; height: number; theme: 'light' | 'dark'; chartType: 'candlestick' | 'line' | 'area' | 'heikin-ashi' | 'renko' | 'line-break'; indicators: string[]; watermark?: string | WatermarkConfig; customBarColors?: { bullish?: string; bearish?: string; wick?: string; border?: string; }; horizontalLevels?: HorizontalLevel[]; title?: string; showTitle?: boolean; showTimeAxis?: boolean; showGrid?: boolean; showVWAP?: boolean; showEMA?: boolean; emaPeriod?: number; showSMA?: boolean; smaPeriod?: number; showBollingerBands?: boolean; bbPeriod?: number; bbStandardDeviations?: number; bbColors?: { upper?: string; middle?: string; lower?: string; background?: string; backgroundOpacity?: number; }; backgroundColor?: string; textColor?: string; constructor(config: Partial<IChartConfig>); private assignBasicProperties; private assignOptionalProperties; private assignDisplayProperties; private assignIndicatorProperties; private assignStylingProperties; private validate; private isValidTimeframe; private isValidChartType; getChartOptions(): { width: number; height: number; backgroundColor: string; textColor: string; gridColor: string; borderColor: string; watermark?: string | WatermarkConfig; watermarkColor: string; watermarkOpacity: number; }; toString(): string; }