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;
}
) => KLineChartPro
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;
}
) => KLineChartPro
container
Container id or containerstyles
Core chart styleswatermark
Watermarktheme
Themelocale
LanguagedrawingBarVisible
Whether to display the drawing toolbarsymbol
Symbolperiod
Periodperiods
All periodstimezone
TimezonemainIndicators
Main indicatorssubIndicators
Sub indicatorsdatafeed
Data access API implementation
Chart API
setTheme(theme)
typescript
(theme: string) => void
(theme: string) => void
Set theme.
getTheme()
typescript
() => string
() => string
Get theme.
setStyles(styles)
typescript
(styles: DeepPartial<Styles>) => void
(styles: DeepPartial<Styles>) => void
Set core chart styles.
getStyles()
typescript
() => Styles
() => Styles
Get core chart styles.
setLocale(locale)
typescript
(locale: string) => void
(locale: string) => void
Set language.
getLocale()
typescript
() => string
() => string
Get language.
setTimezone(timezone)
typescript
(timezone: string) => void
(timezone: string) => void
Set timezone.
getTimezone()
typescript
() => string
() => string
Get timezone.
setSymbol(symbol)
typescript
(symbol: SymbolInfo) => void
(symbol: SymbolInfo) => void
Set symbol
getSymbol()
typescript
() => SymbolInfo
() => SymbolInfo
Get symbol.
setPeriod(period)
typescript
(period: Period) => void
(period: Period) => void
Set period.
getPeriod()
typescript
() => Period
() => Period
Get period.