API Reference
createChart
| Parameter | Type | Description |
|---|---|---|
container | HTMLElement | string | DOM element or CSS selector |
options | ChartOptions | Optional configuration |
ChartOptions
LayoutOptions
GridOptions
PriceScaleOptions
Chart
Series Methods
Scale Access
Events
Utility
Lifecycle
Series
All series share these common methods:CandleSeries
LineSeries
AreaSeries
ExtendsLineSeries with a gradient fill beneath the line.
LineData shape as LineSeries.
VolumeSeries
Automatically creates a separate pane at 22% of chart height.TimeScale
| Method | Description |
|---|---|
goLive() | Enable live mode. Auto-scrolls to newest data. Snaps back after 4s idle. |
isLive() | Returns true if in live mode |
setVisibleRange(start, end) | Set visible time range (epoch ms) |
animateToRange(start, end) | Animated zoom to range |
zoomAt(factor, mouseXFrac) | Zoom around a point (scroll wheel) |
getVisibleStart() | Left edge time (epoch ms) |
getVisibleEnd() | Right edge time (epoch ms) |
getVisibleWindow() | Duration of visible range (ms) |
Orderbook
OrderbookOptions
BookData
| Method | Description |
|---|---|
ob.update(data) | Replace book data and re-render |
ob.destroy() | Remove DOM and stop rendering |
createShortFormOverlay
One-liner to add Polymarket short-form price-to-beat overlays to any live chart. Adds interval buttons, auto-discovers markets, draws a dashed price-to-beat line, and shows live odds with a countdown timer.ShortFormOverlayOptions
ShortFormOverlay (return type)
| Method | Description |
|---|---|
overlay.setInterval('15m') | Switch to a different interval |
overlay.stop() | Stop polling, remove price line, clear display |
overlay.destroy() | Full cleanup: stop + remove DOM |
overlay.getActiveInterval() | Returns current interval or null |
What it renders
- Interval buttons (5m, 15m, 1h) — click to toggle on/off
- Price-to-beat line — horizontal dashed blue line on the chart
- Odds display — “24% up · 77% down · 1m35s” with live countdown
- Auto-rotation — discovers the next market window when the current one expires
PolynodeProvider — MarketInfo
Theoutcome field tells you which side of a binary market this token represents.
neg_risk field indicates a multi-outcome event on Polymarket. When provider.event() searches for multi-outcome markets, it prioritizes neg_risk: true markets to find genuine events (elections, World Cup, NBA Finals) rather than binary matches.
