chart-0714
Version:
Professional trading chart library with advanced customization for trading journal apps
34 lines (33 loc) • 1.03 kB
TypeScript
import { ChartOptions, Candle, ChartType } from '../types';
import { Chart } from '../core/Chart';
export interface ChartProps extends Partial<Omit<ChartOptions, 'container' | 'width' | 'height'>> {
data?: Candle[];
width?: string | number;
height?: string | number;
className?: string;
style?: React.CSSProperties;
onReady?: (chart: Chart) => void;
onError?: (error: Error) => void;
onDataUpdate?: (data: Candle[]) => void;
debug?: boolean;
autoResize?: boolean;
type?: ChartType;
backgroundColor?: string;
volumeOpacity?: number;
volumeUpColor?: string;
volumeDownColor?: string;
volumeMAColor?: string;
showVolumeMA?: boolean;
volumeMALength?: number;
}
export interface ChartRef {
chart: Chart | null;
container: HTMLDivElement | null;
}
export interface UseChartOptions extends Partial<ChartOptions> {
data?: Candle[];
onReady?: (chart: Chart) => void;
onError?: (error: Error) => void;
debug?: boolean;
autoResize?: boolean;
}