Skip to main content
Skip to main content

Core concepts

You already mounted a chart from Getting started. These pages explain how it thinks — so when something looks wrong (blank box, wrong bar size, scale jumping), you know where to look.

No PhD required. We use everyday words first; exact API names come second.

Loading chart…
Every concept below describes what happens inside a chart like this.

What to read and when

PageRead when you wonder…
Chart lifecycle“In what order do I call things?” or “Why is my chart blank?”
Data model“What shape should my API return?” or “What is a tick vs a candle?”
Rendering and scales“How do I switch candles to a line?” or “Why did the Y axis change?”

The big picture

flowchart LR
Create["createChart()"]
Init["init()"]
Data["setMainSeriesData()"]
Use["draw mode, indicators, live ticks…"]
Destroy["destroy()"]

Create --> Init --> Data --> Use --> Destroy
  1. Create — attach the engine to a <div>.
  2. Init — prepare canvases and internal state (once).
  3. Data — feed candles or stream ticks.
  4. Use — change appearance, add indicators, draw lines.
  5. Destroy — tear down when the user leaves.

Skip a step (especially init() or container height) and the chart often shows nothing.

Three ideas you will see everywhere

Container

A normal DOM element with a real height. The chart is painted inside it — like a video player in a fixed frame.

Candle vs tick

CandleTick
WhatOne finished bar (OHLC for an hour, day, …)One price update right now
WhenHistory load, bar closedLive feed, WebSocket
APIsetMainSeriesData, appendMainSeriesDataappendTick

Draw mode vs scale

  • Draw modehow price is drawn (candles, line, bars).
  • Scalehow the Y axis behaves (linear, log, percent).

They are independent: you can show a line on a log scale.

Already stuck?

SymptomLikely causeFix
White empty boxContainer height is 0height: 480px on the wrapper
No candles after createinit() not calledCall init() before data
Bars look wrongBad timestampsUTC ms at bar open time
Y axis keeps jumpingAutoscale on + volatile dataSee Rendering and scales

Where to go next