Loading Data ...
Loading Data ...
This is the simplest possible QFChart implementation, demonstrating how quickly you can get a professional financial chart up and running. With just a few lines of code, you can display candlestick market data and a custom indicator. This demo is perfect for developers who want to understand the minimal setup required to integrate QFChart into their application.
The entire chart is created with less than 20 lines of JavaScript. No complex configuration, no external data loading, just pure QFChart functionality:
// 1. Parse pre-loaded data (in production, fetch from API)
const indicatorData = JSON.parse(/* MACD data */);
const ohlcvData = JSON.parse(/* BTC/USDT market data */);
// 2. Initialize chart with default options
const chart = new QFChart.QFChart(container, {
title: 'BTC/USDT'
});
// 3. Set market data (candlesticks)
chart.setMarketData(ohlcvData);
// 4. Add indicator to separate pane
chart.addIndicator('Indicator', indicatorData, {
isOverlay: false,
height: 20,
titleColor: '#ffffff'
});
Even in this minimal demo, QFChart provides essential features out of the box:
QFChart expects data in a simple, intuitive format:
[
{
time: 1748217600000, // Unix timestamp in milliseconds
open: 109004.2, // Opening price
high: 110718, // Highest price
low: 103068.55, // Lowest price
close: 105642.93, // Closing price
volume: 116099.819 // Trading volume
},
// ... more candles
]
{
"Histogram": {
"data": [
{
"time": 1748217600000,
"value": 513.11,
"options": { "color": "#26A69A" }
},
// ... more data points
],
"options": {
"title": "Histogram",
"style": "histogram",
"color": "#FF5252"
}
},
"MACD": {
"data": [ /* ... */ ],
"options": { "title": "MACD", "color": "#2962FF" }
}
}
When you don't specify options, QFChart uses sensible defaults:
Once you've mastered this basic setup, explore more advanced features:
This demo loads 30 weekly BTC/USDT candles with MACD indicator (histogram, MACD line, and signal line). The chart renders instantly and handles user interactions smoothly. QFChart is built on Apache ECharts, one of the most performant charting libraries available, capable of rendering thousands of data points without lag.
In this demo, market data and indicator values are embedded directly in the HTML for simplicity. In a production application, you would typically:
See the Full Featured Demo for an example of this workflow.
QFChart works in all modern browsers: