Skip to content

Installation

Install the library, then verify it works with a minimal chart. The full step-by-step lives in Quick start.

Prerequisites

  • Node.js 24+ for tooling
  • A modern browser (ES2020, Canvas API, fetch)

Install

bash
npm install @facioquo/indy-charts chart.js chartjs-plugin-annotation
bash
pnpm add @facioquo/indy-charts chart.js chartjs-plugin-annotation
bash
yarn add @facioquo/indy-charts chart.js chartjs-plugin-annotation

chart.js and chartjs-plugin-annotation are peer dependencies. Date utilities are bundled — you do not need a separate date library.

First chart (verify)

Render a candlestick + volume chart against your API to confirm everything is wired up. Replace https://api.example.com with your stock-charts WebApi URL.

html
<canvas id="overlay-chart" style="height:400px"></canvas>
typescript
import {
  createApiClient,
  OverlayChart,
  setupIndyCharts
} from "@facioquo/indy-charts";

setupIndyCharts();

const client = createApiClient({ baseUrl: "https://api.example.com" });
const quotes = await client.getQuotes();

const canvas = document.getElementById("overlay-chart") as HTMLCanvasElement;
const chart = new OverlayChart(canvas, {
  isDarkTheme: false,
  showTooltips: true,
  showRightAxisLabels: true // Optional: set to false to hide right-axis tick labels
});
chart.render(quotes.slice(-250));

If the chart renders, you're set. If not, check the browser console — most errors are missing peer deps or a wrong API URL.

What you get

ModulePurpose
ChartManager, OverlayChart, OscillatorChartHigh-level chart classes
createApiClientTyped REST client for quotes + indicators
loadStaticQuotes, loadStaticIndicatorDataUse your own data, no API needed
Quote, IndicatorDataRow (types)Single source of truth shapes — timestamp accepts ISO string or Date
setupIndyCharts, setupIndyChartsForVueOne-time registration of Chart.js controllers
getThemeColors, getFinancialPaletteTheme + candlestick color helpers

TypeScript definitions ship in the package — no @types/ install required.

Next steps