npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ngx-apexstock

v0.2.1

Published

Angular component wrapper for ApexStock (financial charting on top of ApexCharts)

Downloads

407

Readme

ngx-apexstock

Angular component wrapper for ApexStock — financial charting (candlesticks, indicators, drawing tools) built on top of ApexCharts.

A thin, typed standalone component around the imperative ApexStock class: it creates the instance after the view initializes, forwards input changes to update(), and tears it down on destroy.

Install

npm install ngx-apexstock apexstock apexcharts

apexcharts, apexstock, @angular/core, and @angular/common are peer dependencies. ApexCharts must be available as a global, the same way the core library expects.

Usage

ApexStockComponent is standalone — import it directly:

import { Component } from "@angular/core";
import { ApexStockComponent } from "ngx-apexstock";

@Component({
  selector: "app-price",
  standalone: true,
  imports: [ApexStockComponent],
  template: `<apex-stock [options]="options" [series]="series"></apex-stock>`,
})
export class PriceComponent {
  options = { chart: { height: 420 }, theme: { mode: "light" as const } };
  series = [{ name: "Price", data: [] as { x: number; y: number[] }[] }];
}

Using NgModules? Add ApexStockComponent to the module's imports (standalone components are importable into modules).

OHLC points use the ApexStock shape { x, y: [open, high, low, close], v }.

Inputs

| Input | Type | Description | | --- | --- | --- | | options | StockChartOptions | Full chart options (the 2nd arg to new ApexStock). Required. | | series | StockChartOptions["series"] | Convenience: overrides options.series. |

Updates fire when an input changes via Angular change detection. Assign a new object/array reference (rather than mutating in place) to trigger an update.

Accessing the instance

@Component({
  standalone: true,
  imports: [ApexStockComponent],
  template: `
    <button (click)="addRSI()">Add RSI</button>
    <apex-stock #chart [options]="options"></apex-stock>
  `,
})
export class ChartComponent {
  @ViewChild("chart") chart!: ApexStockComponent;
  addRSI() {
    this.chart.getInstance()?.updateIndicator("rsi");
  }
}
  • getInstance() → the live ApexStock instance (call any method: update, updateIndicator, updateTheme, export, …), or null before view init.
  • getElement() → the container <div>.

Live demo

A runnable demo lives in demo/: a small standalone Angular app (Vite + @analogjs/vite-plugin-angular) that consumes the built ngx-apexstock package and drives the real ApexStock core (the unit tests mock the core, this does not). Unlike the React/Vue demos it needs its own install, because Angular's partial-Ivy output must be compiled/linked by a real build:

npm run build                       # build the wrapper -> dist/ (consumed by the demo)
(cd ../.. && npm run build)         # build the core -> dist/
cd demo && npm install && npm run dev
# http://localhost:5199/

SSR

The component renders only a container <div> on the server; the chart is created in a client-only ngAfterViewInit. (The core apexstock package is import-safe in Node, but rendering needs a DOM.)