Vue component
Props, events and slots of <KlineChart>, generated from KLineChart.vue.
| Prop | Type | Default | Description |
|---|
symbols | ReadonlyArray<SymbolSpec> | — | Controlled instrument list. When set, the component syncs it into the chart's data sources. |
restore-layout | boolean | true | Restore the active saved layout when mounting the chart. |
layout-storage-id | string | — | Stable key for a chart tab's independent layout archive. |
indicators | ReadonlyArray<ChartIndicatorConfig> | — | Controlled indicator instances. When set, it replaces the current instances as a whole. |
runtime | import('@363045841yyt/klinechart-core').MarketRuntime | — | Shared market and indicator runtime provided by the application host. |
scripts-enabled | boolean | true | Enables the script controls and script indicators for this chart. |
y-padding-px | number | 20 | Vertical padding inside the price pane, in CSS pixels. |
min-k-width | number | 1 | Narrowest candle width when zoomed out, in CSS pixels. |
max-k-width | number | 200 | Widest candle width when zoomed in, in CSS pixels. |
right-axis-width | number | 0 | Width of the right price axis. |
left-axis-width | number | — | Width of the left price axis; 0 hides it. |
bottom-axis-height | number | 24 | Height of the bottom time axis. |
price-label-width | number | 60 | Extra width of the last-price label, used for the change percentage. |
zoom-levels | number | 80 | Number of zoom levels. |
initial-zoom-level | number | 3 | Zoom level at mount, from 1 to zoomLevels. |
timezone | string | 'Asia/Shanghai' | IANA time zone used for dates and times on the axes and tooltips. |
settings | Partial<ChartSettings> | — | Chart settings, merged per key: keys you pass override the active layout; other keys come from that layout and the defaults. |
legend | LegendOptions | — | Canvas legend configuration for the main pane. Core draws it; it never enters the Vue update path. |
| Event | Payload | Description |
|---|
@theme-change | theme: 'light' | 'dark' | The user switched between light and dark. |
@k-line-level-change | level: string | The user picked another period. |
@k-line-adjust-change | adjust: KLineAdjustment | The user picked another price adjustment. |
@controller-ready | controller: ChartController | The headless ChartController is ready; use it for imperative calls. |
| Slot | Scope | Description |
|---|
#source-management | — | Host-managed market-data connections and credentials. The chart never holds keys. |
#toolbar-start | — | Start of the top toolbar, for host controls such as an account menu. |
#toolbar-end | — | End of the top toolbar. |
#legend | LegendSlotProps | Replaces the main pane's default legend. Receives the core legend template context. |
#kline-tooltip | KlineTooltipSlotProps | Custom candle tooltip; rendered on hover (not on mobile) with the hovered bar. |