@kumo-charts/vue
API リファレンスはソースコードのコメントから生成しており、英語のみです。
import { … } from '@kumo-charts/vue';
Functions
useKumoChartfunctionソース
function useKumoChart<const M extends readonly ChartModule[] = readonly []>(
target: Ref<HTMLElement | null>,
options?: MaybeRefOrGetter<CreateChartOptions<M> | undefined>
): ShallowRef<Chart<M> | null>
Creates a chart inside target once it is mounted, with the modules of the options as they
are then, and destroys it on unmount. The other options and their changes are applied with
chart.applyOptions().
const container = useTemplateRef<HTMLDivElement>('container');
const chart = useKumoChart(container, { modules: [indicators(allIndicators)], locale: 'zh-CN' });Components
KumoChartcomponentソース
const KumoChart = defineComponent({ … })
Vue 3 component around createChart(). modules are read when the chart is created. Props
replace the chart's data, orders, markers or alerts whenever their value changes; every event of
the chart and its modules is re-emitted (e.g. @crosshair-move, @order-drag), plus @ready
with the chart instance. Stream real-time bars with chart.data.update(); manage indicators
and drawings through the instance and persist them with chart.saveState().
modules?: readonly ChartModule[]The chart's modules, such as [indicators(allIndicators)], read when it is created.
options?: ChartOptionsInput & Readonly<Record<string, unknown>>Applied with chart.applyOptions(), the options of the modules too.
data?: readonly BarInput[]Replaces all bars when the array or interval changes.
interval?: IntervalInputResolution of data, such as '1m'; needed for timeframe and chart.data.addTrades().
timeframe?: IntervalInput | nullThe displayed timeframe, such as '15m'; null shows the source resolution.
transform?: BarTransformInput | nullBuilds the displayed bars, e.g. { type: 'renko' }; null shows the timeframe's bars.
orders?: readonly OrderInput[]Needs the orders module.
markers?: readonly MarkerInput[]Needs the markers module.
alerts?: readonly AlertInput[]Needs the alerts module.
Types
KumoChartEventMaptypeソース
type KumoChartEventMap = AllEventMap
The events of the chart and of its modules; those of a module the chart lacks never fire.
KumoChartEventNametypeソース
type KumoChartEventName = keyof KumoChartEventMap
The name of an event of the chart or of one of its modules.
KumoChartPropstypeソース
type KumoChartProps = ExtractPublicPropTypes<typeof kumoChartProps>
What KumoChart takes as props, for typing a wrapper or a props object.