API
创建图表对象
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
容器id或者容器styles
核心图表样式watermark
水印theme
主题locale
语言类型drawingBarVisible
是否显示画线工具栏symbol
标的period
当前周期periods
所以周期timezone
时区mainIndicators
主图指标subIndicators
副图指标datafeed
数据接入api实现
图表API
setTheme(theme)
typescript
(theme: string) => void
(theme: string) => void
设置主题
getTheme()
typescript
() => string
() => string
获取主题
setStyles(styles)
typescript
(styles: DeepPartial<Styles>) => void
(styles: DeepPartial<Styles>) => void
设置核心图表样式
getStyles()
typescript
() => Styles
() => Styles
获取核心图表样式
setLocale(locale)
typescript
(locale: string) => void
(locale: string) => void
设置语言
getLocale()
typescript
() => string
() => string
获取语言
setTimezone(timezone)
typescript
(timezone: string) => void
(timezone: string) => void
设置时区
getTimezone()
typescript
() => string
() => string
获取时区
setSymbol(symbol)
typescript
(symbol: SymbolInfo) => void
(symbol: SymbolInfo) => void
设置标的
getSymbol()
typescript
() => SymbolInfo
() => SymbolInfo
获取标的
setPeriod(period)
typescript
(period: Period) => void
(period: Period) => void
设置周期
getPeriod()
typescript
() => Period
() => Period
获取周期