API
Creating chart
typescript
new KLineChartPro(
options: {
container: string | HTMLElement;
styles?: DeepPartial<Styles>;
watermark?: string | Node;
theme?: string;
locale?: string;
drawingBarVisible?: boolean;
symbol: SymbolInfo;
period: Period;
periods?: Period[];
timezone?: string;
mainIndicators?: string[];
subIndicators?: string[];
datafeed: Datafeed;
}
) => KLineChartPronew KLineChartPro(
options: {
container: string | HTMLElement;
styles?: DeepPartial<Styles>;
watermark?: string | Node;
theme?: string;
locale?: string;
drawingBarVisible?: boolean;
symbol: SymbolInfo;
period: Period;
periods?: Period[];
timezone?: string;
mainIndicators?: string[];
subIndicators?: string[];
datafeed: Datafeed;
}
) => KLineChartProcontainerContainer id or containerstylesCore chart styleswatermarkWatermarkthemeThemelocaleLanguagedrawingBarVisibleWhether to display the drawing toolbarsymbolSymbolperiodPeriodperiodsAll periodstimezoneTimezonemainIndicatorsMain indicatorssubIndicatorsSub indicatorsdatafeedData access API implementation
Chart API
setTheme(theme)
typescript
(theme: string) => void(theme: string) => voidSet theme.
getTheme()
typescript
() => string() => stringGet theme.
setStyles(styles)
typescript
(styles: DeepPartial<Styles>) => void(styles: DeepPartial<Styles>) => voidSet core chart styles.
getStyles()
typescript
() => Styles() => StylesGet core chart styles.
setLocale(locale)
typescript
(locale: string) => void(locale: string) => voidSet language.
getLocale()
typescript
() => string() => stringGet language.
setTimezone(timezone)
typescript
(timezone: string) => void(timezone: string) => voidSet timezone.
getTimezone()
typescript
() => string() => stringGet timezone.
setSymbol(symbol)
typescript
(symbol: SymbolInfo) => void(symbol: SymbolInfo) => voidSet symbol
getSymbol()
typescript
() => SymbolInfo() => SymbolInfoGet symbol.
setPeriod(period)
typescript
(period: Period) => void(period: Period) => voidSet period.
getPeriod()
typescript
() => Period() => PeriodGet period.