mrkeyoor.com_
Wed 23 Sept 00:37 UTC
npmWeb Frontendupdated 22 Sept 2026

ag-charts-types review

Our sandbox showed what the package name hides: ag-charts-types 14.1.0 is AG Charts' shared TypeScript surface, not a chart renderer. Its declarations cover chart options, series, axes, themes, events, callbacks, state, and chart instances used by the Community and Enterprise products. The install added 864 KB of package data and its browser entry bundled to 0.4 KB minified because almost everything disappears after type checking. You still need ag-charts-community or ag-charts-enterprise for AgCharts.create, canvas rendering, and framework integrations.

Verdict

ag-charts-types 14.1.0 installed in 0.7 seconds and bundled to 0.4 KB minified in our sandbox because it supplies contracts, not charts. Add it directly for wrapper boundaries; ordinary apps should install the matching AG Charts renderer and receive these types through that dependency.

We installed it

Lab card: what happened when we installed ag-charts-typesScreenshot of ag-charts-types documentation
Install✓ · 0.7s1 package on disk · 1 MB
ImportESM import works · require() works · CommonJS package with exports map
Browser0.3 KBgzipped (0.4 KB minified), bundled with esbuild
TypesTypeScript types bundled
Known vulns00 critical · 0 high · 0 moderate · 0 low (npm audit)

Answers from our run

Does ag-charts-types install cleanly?

Yes. In a fresh container with an empty cache, npm install ag-charts-types finished in 0.7s, leaving 1 package and 1 MB on disk. npm audit reported no known vulnerabilities.

How much does ag-charts-types add to a browser bundle?

0.3 KB gzipped (0.4 KB minified) when the whole package is bundled for the browser with esbuild. Importing only part of it is usually smaller.

Does ag-charts-types work with both ESM and CommonJS?

Yes. Both import 'ag-charts-types' and require('ag-charts-types') worked in Node 22 in our run. The package is published as CommonJS with an exports map.

Does ag-charts-types include TypeScript types?

Yes, type declarations ship inside the package, so no @types install is needed.

ag-charts-types or ag-charts-community: which should you use?

ag-charts-community: Choose it when the application must render MIT-licensed AG Charts series and should receive matching declarations transitively. ag-charts-types 14.1.0 installed in 0.7 seconds and bundled to 0.4 KB minified in our sandbox because it supplies contracts, not charts.

When should you not use ag-charts-types?

You want a chart on screen: version 14.1.0 exposes declarations and two tooltip enums, but no AgCharts.create implementation or canvas renderer

API stability2/5Version 14.1.0 exposes a wide declaration graph that follows the renderer's full option model, so renderer changes become type changes. The registry shows majors 10, 11, 12, 13, and 14 between July 2024 and June 2026. In the current major, cartesian axes use a keyed object instead of the array used by older examples. ag-charts-community also pins this package exactly, evidence that cross-version compatibility is not promised.
Docs3/5The 14.1.0 declaration files contain comments, documented defaults, generic parameters, callback shapes, and links into the AG Charts feature documentation. The package-level README is much less precise: it describes the full canvas charting product even though this tarball has no renderer. It does not clearly tell an application developer to install ag-charts-community or explain why all AG Charts packages need matching versions.
Maintenance5/5The repository was pushed on August 26, 2026, and version 14.1.0 is the current npm release. AG Grid maintains the types inside the same ag-grid/ag-charts monorepo as core, locale, Community, Enterprise, and framework packages. That first-party release process keeps declarations close to implementation work, while 32 open issues and pull requests belong to the whole charting repository rather than this small package alone.
Ecosystem4/5npm recorded 3,399,534 downloads in the measured week, and every installation of ag-charts-community 14.1.0 receives this exact package transitively. React, Angular, Vue, AG Grid, Community, and Enterprise integrations all consume the same contracts. The reach is substantial, but it should not be read as 3.4 million developers choosing a standalone types library because most installations arrive through the renderer packages.

Use it if

  • You maintain a TypeScript wrapper that exposes AG Charts option types while leaving the renderer to the consuming application
  • Your shared package needs typed chart data, event payloads, callback context, themes, or chart-instance contracts
  • You are building an AG Grid or AG Charts integration that must speak the same type language as both runtime editions
  • You can pin this package to the exact version of the AG Charts runtime used by the final application
Skip it if

Setup reality

Our clean Node 22 install of ag-charts-types 14.1.0 finished in 0.7 seconds. It left 1 package and 1 MB on disk, with 0 direct dependencies, 0 peer dependencies, and 0 audit findings. The published tarball is 864 KB unpacked, carries an MIT license, and includes TypeScript declarations. Both require() and ESM import worked through the package's exports map.

No credentials, stylesheet, native compiler, code generator, or configuration file is involved. For an application, install ag-charts-community instead because it already requests the matching type package. A wrapper can depend on ag-charts-types directly, but it should make the renderer version an explicit compatibility decision. Version 14.1.0 types paired with an older runtime can accept an option that the installed renderer does not implement.

Use import type for declarations. Our esbuild probe produced only 0.4 KB minified and 0.3 KB gzipped when importing the whole package, yet the JavaScript is not completely empty: AgTooltipAnchorToType and AgTooltipPlacementType are runtime enum values and need an ordinary import. The separate ag-charts-types/scene export exposes lower-level scene contracts through the same exports map.

The first visible failure is usually a blank expectation, not an exception: this package has no rendering API. Version 14 also changed cartesian axes to an object keyed by x, y, or custom IDs, so an axes: [] example from an older major fails during type checking. Enterprise-only declarations compile here, but the corresponding runtime behavior still requires ag-charts-enterprise and its commercial terms.

Patterns

Install one coordinated 14.1.0 pair install-matching-runtime

npm install ag-charts-community@14.1.0 ag-charts-types@14.1.0

ag-charts-community 14.1.0 already requests this exact types release. Declare both only when your package boundary imports these names itself.

Check options here and render elsewhere type-basic-chart

import { AgCharts } from 'ag-charts-community';
import type { AgChartOptions } from 'ag-charts-types';

type Sale = { month: string; revenue: number };

const options: AgChartOptions<Sale> = {
  container: document.querySelector('#chart'),
  data: [
    { month: 'Jan', revenue: 42 },
    { month: 'Feb', revenue: 57 },
  ],
  series: [{ type: 'line', xKey: 'month', yKey: 'revenue' }],
};

AgCharts.create(options);

AgChartOptions validates the object at compile time. The AgCharts.create function in this example is provided by ag-charts-community.

Keep the line discriminator narrow preserve-series-literals

import type { AgLineSeriesOptions } from 'ag-charts-types';

type Sale = { month: string; revenue: number };

const revenueSeries = {
  type: 'line',
  xKey: 'month',
  yKey: 'revenue',
  yName: 'Revenue',
  marker: { enabled: true },
} satisfies AgLineSeriesOptions<Sale>;

The satisfies check preserves type: 'line' as a literal while verifying that xKey and yKey name fields on Sale.

Define axes with the version 14 object form configure-v14-axes

import type { AgCartesianChartOptions } from 'ag-charts-types';

type Sale = { month: string; revenue: number };

const axes: AgCartesianChartOptions<Sale>['axes'] = {
  x: { type: 'category', position: 'bottom' },
  y: {
    type: 'number',
    position: 'left',
    label: { format: '$,.0f' },
  },
};

The 14.1.0 declaration expects axes keyed by x, y, or a custom ID. An array copied from older documentation is rejected.

Describe one member of a stacked bar type-bar-series

import type { AgBarSeriesOptions } from 'ag-charts-types';

type Quarter = { quarter: string; product: number; services: number };

const product: AgBarSeriesOptions<Quarter> = {
  type: 'bar',
  xKey: 'quarter',
  yKey: 'product',
  yName: 'Product',
  stacked: true,
  stackGroup: 'revenue',
};

In 14.1.0, stacked and stackGroup place this series in a stack. The declaration says normalizedTo does nothing when grouped is true.

Return structured line-tooltip data type-tooltip-renderer

import type {
  AgLineSeriesOptions,
  AgLineSeriesTooltipRendererParams,
} from 'ag-charts-types';

type Sale = { month: string; revenue: number };

const renderer = ({ datum }: AgLineSeriesTooltipRendererParams<Sale>) => ({
  title: datum.month,
  data: [{ label: 'Revenue', value: `$${datum.revenue}` }],
});

const series: AgLineSeriesOptions<Sale> = {
  type: 'line', xKey: 'month', yKey: 'revenue',
  tooltip: { renderer },
};

The line renderer result accepts a title and data rows in version 14. Returning a DOM element does not match this series result type.

Carry the row type into click events type-chart-listener

import type { AgNodeClickEvent } from 'ag-charts-types';

type Sale = { id: string; month: string; revenue: number };

function onSaleClick(
  event: AgNodeClickEvent<'seriesNodeClick', Sale>,
) {
  console.log(event.datum.id, event.seriesId, event.itemId);
}

AgNodeClickEvent exposes the typed datum plus seriesId and itemId. Set dataIdKey when item identity must survive chart updates.

Type application state passed to callbacks type-callback-context

import type { AgChartOptions } from 'ag-charts-types';

type Sale = { month: string; revenue: number };
type AppContext = { currency: string };

const options: AgChartOptions<Sale, AppContext> = {
  data: [{ month: 'Jan', revenue: 42 }],
  context: { currency: 'USD' },
  series: [{
    type: 'line', xKey: 'month', yKey: 'revenue',
    tooltip: {
      renderer: ({ datum, context }) =>
        `${context?.currency} ${datum.revenue}`,
    },
  }],
};

The second AgChartOptions generic controls callback context. The callback still sees context as optional, even when this options object supplies it.

Validate a custom palette before runtime type-custom-theme

import type { AgChartTheme } from 'ag-charts-types';

const theme: AgChartTheme = {
  baseTheme: 'ag-default-dark',
  palette: {
    fills: ['#5b8ff9', '#61d9a5', '#f6bd16'],
    strokes: ['#ffffff'],
  },
};

A supplied palette replaces the base palette entries. Include enough fill colors for the number of concurrent series you expect.

Type the owner of an AG Charts instance type-chart-instance

import type {
  AgChartOptions,
  AgTypedChartInstance,
} from 'ag-charts-types';

type Sale = { month: string; revenue: number };
type SaleOptions = AgChartOptions<Sale>;
type SaleChart = AgTypedChartInstance<Sale, unknown, SaleOptions>;

async function replaceChart(chart: SaleChart, options: SaleOptions) {
  await chart.update(options);
  await chart.waitForUpdate();
}

update consumes a complete options object and returns a promise. Use updateDelta for partial changes and waitForUpdate before code that depends on the redraw.

Import the two values that survive compilation use-runtime-enums

import {
  AgTooltipAnchorToType,
  AgTooltipPlacementType,
} from 'ag-charts-types';
import type { AgChartTooltipOptions } from 'ag-charts-types';

const tooltip: AgChartTooltipOptions = {
  position: {
    anchorTo: AgTooltipAnchorToType.NODE,
    placement: [
      AgTooltipPlacementType.TOP,
      AgTooltipPlacementType.BOTTOM,
    ],
  },
};

AgTooltipAnchorToType and AgTooltipPlacementType are real JavaScript exports in 14.1.0. import type would erase them.

Compile a Sankey contract without granting a license recognize-enterprise-types

import type { AgSankeySeriesOptions } from 'ag-charts-types';

type Link = { from: string; to: string; amount: number };

const flow: AgSankeySeriesOptions<Link> = {
  type: 'sankey',
  fromKey: 'from',
  toKey: 'to',
  sizeKey: 'amount',
};

AgSankeySeriesOptions exists in the shared declarations, while the repository's feature table assigns Sankey rendering to ag-charts-enterprise.

Alternatives

PackageRegistryPick it when
ag-charts-communitynpmChoose it when the application must render MIT-licensed AG Charts series and should receive matching declarations transitively
chart.jsnpmChoose it when you want a canvas renderer and its TypeScript contract in one widely used package
echartsnpmChoose it for a broader built-in chart catalog without separating the public types from the rendering package
rechartsnpmChoose it when a React component API fits the codebase better than a framework-neutral options object

More web frontend guides

postcss · react · react-dom · tailwindcss · htmlparser2 · tailwind-merge · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.