/ferrochart:ferrochartfrom ferrochart
Build and fix FerroChart charts across JavaScript/TypeScript, React, Vue, Python/Jupyter, Rust desktop, and C ABI integrations. Use for adding charts, indicators, drawings, or migrating from lightweight-charts.
Ships in ferrochart. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use the API for the installed package and the user's platform. Start with the relevant reference below; consult the installed declarations before adding an option not shown here. Do not substitute another chart library's API.
| Target | Install / entry point | Read when needed |
|---|---|---|
| Web / TypeScript | npm install @ferrochart/core | JS API, recipes |
| React / Vue | Same package; create after mount, release on unmount | Framework lifecycle, framework guide |
| Python / image files | pip install ferrochart | Python |
| Jupyter | pip install "ferrochart[jupyter]" | Python |
| Rust desktop | ferrochart-core and ferrochart-winit | Rust |
| C / C++ / C# | ferrochart-ffi and ferrochart.h | C ABI |
For a new web integration use the native @ferrochart/core API. For an existing
lightweight-charts application, read the migration guide
before choosing the separate @ferrochart/core/lightweight-charts compatibility
entry. Its times and methods differ from the native API.
After installing the package, run this TypeScript module in a browser application whose bundler resolves npm imports. A bare browser needs an import map or a resolved module URL. No framework wrapper is required.
import { FerroChart } from '@ferrochart/core';
const canvas = document.createElement('canvas');
canvas.style.cssText = 'display:block;width:100%;height:400px';
document.body.append(canvas);
const chart = await FerroChart.create(canvas, { theme: 'dark' });
const candles = chart.addCandlestickSeries();
chart.addVolumeSeries(candles);
const start = Date.UTC(2024, 0, 1);
candles.setData({
time: [start, start + 60_000, start + 120_000],
open: [100, 102, 101],
high: [103, 104, 105],
low: [99, 100, 100],
close: [102, 101, 104],
volume: [120, 90, 150],
});
chart.addIndicator(candles, 'sma', { n: 2 });
// The last timestamp replaces that bar; a later timestamp appends a bar.
candles.update({
time: start + 180_000, open: 104, high: 106, low: 103,
close: 105, volume: 180,
});
chart.fitContent();
function dispose() {
chart.destroy();
canvas.remove();
}
// Call dispose() when this view is removed.
Create the chart in useEffect (React) or onMounted (Vue), after the canvas
exists. Keep the chart and series across data changes: load a new data set with
setData, and feed live bars with update. Do not recreate on every tick.
Clean up in the effect return or onBeforeUnmount. Creation is asynchronous:
if the component unmounts before it resolves, destroy the late result too.
In SSR applications, run creation only on the client. See the
JS reference for lifecycle guidance.
This self-contained script writes an image; NumPy is used for typed columns.
import numpy as np
import ferrochart as fc
chart = fc.Chart(theme="dark", width=800, height=400)
candles = chart.add_series("candlestick")
candles.set_data({
"time": np.array([1704067200000, 1704067260000], dtype=np.int64),
"open": np.array([100, 102], dtype=np.float64),
"high": np.array([103, 104], dtype=np.float64),
"low": np.array([99, 100], dtype=np.float64),
"close": np.array([102, 101], dtype=np.float64),
"volume": np.array([120, 90], dtype=np.float64),
})
chart.add_volume_series(candles)
chart.to_png("chart.png")
For a native window, call chart.show(). In a notebook with the Jupyter extra,
use chart as the last expression of a cell or use chart.widget().
Python's appearance options such as preset, appearance and crosshair_style
require ferrochart >= 0.6.0; do not assume a wheel has them just because the
web package does. Check the installed version and available signatures. See
Python for data frames, updates and version boundaries.
Add these dependencies to the application's Cargo.toml:
[dependencies]
ferrochart-core = "0.6"
ferrochart-winit = "0.6"
Use this as src/main.rs:
use ferrochart_core::data::OhlcColumns;
use ferrochart_core::{Chart, ChartOptions};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut chart = Chart::new(ChartOptions::default());
let candles = chart.add_candlestick()?;
chart.set_data(candles, OhlcColumns {
time: vec![1704067200000, 1704067260000],
open: vec![100.0, 102.0], high: vec![103.0, 104.0],
low: vec![99.0, 100.0], close: vec![102.0, 101.0],
volume: None,
})?;
ferrochart_winit::show(chart)?;
Ok(())
}
Run with cargo run --release. Rust owns the chart through normal ownership;
there is no JavaScript destroy() call here. For live updates and indicators,
use the Rust reference.
From a FerroChart source checkout, build the library with
cargo build -p ferrochart-ffi --release; use its matching ferrochart.h.
The native reference contains a complete C program
with real OHLC data, RGBA rendering, error checks, cleanup and a link command.
Use that program as the minimum integration before wiring a window handle or
language binding. C++ and C# call the same C ABI.
Initialize each options struct's size to sizeof that struct, check status
codes with FERROCHART_OK, and read ferrochart_last_error() on failure.
Release charts with ferrochart_destroy. Free owned char * results with
ferrochart_free_string; do not free borrowed const char * values such as
ferrochart_last_error(). Keep one chart on one thread; window rendering on macOS
uses the main thread. Do not translate JS option objects directly into C structs.
addVolumeSeries(source); the volume is derived
from its volume column.setData replaces a series' data. Columnar data has equal-length columns and
strictly increasing UTC millisecond timestamps. JS also accepts row arrays;
columnar typed arrays are useful for large inputs. Do not pass Unix seconds to
the native API.addPane() returns an id;
pass it as the pane argument when adding a series. An indicator uses its
default placement unless an explicit placement is supplied.addIndicator(source, name, params, placement) maintains output series when
source data changes. Read parameter names from the
indicator guide; a lookback uses n
for SMA, not a guessed period option.chart.destroy() when
removing the view; pool.destroy() releases every chart created by that pool.| Task | Native web API / reference |
|---|---|
| Candles + volume + moving average | Complete example above |
| Realtime candles or single values | Keep the series, call series.update(...); data guide |
| Oscillator in another pane | chart.addIndicator(candles, 'rsi'); JS API |
| Theme and app-style quote card | theme, priceAxis, timeAxis, grid, padding, crosshairStyle; recipes |
| A table of small charts | Initialize WebAssembly, then FerroChart.createPool() and pool.create(canvas, { preset: 'sparkline' }); recipes |
| Export an image | await chart.toBlob() or await chart.toImageBitmap(); recipes |
| Sync charts | After creation, new SyncGroup() and chart.joinSync(group); recipes |
| Markers or drawing tools | Markers, drawings; check event payloads before using them |
await FerroChart.create(canvas, options), not
createChart(container). Native viewport fitting is chart.fitContent(), not
chart.timeScale().fitContent(). The latter forms belong to the compatibility
entry; do not mix the imports.rgb(), rgba() or transparent colors. Named colors such as red,
hsl() and percentages are rejected. Native candle up color is color, not
the compatibility entry's upColor.update replaces the last bar or appends a later one. It is not an arbitrary
historical-row editor. Do not recreate a chart or reload its full history for
each live tick.series.dataAt(index) can return OHLC data, { value: number }, or null.
Narrow with a null check and 'open' in data / 'value' in data before reading
those fields. Indicator warm-up values may be NaN.new SyncGroup() and pool-first startup need initialized WebAssembly. Create
a chart first, or call the package's default init() export before them.Load only the reference relevant to the requested platform or task: JS API, recipes, Python, Rust, C ABI.
For a missing method or option, use the installed type declarations and the generated JS API reference. llms.txt is the guide and API index; llms-full.txt contains the English guide and example catalog. Prefer the relevant chapter over loading the full text for every task. Installation explains how to add this skill to an assistant.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
TypeScript, JavaScript, React, Vue, Python, Rust
ferrochart, charting, financial-charts, candlestick, cross-platform
npx claudepluginhub 0x0077/ferrochart --plugin ferrochartOther plugins' skills for the same job