76 drawing tools
Code
Read the docs →import { ChartWidget } from '@tradecanvas/chart/widget'
// feed: your DataAdapter (a WebSocketAdapter, or your own class)
const widget = new ChartWidget(document.getElementById('chart')!, {
symbol: 'NVDA',
timeframe: '1h',
theme: 'light',
adapter: feed,
// 76 drawing tools in the left toolbar; they are saved with the layout
persistLayouts: true,
})
const chart = widget.getChart()
chart.addDrawing({ type: 'fibRetracement', anchors: [low, high] })
chart.addDrawing({
type: 'trendLine', name: 'Rising support', anchors: [low, nextLow],
style: { text: 'Support', textAlign: 'center', textVAlign: 'bottom' },
})
chart.addDrawing({ type: 'signpost', anchors: [high], style: { text: 'Top' } })
// Kept to the screen: shares of the plot, not a time and a price
chart.addDrawing({ type: 'anchoredNote', anchors: [{ time: 0.06, price: 0.86 }],
style: { text: 'Double-click this note to type over it' } })
// On the RSI pane, at 70 on its scale
const rsi = chart.addIndicator('rsi', { period: 14 })
chart.addDrawing({ type: 'horizontalLine', paneId: rsi, anchors: [{ time, price: 70 }],
style: { text: 'Overbought' } })import { ChartWidget } from '@tradecanvas/chart/widget'
// feed: your DataAdapter (a WebSocketAdapter, or your own class)
const widget = new ChartWidget(document.getElementById('chart')!, {
symbol: 'NVDA',
timeframe: '1h',
theme: 'dark',
adapter: feed,
// 76 drawing tools in the left toolbar; they are saved with the layout
persistLayouts: true,
})
const chart = widget.getChart()
chart.addDrawing({ type: 'fibRetracement', anchors: [low, high] })
chart.addDrawing({
type: 'trendLine', name: 'Rising support', anchors: [low, nextLow],
style: { text: 'Support', textAlign: 'center', textVAlign: 'bottom' },
})
chart.addDrawing({ type: 'signpost', anchors: [high], style: { text: 'Top' } })
// Kept to the screen: shares of the plot, not a time and a price
chart.addDrawing({ type: 'anchoredNote', anchors: [{ time: 0.06, price: 0.86 }],
style: { text: 'Double-click this note to type over it' } })
// On the RSI pane, at 70 on its scale
const rsi = chart.addIndicator('rsi', { period: 14 })
chart.addDrawing({ type: 'horizontalLine', paneId: rsi, anchors: [{ time, price: 70 }],
style: { text: 'Overbought' } })● Simulated market data, generated in your browser
A complete screen out of the box: order ticket, orders and positions on the chart, stop-loss and take-profit you drag, watchlists, alerts and bar replay.
API: addDrawing







