Halaman ini belum diterjemahkan, jadi ditampilkan dalam bahasa Inggris.
Framework wrappers
Idiomatic wrappers for React, Vue, and Svelte. All three expose the same prop surface and hand you the underlying Chart instance.
Install
npm install @tradecanvas/react # or @tradecanvas/vue · @tradecanvas/svelte
npm install @tradecanvas/chart # the core (peer of each wrapper) React
import { TradeCanvas, type TradeCanvasRef } from '@tradecanvas/react'
import { BinanceAdapter } from '@tradecanvas/chart'
import { useRef } from 'react'
function App() {
const chartRef = useRef<TradeCanvasRef>(null)
return (
<TradeCanvas
ref={chartRef}
symbol="BTCUSDT"
timeframe="5m"
theme="dark"
adapter={new BinanceAdapter()}
onReady={(chart) => {
chart.on('orderPlace', e => console.log(e.payload))
}}
/>
)
} Vue
<script setup lang="ts">
import { TradeCanvas } from '@tradecanvas/vue'
import { BinanceAdapter } from '@tradecanvas/chart'
const adapter = new BinanceAdapter()
</script>
<template>
<TradeCanvas
symbol="BTCUSDT"
timeframe="5m"
theme="dark"
:adapter="adapter"
@ready="(chart) => console.log('ready', chart)"
/>
</template> Svelte
<script lang="ts">
import { TradeCanvas } from '@tradecanvas/svelte'
import { BinanceAdapter } from '@tradecanvas/chart'
const adapter = new BinanceAdapter()
</script>
<TradeCanvas
symbol="BTCUSDT"
timeframe="5m"
theme="dark"
{adapter}
onReady={(chart) => console.log('ready', chart)}
/> Shared props
| Prop | Type | Notes |
|---|---|---|
symbol | string | Required. |
timeframe | TimeFrame | '1m' | '5m' | '15m' | '1h' | '4h' | '1d' |
theme | ThemeName | 'dark' | 'light' | 'darkTerminal' |
adapter | DataAdapter | Live stream source. |
historyLimit | number | Initial bars to load. |
trading | boolean | Enable trading overlay. |
onReady | (chart) => void | Fires after the chart mounts. |
Need something beyond the props? Reach the underlyingChartviaonReady, a ref (React / Vue), orbind:chart(Svelte) for the full API — drawings, trading, execution adapters, plugins, resizable panes, and more.