FCS Advanced Chart Library

FCS Advanced Chart is a lightweight, high-performance charting library for financial markets. Display real-time candlestick, line, and area charts with technical indicators and drawing tools. Designed for forex, crypto, and stock trading platforms with TradingView-like functionality.

FCS Advanced Chart demo - BTCUSDT candlestick chart with indicators, drawing tools and replay
Click the preview to run the real chart right here, or open the full-screen demo in a new tab.
This demo runs on the free Access KEY, so the chart shows a small Powered by vunelix.com label in the bottom corner. Set your own FCSAPI accessKey and that label is removed automatically - no extra setting needed.
Why Use FCS Chart?

Our chart library provides professional-grade charting capabilities with minimal resource usage. Perfect for trading platforms, market analysis tools, and financial dashboards that need real-time data visualization.

Key Features

• Real-time updates - WebSocket integration for live price data
• Multiple chart types - Candlestick, Bars, Line, Area, Heikin-Ashi, Renko and more
• Technical indicators - 50+ built-in indicators (MA, RSI, MACD, Bollinger Bands, etc.)
• Drawing tools - Trend lines, Fibonacci, patterns, and annotations
• Broker Integration - Horizontal Line API for TP/SL/Entry price lines
• Lightweight - Optimized for low CPU/RAM usage on browsers and mobile

What You Get:
  • 9 chart types: Candlestick, Bars, Line, Area, Hollow, Heikin-Ashi, High-Low, Volume Candles, Renko
  • 50+ technical indicators with customizable settings
  • Drawing tools: Trend lines, Fibonacci, ABCD patterns, annotations
  • Multi-timeframe support: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W, 1M + custom timeframes
  • Horizontal Line API for brokers (TP/SL/Entry price lines)
  • Replay mode for backtesting strategies
  • Screenshot/export functionality
  • Dark and Light themes
  • Responsive design for desktop and mobile

Get Started in 3 Steps

Start displaying professional financial charts in minutes. Just include our library, create a container, and initialize the chart.

Step 1: Include the Library

Add the CSS and JavaScript files to your HTML:

<!-- CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.css">

<!-- JavaScript -->
<script src="https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.js"></script>

Step 2: Create Chart Container

Add a container element for the chart:

<div id="fcs_chartparent">
    <div id="fcs_chart"></div>
</div>

Step 3: Initialize the Chart

Create a new chart instance with your configuration:

const chart = new FCSAPIChart({
    container: document.getElementById('fcs_chart'),
    parentid: 'fcs_chartparent',
    accessKey: 'YOUR_API_KEY',
    symbol: 'BINANCE:BTCUSDT',
    period: '1H'
});
API Key Required

You need a valid API key to load chart data. Get your API key from your dashboard.

No branding with your own key: the free key (or leaving accessKey empty) draws a small Powered by vunelix.com label on the chart. As soon as you pass your own FCSAPI access key, the label is gone - it is white-label by default.


Library Installation

Download and include the FCS Chart library files in your project. The library consists of a CSS file for styling and a JavaScript file for functionality.

CDN (Recommended)

Include from GitHub CDN - no download required:

<!-- CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.css">

<!-- JavaScript -->
<script src="https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.js"></script>

Container Setup

The chart requires two nested containers:

<div id="fcs_chartparent" style="width: 100%; height: 600px;">
    <div id="fcs_chart"></div>
</div>

Important: The parent container (fcs_chartparent) must have a defined height. The inner container (fcs_chart) will be managed by the chart library.

Mobile Height Fix

For full-height charts on mobile devices, use this JavaScript:

function setMobileHeight() {
    const vh = window.innerHeight;
    document.getElementById('fcs_chartparent').style.height = vh + 'px';
}
setMobileHeight();
window.addEventListener('resize', setMobileHeight);
CDN Links

CSS:
https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.css

JavaScript:
https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.js

Requirements:
  • Browser: Modern browsers with ES6 support (Chrome, Firefox, Safari, Edge)
  • Container: Parent element must have defined width and height
  • API Key: Valid FCS API key for data access
  • Socket Key: Optional WebSocket key for real-time updates

Chart Configuration Options

Configure your chart with these options. Only container, parentid, and one way to authenticate are required: accessKey, or publicKey (with your domain added in Dashboard > Security), or a jwt_token created on your server (sent alone, no keys in the page). All other options have sensible defaults.

Required Settings

OptionTypeDescription
containerElement*required Chart container DOM element
parentidString*required Parent container ID for toolbar/sidebar positioning
accessKeyString*required Your FCS API access key
socketApiKeyStringoptional WebSocket API key for live price updates
publicKeyStringoptional Public key. Use it WITHOUT accessKey to run the chart on your allowed domains only (set them in Dashboard > Security > Allowed Domains (Public Key)); your access key is never put in the page. Use it WITH accessKey to hide the accessKey from the user's network requests
jwt_tokenStringoptional JWT created by forex/jwt_token. Use it alone: no accessKey and no publicKey are needed, because the token already carries your public key. The chart sends it with every request as jwt_token. It expires, so pass a new one with chart.updateJWTtoken() (see API Methods). A plain JWT follows your key's Allowed Domains (Dashboard > Security): empty list = any website, filled list = the page's domain must be on it. A JWT created on your server with &domain=yoursite.com works from that website only and skips the list; one created from the page with jwt_token?public_key= is tied to the page's domain automatically when that domain is on Allowed Domains (a caller let in only by its IP gets a plain token)
socketUrlStringoptional Custom WebSocket server URL (e.g. ws://localhost:4001/ws)
url_paramsObjectoptional Extra parameters sent with every API request, each one on its own: { abc: 1, xyz: 2 } adds &abc=1&xyz=2. It cannot replace the chart's own request parameters or the authentication parameters

Core Chart Settings

OptionTypeDefaultDescription
symbolStringBINANCE:BTCUSDTDefault symbol to load (format: EXCHANGE:SYMBOL)
periodString1DDefault timeframe: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W, 1M
lengthNumber600Number of candles to load (max depends on API plan; the free key always loads 300)
enableCacheBooleantrueCache user's last symbol/period/settings in localStorage
changeURLBooleanfalseUpdate browser URL with symbol/period (shareable links)

Display Mode

OptionTypeDefaultDescription
displayModeStringnormalnormal = full UI with toolbar/sidebar | chartonly = hide all UI, show only chart

Appearance

OptionTypeDefaultDescription
themeStringlightdark | light
defaultChartTypeStringcandlestickcandlestick | bars | line | area | hollow | heikin-ashi | high-low | volume-candles
timezoneStringlocallocal | UTC | +05:00 | -08:00 etc.
Configuration Tips

Symbol Format: Always use EXCHANGE:SYMBOL format (e.g., BINANCE:BTCUSDT, NASDAQ:AAPL, FX:EURUSD)

Performance: Use displayMode: "chartonly" for embedded charts to reduce memory usage

Caching: Enable enableCache to remember user preferences across sessions

Hide Access Key: Set publicKey and leave accessKey out. Add your website domain in Dashboard > Security > Allowed Domains (Public Key); the domain is detected by the browser and requests from other domains are rejected. Or create a short-lived jwt_token on your server and pass only that (see Security > JWT Token)

Socket Limits: The default WebSocket key is limited to a 2-second update rate and limited connections per IP. For faster updates and more connections, purchase a dedicated socket key.


UI Layout Toggles

Control which UI elements are visible on your chart. Disable elements you don't need to create a cleaner interface or reduce memory usage.

Main Layout Elements

OptionDefaultDescription
enableSidebartrueLeft sidebar with drawing tools (trend lines, fibonacci, shapes, etc.)
enableToolbartrueTop toolbar with all controls (search, indicators, settings, etc.)
enableRangeSelectortrueBottom time range selector bar for quick navigation

Toolbar Controls

OptionDefaultDescription
enableSearchtrueSymbol search button and search panel
enableIndicatorstrueIndicators button and indicator selection panel
enableMultiCharttrueMulti-chart layouts button (1/2/3/4 charts)
enableReplaytrueReplay mode button for backtesting
enableCapturetrueScreenshot/export button
enableUndoRedotrueUndo/Redo buttons (also Ctrl+Z, Ctrl+Y)
enableTemplatestrueTemplate save/load functionality
enableSettingstrueSettings gear button for chart preferences
enableSymbolInfotrueSymbol info button (shows profile/stats)
enableChartTypeSelectortrueChart type dropdown selector in toolbar
enableTimeframeSelectortrueTimeframe/period dropdown selector in toolbar
Minimal Chart Mode

For an embedded chart without UI controls, use:
displayMode: "chartonly"

Or disable individual elements:
enableSidebar: false,
enableToolbar: false,
enableRangeSelector: false


Symbol Search Filters

Control which tabs and symbols appear in the symbol search modal. Use these options to limit the search to specific asset classes or a curated list of symbols.
Example 1: I want to display only Commodity symbols hide all other stocks forex. use `searchModalTabs`
Example 2: I want only Major currencies and Few stocks. use `searchAllowSymbols`

Search Filter Options

OptionTypeDefaultDescription
searchModalTabsObjectnullOnly show these tabs in the search modal (null = show all). Keys map to a display label.
searchAllowSymbolsArraynullOnly these symbols appear in search results (null = all allowed)
searchExcludeSymbolsArraynullHide these symbols from search results (null = none hidden)
searchAllowExchangesObjectnullLimit search per tab. Country tabs (stock, fund, dr, indices) take { COUNTRY: '*' | [exchanges] }; exchange tabs (crypto, forex, dex) take a list of exchanges. '*' or a missing tab means no limit. Example: { stock: { US: ['NASDAQ'], PK: '*' }, crypto: ['BINANCE'] }

Available Tab Keys

Use these keys in searchModalTabs to control which category tabs are shown:

KeyCategory
favFavorites
allAll List
forexForex
cryptoCrypto
commodityCommodity
stockStocks
drDepositary Receipts
fundFunds
futuresFutures
indicesIndices
dexDex

Usage

const chart = new FCSAPIChart({
    container: document.getElementById('fcs_chart'),
    parentid: 'fcs_chartparent',
    accessKey: 'YOUR_KEY',

    // Only show these tabs (key: label)
    searchModalTabs: {
        'fav': 'Fav',
        'all': 'All List',
        'forex': 'Forex',
        'crypto': 'Crypto',
        'stock': 'Stocks'
    },

    // Only allow these symbols (null = all)
    searchAllowSymbols: ['BINANCE:BTCUSDT', 'ONA:EURUSD'],

    // Hide these symbols (null = none)
    searchExcludeSymbols: ['BINANCE:DOGEUSDT']
});
Filter Tips

Whitelist Mode: Set searchAllowSymbols to a fixed list to expose only the symbols you support

Blacklist Mode: Use searchExcludeSymbols to hide specific symbols while keeping everything else

Tabs: Omit searchModalTabs (or set null) to show every category tab


Chart Features Configuration

Enable or disable specific chart features like real-time updates, drawing tools, grid lines, and price labels.

Core Features

OptionDefaultDescription
enableSockettrueWebSocket for live price updates (requires socketApiKey)
enableContextMenutrueRight-click context menu on chart
enableDrawingToolstrueEnable drawing tools functionality

Grid & Crosshair

OptionDefaultDescription
enableGridtrueShow grid lines on chart background
enableCrosshairtrueShow crosshair on mouse hover
enableCrosshairLabelstrueShow price/time labels on crosshair axes

Price Labels & Lines

OptionDefaultDescription
enablePriceLinetrueCurrent price horizontal line and label
enableCountdowntrueCountdown to the next candle, shown under the current price label
enableAskBidLinesfalseAsk/Bid price lines (requires socket connection)
enableAskPriceLabelstrueAsk price label on price axis
enableBidPriceLabelstrueBid price label on price axis
enableHighLowLabelstrueHigh/Low price labels on visible chart area

Ask / Bid Adjustment (Broker Spread)

The askBid option changes the ask and bid the chart shows, so you can display your own dealable quote instead of the raw market quote: add a spread, add a markup, or show a spread-free price. It only changes the ask/bid lines and labels, the candles are never changed. Leave it out (default null) to show the raw feed quote.

Pick one recipe and use it as the askBid option:

// Ask = ask + 10 pips, bid = bid - 10 pips (built on the market quote)
askBid: { base: 'feed', spreadPips: 10 }

// Ask = close + 10 pips, bid = close - 10 pips (ignores the market ask/bid)
askBid: { base: 'close', spreadPips: 10 }

// 1 percent on each side (percent values are a fraction of the price: 0.01 = 1%)
askBid: { base: 'feed', spreadPercent: 0.01 }

// 10 pips spread plus a 5 pips markup on both sides
askBid: { base: 'close', spreadPips: 10, markupPips: 5 }

// No spread: ask and bid sit on the same line
askBid: { base: 'close', spreadPips: 0 }

// 15 pips on BTCUSDT and 10 pips on every other symbol
askBid: {
    base: 'close',
    spreadPips: 10,
    perSymbol: { 'BINANCE:BTCUSDT': { spreadPips: 15 } }
}
FieldDefaultDescription
base'feed''feed' starts from the market ask/bid and adds your spread (the feed must send ask/bid). 'close' ignores the feed ask/bid and builds the quote around the candle close. 'raw' makes no adjustment.
spreadPips0Widens each side: 10 means ask +10 pips and bid -10 pips, so the quote is 20 pips wide. A pip follows the symbol's price scale (EURUSD 1 pip = 0.0001, BTCUSDT 1 pip = 0.01).
markupPips0Moves both sides together (rarely needed): 10 moves the whole quote up 10 pips and the gap between ask and bid stays the same.
spread / markup0The same as the pips fields, but in real price units (spread: 15 = $15). Best for crypto and other big prices.
spreadPercent / markupPercent0The same as a fraction of the price: 0.001 = 0.1%, 0.01 = 1%.
perSymbol{}Different values for specific symbols, keyed by 'EXCHANGE:SYMBOL'. They replace the top-level values for that symbol.

If the same value is given in more than one unit, the most specific wins: price, then pips, then percent. Change the rule while the chart is running with chart.setAskBid() (see API Methods).

Indicator Settings

OptionDefaultDescription
enableIndicatorLabelstrueShow indicator name labels on chart panels
enableOHLCBartrueShow OHLC values bar in top-left corner
indicatorPanelBgColornullPanel background color (null = use theme background)

Exchange Name

Hide the exchange name (BINANCE, NASDAQ, ...) when you do not want your users to see it, for example when you set a fixed symbol, allow symbols from one exchange only, or let users search but do not want the exchange shown. Use one of the two options.

OptionDefaultDescription
hideExchangeAllPlacesfalsetrue hides the exchange name everywhere: in the symbol search window (exchange name, exchange logo and the Exchange filter), in the OHLC bar and in the symbol info panel
hideExchangeInOHLCfalsetrue hides the exchange name only in the OHLC bar (top-left); the search window and the symbol info panel still show it

Scale Settings

OptionDefaultDescription
autoScaletrueAuto-scale price vertical axis to visible data
logScalefalseUse logarithmic price scale

Drawing Settings

OptionDefaultDescription
defaultMagnetModefalseSnap drawing points to candle OHLC values
Custom Colors

Customize price label colors with hex values:
askLabelColor: "#00bcd4" (cyan)
bidLabelColor: "#ff9800" (orange)
lastPriceLabelColor: null (uses candle up/down color)


Chart API Methods

Control your chart programmatically using these API methods. Change symbols, timeframes, themes, and more at runtime.

Symbol & Period

// Change symbol
chart.setSymbol('NASDAQ:AAPL');

// Change timeframe
chart.setPeriod('4H');

// Both at once
chart.setSymbol('BINANCE:ETHUSDT');
chart.setPeriod('1D');

Theme & Chart Type

// Switch theme
chart.setTheme('light');  // 'dark' | 'light'

// Change chart type
chart.setChartType('line');
// Options: candlestick, bars, line, area,
// hollow, heikin-ashi, high-low, volume-candles

Ask / Bid (spread)

// Change the spread rule while the chart is running
chart.setAskBid({ base: 'close', spreadPips: 10 });

// Different spreads per symbol, for example loaded from your own API
chart.setAskBid({ perSymbol: spreads });

// Back to the raw market quote
chart.setAskBid(null);

// Always use setAskBid(). Changing chart.options.askBid in place does not refresh the rule.

Indicators

// Add an indicator. type is the indicator name, the other fields are its inputs.
// Returns a Promise with the indicator id, or null when the type is unknown.
const id = await chart.addIndicator({ type: 'Sma', len: 20 });

// The input names are the ones in the indicator settings window, they differ per indicator:
//   Sma  len, outColor              Ema   length1, length2, length3
//   Rsi  length                     Bb    length, mult
//   Macd fast_length, slow_length, signal_length

// Remove it again
chart.removeIndicator(id);

Markers

// Put a marker on a candle: timestamp (seconds) or candle index, plus the price
chart.addMarker({ timestamp: 1791388800, price: 85200, type: 'buy', color: '#26a69a', text: 'Order 1', id: 'order-1' });

// Remove one marker by its id (or its position in the list)
chart.removeMarker('order-1');

// Remove all markers
chart.clearMarkers();

// type examples: buy, sell, long, short, entry, exit, tp, sl, arrow-up, arrow-down, star, flag

Export & Capture

// Get chart as base64 image
const imageData = chart.exportImage();

// Use the image
const img = new Image();
img.src = imageData;
document.body.appendChild(img);

// Or download
const link = document.createElement('a');
link.download = 'chart.png';
link.href = imageData;
link.click();

Resize

// Recalculate dimensions after container resize
chart.resize();

// Example: call after window resize
window.addEventListener('resize', () => {
    chart.resize();
});

JWT Token

// Only when you use the jwt_token option.
// Give the chart a fresh token, the next request uses it
chart.updateJWTtoken('new_token');

// Small example: get a new token, set it,
// and repeat shortly before it expires
async function refreshJWT() {
    // your own backend URL works here too
    const r = await (await fetch('https://api-v4.fcsapi.com/forex/jwt_token?public_key=YOUR_PUBLIC_KEY')).json();
    if (!r.status) return console.error(r.msg);
    chart.updateJWTtoken(r.response.jwt_token);
    setTimeout(refreshJWT, Math.max(10, r.response.expires_in - 30) * 1000);
}
refreshJWT();

Cleanup

// Remove chart and cleanup resources
chart.destroy();

// Important: Call this when removing chart from page
// to prevent memory leaks
Console Access

Access chart instance in browser console for debugging:
console.log(chart.engine.data.length);
console.log(chart.engine.socketManager?.getConnectionStatus());

Response Format

Response Fields

  • setSymbol(symbol) - Change the displayed symbol. Format: EXCHANGE:SYMBOL
  • setPeriod(period) - Change timeframe. Values: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W, 1M
  • setTheme(theme) - Switch between dark and light themes
  • setChartType(type) - Change chart visualization type
  • exportImage() - Returns base64-encoded PNG image of the chart
  • resize() - Recalculate chart dimensions after container resize
  • updateJWTtoken(token) - Replace the JWT token (the jwt_token option); call it before the old token expires. Not needed with publicKey + Allowed Domains
  • destroy() - Remove chart and cleanup all event listeners and resources
Best Practices:
  • Always call destroy() when removing chart from DOM
  • Call resize() after any container size changes
  • Wait for chart initialization before calling API methods
  • Symbol format must include exchange prefix (BINANCE:, NASDAQ:, FX:)

Horizontal Line API (for Brokers)

Programmatically add, update, and remove horizontal price lines on the chart. Perfect for displaying Take Profit (TP), Stop Loss (SL), and Entry price levels for trading orders.

addHorizontalLine(options)

Add a horizontal line at a specific price. Returns a Promise with the line ID:

// Add Take Profit line (async/await)
const tpLine = await chart.addHorizontalLine({
    price: 45000,
    color: '#00ff00',
    label: 'TP',
    style: 'dashed'
});

// Add Stop Loss line (Promise.then)
chart.addHorizontalLine({
    price: 42000,
    color: '#ff0000',
    label: 'SL',
    style: 'dashed'
}).then(slLine => {
    console.log('SL Line ID:', slLine);
});

// Add Entry line with all options
const entryLine = await chart.addHorizontalLine({
    price: 43500,
    color: '#2196f3',
    label: 'Entry',
    style: 'solid',        // 'solid' | 'dashed'
    lineWidth: 2,
    textPosition: 'above-left',
    textColor: '#ffffff',
    textSize: 12,
    id: 'my-entry-line'    // Optional custom ID
});

Line Options

OptionTypeDefaultDescription
priceNumber* requiredPrice level for the line
colorString#ff6d00Line color (hex)
labelString''Text label (TP, SL, Entry)
styleStringsolid'solid' or 'dashed'
lineWidthNumber2Line thickness in pixels
textPositionStringabove-centerabove-left, above-center, above-right, below-left, below-center, below-right
textColorString#ffffffLabel text color
textSizeNumber12Label font size
idStringautoCustom ID (auto-generated if not provided)

updateHorizontalLine(lineId, options)

Update an existing line (e.g., when user drags an order):

// Move TP line to new price
chart.updateHorizontalLine(tpLine, { price: 46000 });

// Change color and label
chart.updateHorizontalLine(slLine, {
    price: 41500,
    color: '#ff5722',
    label: 'SL (adjusted)'
});

removeHorizontalLine(lineId)

Remove a line (when order is filled/cancelled):

// Remove single line
chart.removeHorizontalLine(tpLine);

// Remove by custom ID
chart.removeHorizontalLine('my-entry-line');

getHorizontalLines()

Get all programmatic lines:

const lines = chart.getHorizontalLines();
console.log(lines);
// [{id: 'abc', price: 45000, color: '#00ff00', label: 'TP', ...}, ...]

clearHorizontalLines()

Remove all programmatic lines:

const count = chart.clearHorizontalLines();
console.log('Removed', count, 'lines');
Use Cases

Trading Platforms: Display pending orders on chart
Order Management: Show TP/SL levels for open positions
Alerts: Visualize price alert levels
Analysis: Mark important support/resistance levels

Response Format

Response Fields

  • addHorizontalLine(options) - Add a horizontal line, returns Promise with line ID
  • updateHorizontalLine(id, options) - Update an existing line's properties
  • removeHorizontalLine(id) - Remove a specific line by ID
  • getHorizontalLines() - Get array of all programmatic lines
  • clearHorizontalLines() - Remove all programmatic lines, returns count
Best Practices:
  • Use custom IDs to easily track and update order lines
  • Use green (#00ff00) for TP, red (#ff0000) for SL, blue (#2196f3) for Entry
  • Use dashed style for pending orders, solid for filled orders
  • Remove lines when orders are cancelled or filled
  • Update line price when order is modified

Available Chart Types

FCS Chart supports 9 different chart visualization types. Each type offers a different way to view price data, suitable for different analysis needs.

Chart Types

TypeValueDescription
CandlestickcandlestickTraditional Japanese candlesticks showing OHLC with colored bodies
Bars (OHLC)barsOHLC bars with horizontal ticks for open/close
LinelineSimple line chart connecting close prices
AreaareaLine chart with filled area below
Hollow CandleshollowHollow candlesticks - filled when close < open, hollow when close > open
Heikin-Ashiheikin-ashiModified candlesticks using averaged values to filter noise
High-Lowhigh-lowSimple bars showing only high and low prices
Volume Candlesvolume-candlesCandlesticks with width proportional to volume
RenkorenkoPrice movement bricks that filter out minor price movements

Usage

// Set default chart type on initialization
const chart = new FCSAPIChart({
    container: document.getElementById('fcs_chart'),
    parentid: 'fcs_chartparent',
    accessKey: 'YOUR_KEY',
    defaultChartType: 'candlestick'  // Set default type
});

// Change chart type at runtime
chart.setChartType('heikin-ashi');
chart.setChartType('line');
chart.setChartType('area');
Chart Type Tips

Candlestick: Best for detailed price action analysis
Heikin-Ashi: Smooths out noise, good for trend identification
Line/Area: Clean view for long-term trend analysis
Volume Candles: See volume and price together


Available Timeframes

FCS Chart supports multiple timeframes from 1 minute to 1 month, plus custom timeframes. Choose the appropriate timeframe for your analysis needs.

Supported Timeframes

CategoryValuesDescription
Minutes1m, 2m, 3m, 5m, 10m, 15m, 30mShort-term intraday trading and scalping
Hours1H, 2H, 4H, 6H, 8H, 12HDay trading and swing trading
Days1DPosition trading and long-term analysis
Weeks1WLong-term trend analysis
Months1MVery long-term investment analysis

Usage

// Set default timeframe on initialization
const chart = new FCSAPIChart({
    container: document.getElementById('fcs_chart'),
    parentid: 'fcs_chartparent',
    accessKey: 'YOUR_KEY',
    period: '1H'  // Default to 1 hour
});

// Change timeframe at runtime
chart.setPeriod('1D');  // Switch to daily
chart.setPeriod('15m'); // Switch to 15 minutes
chart.setPeriod('4H');  // Switch to 4 hours
Custom Timeframes

You can use the CUSTOM option in the UI to create custom timeframes like 7m, 25m, 3H, etc. This allows flexibility for specific trading strategies.

Scalping: Use 1m, 2m, 5m for quick trades
Day Trading: Use 15m, 30m, 1H for intraday moves
Swing Trading: Use 4H, 1D for multi-day positions
Investing: Use 1D, 1W, 1M for long-term trends


Examples You Can Download

Ready-to-run examples for clients, from a basic chart to broker spread and secure keys, and a complete page with all features.

Download the ready-to-run examples, unzip them and open any .html file in your browser. No server and no installation are needed. They run on the free chart; to use your own key, remove the // in front of accessKey in the file and paste your key. Every example uses enableCache: false, so the examples never share the saved symbol, timeframe or theme with each other.

Download Examples (ZIP)

LevelFileWhat it shows
Basic01-basic-chart.htmlThe smallest working chart: symbol, timeframe and theme.
Basic02-fixed-symbol.htmlOne symbol only, a clean read-only chart. No search, no timeframe change, no exchange name.
Basic03-symbol-search-limits.htmlChoose what your users can search: tabs, exchanges, symbols, and hide the exchange name.
Basic04-appearance.htmlFour looks made only with options: theme, chart type, grid, price lines and labels. Click a button to switch.
Basic10-static-chart-in-text.htmlA static chart (no toolbar, no tools) fixed inside the text of an article.
Basic11-line-chart-in-blog.htmlSmall line charts inside a blog post, two side by side.
Advanced05-own-controls.htmlYour own buttons control the chart: symbol, timeframe, chart type, theme and screenshot.
Advanced06-indicators-and-markers.htmlAdd and remove indicators and Buy / Sell markers from your code.
Advanced07-broker-spread.htmlShow your own Ask / Bid (spread, markup, per symbol) and change the rule live, with the numbers shown.
Advanced08-embed-in-your-page.htmlA chart inside a normal website layout, not full screen.
Advanced09-secure-keys.htmlThree ways to log in without showing your access key in the page.
Advanced12-multi-chart-one-canvas.htmlSeveral charts inside one chart (1, 2, 3 or 4 charts), each with its own symbol and timeframe.
Advanced13-multiple-charts-on-page.htmlA dashboard of four independent charts on one page.

The full list of every option and method is in this documentation. The file index.html in the live demo lists all options with a short description.

Live Examples

Try Live Demo:
• Full Featured Example - Complete implementation with all options

GitHub CDN:
• https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.js
• https://cdn.jsdelivr.net/gh/fcsapi/chart-js/src/fcsapi-chart.css

Source Code:
• GitHub Repository

Best Practices:
  • Container Height: Always set a fixed height on the parent container
  • Mobile Support: Use the mobile height fix for full-screen charts
  • API Keys: Never expose production API keys in client-side code
  • Cleanup: Call chart.destroy() when removing chart from page
  • Performance: Use displayMode: "chartonly" for embedded widgets
  • Caching: Enable enableCache for better user experience

Common Issues & Solutions

Quick solutions to common chart setup and usage issues.

Common Issues

IssueCauseSolution
Chart not visibleContainer has no heightSet explicit height on parent container (e.g., height: 600px or 100vh)
No data loadingInvalid API keyCheck your API key is valid and has chart access enabled
No live updatesSocket not connectedProvide valid socketApiKey and ensure enableSocket: true
Symbol not foundWrong symbol formatUse EXCHANGE:SYMBOL format (e.g., BINANCE:BTCUSDT not just BTCUSDT)
UI not showingdisplayMode is chartonlySet displayMode: "normal" or remove the option
Chart cut off on mobileViewport height issueUse the mobile height fix (see Installation section)
Need Help?

Contact support at support@fcsapi.com with your API key, browser console errors, and code samples for faster resolution.

Debugging Tips:
  • Check browser console (F12) for error messages
  • Verify API key in dashboard is active
  • Ensure chart container has defined dimensions
  • Test with the live demo first to verify API key works
  • Check network tab for failed API requests
  • Use console.log(chart.engine) to inspect chart state

Terms & Disclaimer

Important legal information about chart data usage, accuracy, and limitations.

Data Accuracy

Chart data is sourced from multiple exchanges and liquidity providers. While we strive for accuracy, data may not be 100% accurate or suitable for high-frequency trading decisions.

Trading Disclaimer

Charts, indicators, and signals displayed are for informational and educational purposes only. They are NOT intended as trading advice. We bear NO responsibility for any trading losses incurred from using this chart library.

Technical Indicators

All technical indicators are mathematical calculations based on historical price data. Past performance does not guarantee future results. Always use multiple sources of analysis.

Important Notice

Always consult licensed financial advisors before making investment decisions. This chart library is a tool for visualization, not a substitute for professional financial advice.

Key Points:
  • Chart data is for informational purposes only
  • Not suitable as sole basis for trading decisions
  • Prices may differ from actual market prices
  • No liability for trading losses or missed opportunities
  • Technical indicators are tools, not guarantees
  • Always verify data with official exchange sources
By using the FCS Chart Library, you agree to our Terms of Service and Privacy Policy.