Skip to content

Vue component

Props, events and slots of <KlineChart>, generated from KLineChart.vue.

Generated from packages/vue/src/components/KLineChart.vue at the pinned commit.

Props

PropTypeDefaultDescription
symbolsReadonlyArray<SymbolSpec>—Controlled instrument list. When set, the component syncs it into the chart's data sources.
indicatorsReadonlyArray<ChartIndicatorConfig>—Controlled indicator instances. When set, it replaces the current instances as a whole.
custom-markersReadonlyArray<CustomMarkerEntity>—Controlled custom markers. When set, it replaces the current custom markers as a whole.
market-sessionsChartMountOptions['marketSessions']—Market trading-session overrides for this chart instance.
y-padding-pxnumber20Vertical padding inside the price pane, in CSS pixels.
min-k-widthnumber1Narrowest candle width when zoomed out, in CSS pixels.
max-k-widthnumber50Widest candle width when zoomed in, in CSS pixels.
right-axis-widthnumber0Width of the right price axis.
left-axis-widthnumber—Width of the left price axis; 0 hides it.
bottom-axis-heightnumber24Height of the bottom time axis.
price-label-widthnumber60Extra width of the last-price label, used for the change percentage.
zoom-levelsnumber20Number of zoom levels.
initial-zoom-levelnumber3Zoom level at mount, from 1 to zoomLevels.
is-fullscreenboolean—Controlled fullscreen state. Leave it unbound and the component manages fullscreen itself.
timezonestring'Asia/Shanghai'IANA time zone used for dates and times on the axes and tooltips.
settingsPartial<ChartSettings>—Chart settings, merged per key: keys you pass win, other keys fall back to what the browser stored, then to defaults.
legendLegendOptions—Canvas legend configuration for the main pane. Core draws it; it never enters the Vue update path.
custom-dataCustomDataSource—Inline data bundle ({ symbol?, period?, data, comparisons? }). The chart uses it instead of fetching.

Events

EventPayloadDescription
@zoom-level-changelevel: number, kWidth: numberThe zoom level changed.
@toggle-fullscreen—The fullscreen button was pressed.
@update:is-fullscreenvalue: booleanFullscreen state for v-model:is-fullscreen.
@theme-changetheme: 'light' | 'dark'The user switched between light and dark.
@k-line-level-changelevel: stringThe user picked another period.
@k-line-adjust-changeadjust: 'qfq' | 'hfq' | 'splits' | 'none'The user picked another price adjustment.
@controller-readycontroller: ChartControllerThe headless ChartController is ready; use it for imperative calls.

Slots

SlotScopeDescription
#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.
#legendLegendSlotPropsReplaces the main pane's default legend. Receives the core legend template context.
#kline-tooltipKlineTooltipSlotPropsCustom candle tooltip; rendered on hover (not on mobile) with the hovered bar.
#marker-tooltipMarkerTooltipSlotPropsCustom marker tooltip; rendered while a marker is hovered.

On this page