# dygraphs

> dygraphs is a fast, flexible open source JavaScript charting library.

Latest version **2.2.2** (published 2026-07-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install dygraphs
pnpm add dygraphs
yarn add dygraphs
bun add dygraphs
```

## Health

**Score 63/100 (C)** — status: active.

Positive: has types package; esm support; no vulnerabilities; recently updated; high quality score.

Warnings: low downloads; large bundle.

## Facts

| | |
|---|---|
| Version | 2.2.2 |
| Published | 2026-07-27 |
| First published | 2014-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/dygraphs) |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3242 |
| Author | Dan Vanderkam |
| Maintainers | danvk, cryptoquick, mirabilos, jaredscheib, lukevmorris |
| Keywords | canvas, chart, graph, javascript, timeseries, visualisation, visualization, dygraphs |

## Links

- npm: https://www.npmjs.com/package/dygraphs
- Repository: https://github.com/danvk/dygraphs
- Homepage: https://dygraphs.com/
- Issues: https://github.com/danvk/dygraphs/issues
- npm.io page: https://npm.io/package/dygraphs

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 2.2.2 (latest) — 2026-07-27
- 2.1.2 (next) — 2022-12-15
- 2.2.1 — 2023-02-16
- 2.2.0 — 2023-01-25
- 2.1.2-alpha.1 — 2022-12-08
- 2.1.0 — 2017-12-08
- 2.0.0 — 2017-01-11
- 2.0.0-rc3 — 2016-12-28
- 2.0.0-rc2 — 2016-12-28
- 2.0.0-rc1 — 2016-12-28
- 1.1.1 — 2015-06-01
- 1.1.0 — 2014-12-03
- 1.0.1-npm — 2014-06-23

## README

# dygraphs JavaScript charting library

The dygraphs JavaScript library produces interactive, zoomable charts of time series:

![sample graph](Screenshot.png)

Learn more about it at [dygraphs.com](https://dygraphs.com/).

Get help with dygraphs on [Stack Overflow][] (preferred) and [Google Groups][].

## Features
* Plots time series without using an external server or Flash
* Supports [error bands][] around data series
* Interactive [pan and zoom][]
* Displays values [on mouseover][]
* Adjustable [averaging period][]
* Extensive set of [options][] for customization.
* Compatible with the [Google Visualization API][gviz]

## Minimal Example
```html
<html>
<head>
<link rel="stylesheet" type="text/css" href="dygraph.css" />
<script type="text/javascript" src="dygraph.js"></script>
</head>
<body>
<div id="graphdiv"></div>
<script type="text/javascript"><!--//--><![CDATA[//><!--
  Dygraph.onDOMready(function onDOMready() {  // or jQuery $() etc.
    g = new Dygraph(
        document.getElementById("graphdiv"),  // containing div
        "Date,Temperature\n" +                // the data series
        "2008-05-07,75\n" +
        "2008-05-08,70\n" +
        "2008-05-09,80\n",
        { }                                   // the options
      );
  });
//--><!]]></script>
</body>
</html>
```

Learn more by reading [the tutorial][] and seeing demonstrations of what
dygraphs can do in the [gallery][]. You can get `dygraph.js` and `dygraph.css`
from [UNPKG][], [cdnjs][] or [from NPM][npm] (see below).

## Usage with a module loader

Get dygraphs from NPM:

    npm install dygraphs

**Do not install from the git repository!** Always use a tarball install,
which contains the prebuilt files; `npm` fails to build the source code
on install from github. (The tarball from the GitHub Registry is fine.)

You'll find pre-built JS & CSS files in `node_modules/dygraphs/dist/`. If you're
using a module bundler like browserify or webpack, you can import dygraphs:

```js
import Dygraph from 'dygraphs';
// or: const Dygraph = require('dygraphs');

const g = new Dygraph('graphdiv', data, { /* options */ });
```

Check out the [dygraphs-es6 repo][] for a fully-worked example.

## Development

To get going, install the following Debian packages…

 - `jq`
 - `mksh`
 - `pax`
 - `python3`

… clone the repo and run:

    npm install
    npm run build-jsonly

Then open `tests/demo.html` in your browser.

Read more about the dygraphs development process in the [developer guide](/DEVELOP.md).

## License(s)

<img width="121" height="121"
 alt="AIn’t badge: made from 100% natural brains; CC0 by Bethan Tovey-Walsh via https://linguacelta.com/aint/" title="AIn’t: made from 100% natural brains; badge CC0 by Bethan Tovey-Walsh via https://linguacelta.com/aint/"
 src="https://github.com/danvk/dygraphs/blob/master/docs/aint.png?raw=true"
 align="right" style="float:right; margin-left:1em; margin-bottom:3px;" />

dygraphs is 100% human-written and available under the MIT licence,
included in [LICENSE.txt](./LICENSE.txt).

Use of so-called “AI” / LLMs to prepare a contribution or interact
with anyone in the project or its users is not welcome.

[UNPKG]: https://unpkg.com/dygraphs/
[cdnjs]: https://cdnjs.com/libraries/dygraph
[the tutorial]: https://dygraphs.com/tutorial.html
[gallery]: https://dygraphs.com/gallery/
[error bands]: https://dygraphs.com/tests/legend-values.html
[pan and zoom]: https://dygraphs.com/tests/link-interaction.html
[on mouseover]: https://dygraphs.com/tests/legend-values.html
[averaging period]: https://dygraphs.com/tests/temperature-sf-ny.html
[options]: https://dygraphs.com/options.html
[Stack Overflow]: https://stackoverflow.com/questions/tagged/dygraphs?sort=votes&pageSize=50
[Google Groups]: https://groups.google.com/g/dygraphs-users
[gviz]: https://dygraphs.com/data.html#datatable
[npm]: https://www.npmjs.com/package/dygraphs
[dygraphs-es6 repo]: https://github.com/danvk/dygraphs-es6

---
_Source: https://npm.io/package/dygraphs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
