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.

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.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.
• 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
- 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'
});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);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
- 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
| Option | Type | Description |
|---|---|---|
container | Element | *required Chart container DOM element |
parentid | String | *required Parent container ID for toolbar/sidebar positioning |
accessKey | String | *required Your FCS API access key |
socketApiKey | String | optional WebSocket API key for live price updates |
publicKey | String | optional 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_token | String | optional 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) |
socketUrl | String | optional Custom WebSocket server URL (e.g. ws://localhost:4001/ws) |
url_params | Object | optional 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
| Option | Type | Default | Description |
|---|---|---|---|
symbol | String | BINANCE:BTCUSDT | Default symbol to load (format: EXCHANGE:SYMBOL) |
period | String | 1D | Default timeframe: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W, 1M |
length | Number | 600 | Number of candles to load (max depends on API plan; the free key always loads 300) |
enableCache | Boolean | true | Cache user's last symbol/period/settings in localStorage |
changeURL | Boolean | false | Update browser URL with symbol/period (shareable links) |
Display Mode
| Option | Type | Default | Description |
|---|---|---|---|
displayMode | String | normal | normal = full UI with toolbar/sidebar | chartonly = hide all UI, show only chart |
Appearance
| Option | Type | Default | Description |
|---|---|---|---|
theme | String | light | dark | light |
defaultChartType | String | candlestick | candlestick | bars | line | area | hollow | heikin-ashi | high-low | volume-candles |
timezone | String | local | local | UTC | +05:00 | -08:00 etc. |
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
| Option | Default | Description |
|---|---|---|
enableSidebar | true | Left sidebar with drawing tools (trend lines, fibonacci, shapes, etc.) |
enableToolbar | true | Top toolbar with all controls (search, indicators, settings, etc.) |
enableRangeSelector | true | Bottom time range selector bar for quick navigation |
Toolbar Controls
| Option | Default | Description |
|---|---|---|
enableSearch | true | Symbol search button and search panel |
enableIndicators | true | Indicators button and indicator selection panel |
enableMultiChart | true | Multi-chart layouts button (1/2/3/4 charts) |
enableReplay | true | Replay mode button for backtesting |
enableCapture | true | Screenshot/export button |
enableUndoRedo | true | Undo/Redo buttons (also Ctrl+Z, Ctrl+Y) |
enableTemplates | true | Template save/load functionality |
enableSettings | true | Settings gear button for chart preferences |
enableSymbolInfo | true | Symbol info button (shows profile/stats) |
enableChartTypeSelector | true | Chart type dropdown selector in toolbar |
enableTimeframeSelector | true | Timeframe/period dropdown selector in toolbar |
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
| Option | Type | Default | Description |
|---|---|---|---|
searchModalTabs | Object | null | Only show these tabs in the search modal (null = show all). Keys map to a display label. |
searchAllowSymbols | Array | null | Only these symbols appear in search results (null = all allowed) |
searchExcludeSymbols | Array | null | Hide these symbols from search results (null = none hidden) |
searchAllowExchanges | Object | null | Limit 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:
| Key | Category |
|---|---|
fav | Favorites |
all | All List |
forex | Forex |
crypto | Crypto |
commodity | Commodity |
stock | Stocks |
dr | Depositary Receipts |
fund | Funds |
futures | Futures |
indices | Indices |
dex | Dex |
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']
});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
| Option | Default | Description |
|---|---|---|
enableSocket | true | WebSocket for live price updates (requires socketApiKey) |
enableContextMenu | true | Right-click context menu on chart |
enableDrawingTools | true | Enable drawing tools functionality |
Grid & Crosshair
| Option | Default | Description |
|---|---|---|
enableGrid | true | Show grid lines on chart background |
enableCrosshair | true | Show crosshair on mouse hover |
enableCrosshairLabels | true | Show price/time labels on crosshair axes |
Price Labels & Lines
| Option | Default | Description |
|---|---|---|
enablePriceLine | true | Current price horizontal line and label |
enableCountdown | true | Countdown to the next candle, shown under the current price label |
enableAskBidLines | false | Ask/Bid price lines (requires socket connection) |
enableAskPriceLabels | true | Ask price label on price axis |
enableBidPriceLabels | true | Bid price label on price axis |
enableHighLowLabels | true | High/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 } }
}| Field | Default | Description |
|---|---|---|
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. |
spreadPips | 0 | Widens 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). |
markupPips | 0 | Moves both sides together (rarely needed): 10 moves the whole quote up 10 pips and the gap between ask and bid stays the same. |
spread / markup | 0 | The same as the pips fields, but in real price units (spread: 15 = $15). Best for crypto and other big prices. |
spreadPercent / markupPercent | 0 | The 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
| Option | Default | Description |
|---|---|---|
enableIndicatorLabels | true | Show indicator name labels on chart panels |
enableOHLCBar | true | Show OHLC values bar in top-left corner |
indicatorPanelBgColor | null | Panel 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.
| Option | Default | Description |
|---|---|---|
hideExchangeAllPlaces | false | true 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 |
hideExchangeInOHLC | false | true hides the exchange name only in the OHLC bar (top-left); the search window and the symbol info panel still show it |
Scale Settings
| Option | Default | Description |
|---|---|---|
autoScale | true | Auto-scale price vertical axis to visible data |
logScale | false | Use logarithmic price scale |
Drawing Settings
| Option | Default | Description |
|---|---|---|
defaultMagnetMode | false | Snap drawing points to candle OHLC values |
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-candlesAsk / 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, flagExport & 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 leaksAccess 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:SYMBOLsetPeriod(period)- Change timeframe. Values: 1m, 5m, 15m, 30m, 1H, 4H, 1D, 1W, 1MsetTheme(theme)- Switch between dark and light themessetChartType(type)- Change chart visualization typeexportImage()- Returns base64-encoded PNG image of the chartresize()- Recalculate chart dimensions after container resizeupdateJWTtoken(token)- Replace the JWT token (the jwt_token option); call it before the old token expires. Not needed with publicKey + Allowed Domainsdestroy()- Remove chart and cleanup all event listeners and resources
- 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
| Option | Type | Default | Description |
|---|---|---|---|
price | Number | * required | Price level for the line |
color | String | #ff6d00 | Line color (hex) |
label | String | '' | Text label (TP, SL, Entry) |
style | String | solid | 'solid' or 'dashed' |
lineWidth | Number | 2 | Line thickness in pixels |
textPosition | String | above-center | above-left, above-center, above-right, below-left, below-center, below-right |
textColor | String | #ffffff | Label text color |
textSize | Number | 12 | Label font size |
id | String | auto | Custom 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');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 IDupdateHorizontalLine(id, options)- Update an existing line's propertiesremoveHorizontalLine(id)- Remove a specific line by IDgetHorizontalLines()- Get array of all programmatic linesclearHorizontalLines()- Remove all programmatic lines, returns count
- 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
| Type | Value | Description |
|---|---|---|
| Candlestick | candlestick | Traditional Japanese candlesticks showing OHLC with colored bodies |
| Bars (OHLC) | bars | OHLC bars with horizontal ticks for open/close |
| Line | line | Simple line chart connecting close prices |
| Area | area | Line chart with filled area below |
| Hollow Candles | hollow | Hollow candlesticks - filled when close < open, hollow when close > open |
| Heikin-Ashi | heikin-ashi | Modified candlesticks using averaged values to filter noise |
| High-Low | high-low | Simple bars showing only high and low prices |
| Volume Candles | volume-candles | Candlesticks with width proportional to volume |
| Renko | renko | Price 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');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
| Category | Values | Description |
|---|---|---|
| Minutes | 1m, 2m, 3m, 5m, 10m, 15m, 30m | Short-term intraday trading and scalping |
| Hours | 1H, 2H, 4H, 6H, 8H, 12H | Day trading and swing trading |
| Days | 1D | Position trading and long-term analysis |
| Weeks | 1W | Long-term trend analysis |
| Months | 1M | Very 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 hoursYou 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.
| Level | File | What it shows |
|---|---|---|
| Basic | 01-basic-chart.html | The smallest working chart: symbol, timeframe and theme. |
| Basic | 02-fixed-symbol.html | One symbol only, a clean read-only chart. No search, no timeframe change, no exchange name. |
| Basic | 03-symbol-search-limits.html | Choose what your users can search: tabs, exchanges, symbols, and hide the exchange name. |
| Basic | 04-appearance.html | Four looks made only with options: theme, chart type, grid, price lines and labels. Click a button to switch. |
| Basic | 10-static-chart-in-text.html | A static chart (no toolbar, no tools) fixed inside the text of an article. |
| Basic | 11-line-chart-in-blog.html | Small line charts inside a blog post, two side by side. |
| Advanced | 05-own-controls.html | Your own buttons control the chart: symbol, timeframe, chart type, theme and screenshot. |
| Advanced | 06-indicators-and-markers.html | Add and remove indicators and Buy / Sell markers from your code. |
| Advanced | 07-broker-spread.html | Show your own Ask / Bid (spread, markup, per symbol) and change the rule live, with the numbers shown. |
| Advanced | 08-embed-in-your-page.html | A chart inside a normal website layout, not full screen. |
| Advanced | 09-secure-keys.html | Three ways to log in without showing your access key in the page. |
| Advanced | 12-multi-chart-one-canvas.html | Several charts inside one chart (1, 2, 3 or 4 charts), each with its own symbol and timeframe. |
| Advanced | 13-multiple-charts-on-page.html | A 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.
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
- 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
| Issue | Cause | Solution |
|---|---|---|
| Chart not visible | Container has no height | Set explicit height on parent container (e.g., height: 600px or 100vh) |
| No data loading | Invalid API key | Check your API key is valid and has chart access enabled |
| No live updates | Socket not connected | Provide valid socketApiKey and ensure enableSocket: true |
| Symbol not found | Wrong symbol format | Use EXCHANGE:SYMBOL format (e.g., BINANCE:BTCUSDT not just BTCUSDT) |
| UI not showing | displayMode is chartonly | Set displayMode: "normal" or remove the option |
| Chart cut off on mobile | Viewport height issue | Use the mobile height fix (see Installation section) |
Contact support at support@fcsapi.com with your API key, browser console errors, and code samples for faster resolution.
- 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.
Always consult licensed financial advisors before making investment decisions. This chart library is a tool for visualization, not a substitute for professional financial advice.
- 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
