# JavaScript charting libraries

JavaScript charting libraries turn arrays of data into line, bar, pie, and other charts in the browser. Each one draws either SVG, where every bar and point is its own element on the page, or canvas, where the whole chart is one bitmap. These libraries draw the charts in analytics dashboards, financial reports, and monitoring tools.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [recharts](#recharts) | 198.6M | 27.7K | Jul 2026 | MIT |
| [d3](#d3) | 106.7M | 113.9K | Nov 2026 | ISC |
| [Chart.js](#chart-js) | 50.0M | 67.8K | Oct 2026 | MIT |
| [echarts](#echarts) | 30.6M | 67.7K | May 2026 | Apache-2.0 |
| [highcharts](#highcharts) | 11.2M | 12.5K | Sep 2026 | Custom license |
| [apexcharts](#apexcharts) | 9.3M | 15.2K | Nov 2026 | Custom license |
| [@observablehq/plot](#observablehq-plot) | 4.2M | 5.4K | Nov 2026 | ISC |
| [uPlot](#uplot) | 3.3M | 10.6K | Mar 2025 | MIT |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[recharts](#recharts) has the most installs, while [d3](#d3) has the most GitHub stars.

## Capabilities

| Library | Ships TypeScript types | Offers React components | Zooms and pans | Renders with WebGL | Output formats |
| --- | --- | --- | --- | --- | --- |
| [recharts](#recharts) | Built-in | Built-in | Built-in | Unsupported | HTML |
| [d3](#d3) | Unsupported | Unsupported | Built-in |  | HTML, SVG |
| [Chart.js](#chart-js) | Built-in | Unsupported | Via plugin |  | PNG |
| [echarts](#echarts) | Built-in | Unsupported | Built-in | Via plugin | PNG, SVG |
| [highcharts](#highcharts) | Built-in | Built-in | Built-in | Via plugin | PDF, PNG, JPEG |
| [apexcharts](#apexcharts) | Built-in | Via plugin | Built-in | Unsupported | CSV, PNG, SVG |
| [@observablehq/plot](#observablehq-plot) | Built-in | Unsupported | Unsupported | Unsupported | HTML, SVG |
| [uPlot](#uplot) | Built-in | Unsupported | Via plugin | Unsupported | PNG |

## Libraries

### recharts

[GitHub](https://github.com/recharts/recharts) · [npm](https://www.npmjs.com/package/recharts) · [Docs](https://recharts.github.io)

Recharts builds charts in React out of separate components, drawn as SVG on top of [d3](#d3). A chart component such as `LineChart` takes the data array. Its children, such as `XAxis`, `Tooltip`, `CartesianGrid`, and `Line`, each add one part of the chart. Each `Line` reads one field of every data item through its `dataKey` prop. Installing Recharts also installs `react-is`, which has to match the project's React version.

- Downloads / mo: 198.6M
- Stars: 27.7K
- Last release: 3.10.1, Jul 2026
- License: MIT
- Capabilities: [From the recharts docs](https://github.com/recharts/recharts/blob/main/types.d.ts)

**Strengths**

- **Charts as React components.** Axes, tooltips, and series are JSX elements.
- **SVG output.** Draws native SVG with few dependencies.

**Watch out for**

- **React only.** Charts are React components. Projects without React use a library such as [Chart.js](#chart-js) instead.
- **Matching react-is.** The `react-is` package has to stay at the same version as the project's `react` package.

```sh
npm install recharts
```

**supabase/supabase** (114.6K stars)

[supabase/supabase](https://github.com/supabase/supabase) draws a responsive area chart of cumulative developer signups with Recharts AreaChart, XAxis and YAxis.

```javascript
const DeveloperGrowthChart = () => {
  return (
    <div className="my-8 -mx-4 sm:mx-0">
      <ResponsiveContainer width="100%" height={400}>
        <AreaChart data={data} margin={{ top: 8, right: 8, left: 0, bottom: 0 }}>
          <defs>
            <linearGradient id="developerGrowthFill" x1="0" y1="0" x2="0" y2="1">
              <stop offset="0%" stopColor="hsl(var(--brand-600))" stopOpacity={0.3} />
              <stop offset="100%" stopColor="hsl(var(--brand-600))" stopOpacity={0.02} />
            </linearGradient>
          </defs>
          <XAxis
            dataKey="month"
            tick={{ fontSize: 12, fill: 'var(--foreground-lighter)' }}
            tickLine={false}
            axisLine={{ stroke: 'var(--border-default)' }}
            tickFormatter={(value) => value.substring(0, 4)}
            ticks={data.filter((d, i) => isYearBoundary(d.month, i)).map((d) => d.month)}
          />
          <YAxis
            tick={{ fontSize: 12, fill: 'var(--foreground-lighter)' }}
            tickLine={false}
            axisLine={false}
            tickFormatter={formatYAxis}
            width={40}
          />
          <Area
            type="monotone"
            dataKey="cumulativeDevelopers"
            stroke="hsl(var(--brand-600))"
            strokeWidth={2}
            fill="url(#developerGrowthFill)"
          />
        </AreaChart>
      </ResponsiveContainer>
    </div>
  )
}
```

[DeveloperGrowthChart.tsx · DeveloperGrowthChart()](https://github.com/supabase/supabase/blob/797a43c7d023777af25ba4621bdf87e66362e7bb/apps/www/components/Charts/DeveloperGrowthChart.tsx#L92-L129) · pushed Nov 2026 · [More projects using recharts →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20recharts%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import { Line, LineChart } from 'recharts';

const data = [
  {
    uv: 400,
  },
  {
    uv: 300,
  },
  {
    uv: 320,
  },
];

<LineChart style={{ width: '100%', aspectRatio: 1.618, maxWidth: 600 }} responsive data={data}>
  <Line dataKey="uv" />
</LineChart>
```

From [the docs](https://recharts.github.io/en-US/guide/getting-started/)

### d3

[GitHub](https://github.com/d3/d3) · [npm](https://www.npmjs.com/package/d3) · [Docs](https://d3js.org)

d3 is a toolbox of about thirty separate modules for drawing charts by hand, not a charting library with ready-made chart types. A stacked area chart, for example, combines a CSV parser, time and linear scales, a stack layout, an area generator that produces SVG path data, and axes. Selections create and change SVG or Canvas elements directly. When the data changes, the data join applies separate steps to elements that enter, update, or leave. For standard charts, the documentation points to [Observable Plot](#observablehq-plot), where a histogram takes one line instead of about fifty.

- Downloads / mo: 106.7M
- Stars: 113.9K
- Last release: 7.9.2, Nov 2026
- License: ISC
- Capabilities: [From the d3 docs](https://d3js.org/getting-started)

**Strengths**

- **Any chart design.** Scales, shapes, and layouts build fully custom visuals.
- **SVG or Canvas.** Works directly with web standards, with no rendering layer of its own.
- **Updates changed elements.** The data join changes only the elements that need it, with animated transitions.

**Watch out for**

- **More code per chart.** Even a basic chart takes a few dozen lines, because the toolbox has no chart abstraction.
- **No default look.** Axes, layout, colors, and labels all come from the code each project writes.

```sh
npm install d3
```

**tj/d3-line** (125 stars)

[tj/d3-line](https://github.com/tj/d3-line) sets up an SVG line chart with time and linear scales, bottom and left axes, and a line generator.

```javascript
init() {
  const { target, width, height, margin, axisPadding, interpolate } = this
  const { tickSize, xTicks, yTicks } = this
  const [w, h] = this.dimensions()

  this.chart = d3.select(target)
      .attr('width', width)
      .attr('height', height)
    .append('g')
      .attr('transform', `translate(${margin.left}, ${margin.top})`)

  this.x = d3.scaleTime()
    .range([0, w])

  this.y = d3.scaleLinear()
    .range([h, 0])

  this.xAxis = d3.axisBottom()
    .scale(this.x)
    .ticks(xTicks)
    .tickPadding(8)
    .tickSize(tickSize)

  this.yAxis = d3.axisLeft()
    .scale(this.y)
    .ticks(yTicks)
    .tickPadding(8)
    .tickSize(tickSize)

  // ...

  this.line = d3.line()
    .x(d => this.x(d.time))
    .y(d => this.y(d.value))
    .curve(d3[interpolate])

  this.chart.append('path')
    .attr('class', 'line')
}
```

[index.js · init()](https://github.com/tj/d3-line/blob/29b9608811a7a6b818a027002e013dca32851786/index.js#L80-L126) · pushed Nov 2016 · [More projects using d3 →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20d3%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**tj/d3-line** (125 stars)

[tj/d3-line](https://github.com/tj/d3-line) fits the chart's scales to the data's extent and redraws both axes, animated when asked.

```javascript
renderAxis(data, options) {
  const { chart, x, y, xAxis, yAxis, nice } = this

  const xd = x.domain(d3.extent(data, d => d.time))
  const yd = y.domain(d3.extent(data, d => d.value))

  if (nice) {
    xd.nice()
    yd.nice()
  }

  const c = options.animate
    ? chart.transition()
    : chart

  c.select('.x.axis').call(xAxis)
  c.select('.y.axis').call(yAxis)
}
```

[index.js · renderAxis()](https://github.com/tj/d3-line/blob/29b9608811a7a6b818a027002e013dca32851786/index.js#L132-L149) · pushed Nov 2016 · [More projects using d3 →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20d3%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
const width = 640;
const height = 400;
const marginRight = 20;
const marginBottom = 30;
const marginLeft = 40;

const x = d3.scaleUtc()
    .domain([new Date("2023-01-01"), new Date("2024-01-01")])
    .range([marginLeft, width - marginRight]);

const svg = d3.create("svg")
    .attr("width", width)
    .attr("height", height);

svg.append("g")
    .attr("transform", `translate(0,${height - marginBottom})`)
    .call(d3.axisBottom(x));

container.append(svg.node());
```

From [the docs](https://d3js.org/getting-started)

### Chart.js

[GitHub](https://github.com/chartjs/Chart.js) · [npm](https://www.npmjs.com/package/chart.js) · [Docs](https://www.chartjs.org/)

Chart.js draws charts onto an HTML `canvas` element. `new Chart` takes the canvas and one configuration object. Inside that object, `type` picks the chart, such as `bar` or `line`, while `data` contains the labels and datasets, and `options` sets the scales. Unlike [Recharts](#recharts), which builds SVG elements, Chart.js paints pixels, so a chart can also render inside a web worker by passing an `OffscreenCanvas` to the constructor.

- Downloads / mo: 50.0M
- Stars: 67.8K
- Last release: 4.6.1, Oct 2026
- License: MIT
- Capabilities: [From the Chart.js docs](https://www.chartjs.org/docs/latest/)

**Strengths**

- **Small bundle.** Import only the chart types in use.
- **Handles big line charts.** The decimation plugin thins data before drawing.
- **Draws off the main thread.** Renders in a web worker through OffscreenCanvas.

**Watch out for**

- **Large line charts.** For tens of thousands of points, the docs recommend the decimation plugin, which reduces the data before the chart draws it.
- **Workers lose interactions.** Inside a web worker, plugins that use the DOM, including mouse interactions, will likely not work. Resizing the chart also becomes manual.

```sh
npm install chart.js
```

**haishanh/yacd** (4.8K stars)

[haishanh/yacd](https://github.com/haishanh/yacd) draws a Chart.js line chart on a canvas and redraws it each time its data subscription fires.

```javascript
export default function useLineChart(
  chart: typeof import('chart.js').Chart,
  elementId: string,
  data: ChartConfiguration['data'],
  subscription: any,
  extraChartOptions = {},
) {
  useEffect(() => {
    const ctx = (document.getElementById(elementId) as HTMLCanvasElement).getContext('2d');
    const options = { ...commonChartOptions, ...extraChartOptions };
    const c = new chart(ctx, { type: 'line', data, options });
    const unsubscribe = subscription && subscription.subscribe(() => c.update());
    return () => {
      unsubscribe && unsubscribe();
      c.destroy();
    };
  }, [chart, elementId, data, subscription, extraChartOptions]);
}
```

[useLineChart.ts · useLineChart()](https://github.com/haishanh/yacd/blob/d37a1ffa992d45560fcdfb008a2a6a5b76062654/src/hooks/useLineChart.ts#L7-L24) · pushed Feb 2024 · [More projects using Chart.js →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20chart.js%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
const ctx = document.getElementById('myChart');

new Chart(ctx, {
  type: 'bar',
  data: {
    labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
    datasets: [{
      label: '# of Votes',
      data: [12, 19, 3, 5, 2, 3],
      borderWidth: 1
    }]
  },
  options: {
    scales: {
      y: {
        beginAtZero: true
      }
    }
  }
});
```

From [the docs](https://www.chartjs.org/docs/latest/getting-started/)

### echarts

[GitHub](https://github.com/apache/echarts) · [npm](https://www.npmjs.com/package/echarts) · [Docs](https://echarts.apache.org)

Apache ECharts draws interactive charts from a single option object. `echarts.init` attaches a chart instance to a container element. The option object passed to `setOption` lists the axes, the legend, the tooltip, and each series with its `type` and data. ECharts is written in JavaScript on zrender, a canvas drawing library. Extensions add three-dimensional plots and globes through ECharts GL, word clouds, and liquid fill charts.

- Downloads / mo: 30.6M
- Stars: 67.7K
- Last release: 6.1.0, May 2026
- License: Apache-2.0
- Capabilities: [From the echarts docs](https://echarts.apache.org/en/js/vendors/echarts/package.README.md)

**Strengths**

- **Most chart types.** The widest range of any open-source chart library.
- **Canvas or SVG.** One config object, with a choice of renderer.

**Watch out for**

- **Container needs a size.** The container element needs a set width and height before `echarts.init` runs.
- **Wrappers are separate.** Framework components come from separate packages, such as vue-echarts for Vue.

```sh
npm install echarts
```

**apache/dolphinscheduler** (14.6K stars)

[apache/dolphinscheduler](https://github.com/apache/dolphinscheduler) creates an ECharts chart in a Vue component, applies its option, and resizes it with the window.

```javascript
function initChart<Opt extends ECBasicOption>(
  domRef: Ref<HTMLDivElement | null>,
  option: Opt,
  resizeFun?: any
): ECharts | null {
  let chart: ECharts | null = null
  const themeStore = useThemeStore()
  const { locale } = useI18n()
  const globalProperties =
    getCurrentInstance()?.appContext.config.globalProperties

  option['backgroundColor'] = ''

  const init = () => {
    chart = globalProperties?.echarts.init(
      domRef.value,
      themeStore.darkTheme ? 'dark-bold' : 'macarons'
    )
    chart && chart.setOption(option)
  }

  const resize = throttle(() => {
    if (resizeFun) {
      resizeFun(chart)
      return
    }
    chart && chart.resize()
  }, 20)
  // ...
  onMounted(() => {
    init()
    addEventListener('resize', resize)
  })

  onBeforeUnmount(() => {
    removeEventListener('resize', resize)
  })

  return chart
}
```

[index.ts · initChart()](https://github.com/apache/dolphinscheduler/blob/0250417c6f961cb832190bbfaa825d9e1ccf2bf1/dolphinscheduler-ui/src/components/chart/index.ts#L26-L92) · pushed Nov 2026 · [More projects using echarts →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20echarts%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
var myChart = echarts.init(document.getElementById('main'));

var option = {
  xAxis: {
    data: ['Shirts', 'Cardigans', 'Chiffons', 'Pants', 'Heels', 'Socks']
  },
  yAxis: {},
  series: [
    {
      type: 'bar',
      data: [5, 20, 36, 10, 10, 20]
    }
  ]
};

myChart.setOption(option);
```

From [the docs](https://echarts.apache.org/handbook/en/get-started/)

### highcharts

[GitHub](https://github.com/highcharts/highcharts) · [npm](https://www.npmjs.com/package/highcharts) · [Docs](https://www.highcharts.com)

Highcharts draws charts in SVG, with some Canvas and WebGL rendering. `Highcharts.chart` takes the id of a container element and an options object with the chart `type`, the title, the axes, and an array of series. Stock charts use a separate constructor, `Highcharts.stockChart`. To reduce file size, a project can create a custom build that combines only the modules it uses.

- Downloads / mo: 11.2M
- Stars: 12.5K
- Last release: 13.1.1, Sep 2026
- License: Custom license
- Capabilities: [From the highcharts docs](https://www.highcharts.com/docs/advanced-chart-features/highcharts-typescript-declarations)

**Strengths**

- **Stock, map, and Gantt charts.** Covers financial, map, and Gantt charts beyond the usual types.
- **Feature-complete.** More features than most free chart libraries.
- **More complete than free libraries.** It ships more chart features than most free open-source chart libraries.

**Watch out for**

- **Source available.** Highcharts is a source-available product, licensed through the Highcharts shop instead of under an open source license.

```sh
npm install highcharts
```

**max0x7ba/atomic_queue** (1.9K stars)

[max0x7ba/atomic_queue](https://github.com/max0x7ba/atomic_queue) draws a column chart of queue throughput with error bars in Highcharts, switching to a log scale on click.

```javascript
function plot_scalability(div, results) {
    const [max_lin, max_log] = $(div).data("ylim").split(";").map(parseFloat);
    // ...
    Highcharts.chart(div, {
        series: series,
        chart: {
            events: {
                click: function() {
                    const m = modes[mode ^= 1];
                    this.yAxis[0].update(m.yAxis);
                    // this.subtitle.update(m.subtitle);
                }
            }
        },
        // subtitle: modes[0].subtitle,
        yAxis: modes[0].yAxis,
        xAxis: {
            title: { text: 'number of producers, number of consumers' },
            tickInterval: 1
        },
        tooltip: {
            formatter: tooltip_formatter,
            shared: true,
        },
    });
}
```

[benchmarks.js · plot_scalability()](https://github.com/max0x7ba/atomic_queue/blob/b7f1befe89446752767243c5e5550779a9a5eed2/html/benchmarks.js#L44-L131) · pushed Oct 2026 · [More projects using highcharts →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20highcharts%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
document.addEventListener('DOMContentLoaded', function () {
  const chart = Highcharts.chart('container', {
    chart: {
      type: 'bar'
    },
    title: {
      text: 'Fruit Consumption'
    },
    xAxis: {
      categories: ['Apples', 'Bananas', 'Oranges']
    },
    yAxis: {
      title: {
        text: 'Fruit eaten'
      }
    },
    series: [{
      name: 'Jane',
      data: [1, 0, 4]
    }, {
      name: 'John',
      data: [5, 7, 3]
    }]
  });
});
```

From [the docs](https://www.highcharts.com/docs/getting-started/your-first-chart)

### apexcharts

[GitHub](https://github.com/apexcharts/apexcharts.js) · [npm](https://www.npmjs.com/package/apexcharts) · [Docs](https://apexcharts.com)

ApexCharts draws interactive SVG charts from one configuration object, with no runtime dependencies. `new ApexCharts` takes a container element and the options, such as the chart `type`, the series, and the x-axis categories. Calling `render` then draws the chart. Official wrappers cover React, Vue, Angular, Blazor, and Stencil. For dense series, setting `renderer` to `auto` paints the data layer to a canvas above a point threshold while axes and tooltips stay SVG. A separate import, `apexcharts/ssr`, renders chart HTML on the server for frameworks such as Next.js.

- Downloads / mo: 9.3M
- Stars: 15.2K
- Last release: 8.8.1, Nov 2026
- License: Custom license
- Capabilities: [From the apexcharts docs](https://apexcharts.com/docs/typescript/)

**Strengths**

- **Zoom built in.** No plugin needed; works with React, Vue, Angular, or plain JS.
- **Smooth data updates.** Charts animate when the data changes.
- **Polished defaults.** Looks finished without theme work.

**Watch out for**

- **Premium features.** A small set of advanced features, such as the unit and raincloud chart types, need a premium license key.
- **Extra chart imports.** The default bundle leaves out chart types such as sunburst and violin, which need their own import.

```sh
npm install apexcharts
```

**rhubarbgroup/redis-cache** (545 stars)

[rhubarbgroup/redis-cache](https://github.com/rhubarbgroup/redis-cache) renders a Redis cache stats chart with ApexCharts, destroying the previous chart first.

```javascript
var render_chart = function ( id ) {
    if ( ! rediscache.charts[ id ] ) {
        return;
    }

    if ( rediscache.chart ) {
        rediscache.chart.destroy();
        root.rediscache.chart = null;
    }

    var chart = new ApexCharts(
        document.querySelector( '#redis-stats-chart' ),
        rediscache.charts[ id ]
    );

    chart.render();
    root.rediscache.chart = chart;
};
```

[admin.js · render_chart()](https://github.com/rhubarbgroup/redis-cache/blob/be25972ac7effd5900de2cbc79c8632f99adc5fc/assets/js/admin.js#L314-L331) · pushed Nov 2026 · [More projects using apexcharts →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20apexcharts%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import ApexCharts from 'apexcharts'

const chart = new ApexCharts(document.querySelector('#chart'), {
  chart: { type: 'bar' },
  series: [{ name: 'Sales', data: [30, 40, 35, 50, 49, 60, 70, 91, 125] }],
  xaxis: { categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999] }
})

chart.render()
```

From [the README](https://github.com/apexcharts/apexcharts.js/blob/main/README.md)

### @observablehq/plot

[GitHub](https://github.com/observablehq/plot) · [npm](https://www.npmjs.com/package/@observablehq/plot) · [Docs](https://observablehq.github.io/plot/)

Observable Plot charts tabular data by layering marks, such as dots, bars, lines, and rules, over shared scales. A plot specification assigns columns of the data to visual properties. `Plot.dot(olympians, {x: "weight", y: "height"})`, for example, draws a scatterplot with axes and scales chosen automatically. Transforms such as `binX` group the data before drawing, which turns the same table into a histogram. The [d3](#d3) documentation recommends Plot unless a chart needs low-level control.

- Downloads / mo: 4.2M
- Stars: 5.4K
- Last release: 0.6.19, Nov 2026
- License: ISC
- Capabilities: [From the @observablehq/plot docs](https://observablehq.github.io/plot/getting-started)

**Strengths**

- **Short chart code.** A few lines turn a table into a chart.
- **Built for exploration.** Good defaults and built-in data transforms.

**Watch out for**

- **React through a wrapper.** React projects render plots inside a component of their own, either on the server through the `document` option or in the browser after mount.

```sh
npm install @observablehq/plot
```

**herbie-fp/herbie** (896 stars)

[herbie-fp/herbie](https://github.com/herbie-fp/herbie) plots cost against accuracy with Observable Plot, drawing the Pareto frontier as a line and each program as a dot.

```javascript
plot: async function(benchmark, initial_pt, target_pts, rest_pts) {
    const bits = benchmark["bits"];
    // ...
    })

    const out = Plot.plot({
        marks: [
            Plot.line(line, {
                x: d => initial_pt[0]/d[0],
                y: d => 1 - d[1]/bits,
                stroke: "#00a", strokeWidth: 1, strokeOpacity: .2,
            }),
            Plot.dot(rest_pts, {
                x: d => initial_pt[0]/d[0],
                y: d => 1 - d[1]/bits,
                fill: "#00a", r: 3,
            }),
            Plot.dot([initial_pt], {
                x: d => initial_pt[0]/d[0],
                y: d => 1 - d[1]/bits,
                stroke: "#d00", symbol: "square", strokeWidth: 2
            }),
            target_pts && Plot.dot(target_pts, {
                x: d => initial_pt[0]/d[0],
                y: d => 1 - d[1]/bits,
                stroke: "#080", symbol: "circle", strokeWidth: 2
            }),
        ].filter(x=>x),
        marginBottom: 0,
        marginRight: 0,
        width: '400',
        height: '200',
        x: { line: true, nice: true, tickFormat: c => c + "×" },
        y: { nice: true, line: true, domain: [0, 1], tickFormat: "%" },
    })
    out.setAttribute('viewBox', '0 0 420 220')
    return out
},
```

[report.js · plot()](https://github.com/herbie-fp/herbie/blob/81fe5efeb5accea858051e5a53264fdc925f9a65/src/reports/resources/report.js#L270-L320) · pushed Nov 2026 · [More projects using @observablehq/plot →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20%40observablehq/plot%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import * as Plot from "@observablehq/plot";

const plot = Plot.rectY({length: 10000}, Plot.binX({y: "count"}, {x: Math.random})).plot();
const div = document.querySelector("#myplot");
div.append(plot);
```

From [the docs](https://observablehq.com/plot/getting-started)

### uPlot

[GitHub](https://github.com/leeoniya/uPlot) · [npm](https://www.npmjs.com/package/uplot)

uPlot draws time series, lines, areas, OHLC, and bar charts on a Canvas, in a library of about fifty kilobytes minified. `new uPlot` takes an options object with the size and series styles, a data array, and a target element. The first row of the data array contains the x values. Each later row contains one series. According to the README, a cold start draws an interactive chart of more than a hundred and sixty thousand points in about twenty-five milliseconds. A live chart redrawing thousands of points sixty times a second uses about a quarter of the CPU that [Chart.js](#chart-js) needs.

- Downloads / mo: 3.3M
- Stars: 10.6K
- Last release: 1.6.32, Mar 2025
- License: MIT
- Capabilities: [From the uPlot docs](https://github.com/leeoniya/uPlot/blob/master/README.md)

**Strengths**

- **Very fast time series.** Draws 166,650 points in 25 ms from a cold start.
- **Live streaming data.** Updates efficiently as new data arrives.
- **Plugins for tooltips and sync.** Cursor sync and custom tooltips use one hooks API.

**Watch out for**

- **No animations.** Transitions and animations are left out by design.
- **No drag panning.** Drag scrolling and panning come from plugins built on the hooks API, such as zoom-touch.
- **No data processing.** Aggregation and statistics happen before the data reaches the chart, in tools such as simple-statistics.

```sh
npm install uplot
```

**phoenixframework/phoenix_live_dashboard** (2.2K stars)

[phoenixframework/phoenix_live_dashboard](https://github.com/phoenixframework/phoenix_live_dashboard) creates a live telemetry chart with uPlot and buffers incoming measurements before pushing them to it.

```javascript
constructor(chartEl, options) {
  if (!options.metric) {
    throw new TypeError(`No metric type was provided`)
  } else if (options.metric && !__METRICS__[options.metric]) {
    throw new TypeError(`No metric defined for type ${options.metric}`)
  }

  const metric = __METRICS__[options.metric]
  if (metric === Summary) {
    this.metric = new Summary(options, chartEl)
    this.uplotChart = this.metric.chart
  } else {
    this.uplotChart = new uPlot(metric.getConfig(options), metric.initialData(options), chartEl)
    this.metric = new metric(this.uplotChart, options)
  }

  // setup the data buffer
  let isBufferingData = typeof options.refreshInterval !== "undefined"
  this._isBufferingData = isBufferingData
  this._buffer = []
  this._timer = isBufferingData ? setInterval(
    this._flushToChart.bind(this),
    +options.refreshInterval
  ) : null
}
```

[index.js · constructor()](https://github.com/phoenixframework/phoenix_live_dashboard/blob/83a0bd137ed3e4c66b8037b140a2744803a48e13/assets/js/metrics_live/index.js#L397-L421) · pushed Sep 2026 · [More projects using uPlot →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20uplot%20for%20drawing%20charts%20and%20graphs%20in%20the%20browser%3A%20line%2C%20bar%2C%20and%20pie%20charts%20and%20dashboards&filters=%7B%22highlights%22%3Atrue%2C%22numResults%22%3A10%2C%22type%22%3A%22auto%22%2C%22includeDomains%22%3A%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
let data = [
  [1546300800, 1546387200],    // x-values (timestamps)
  [        35,         71],    // y-values (series 1)
];

let opts = {
  width: 800,
  height: 600,
  series: [
    {},
    {
      stroke: "red",
    }
  ],
};

let uplot = new uPlot(opts, data, document.body);
```

From [the docs](https://github.com/leeoniya/uPlot/blob/1f916f350bc11e86ee407f55cc5c3a77f723d8d5/docs/README.md)

## FAQ

### What is the best JavaScript charting library?

It depends on the chart. [Recharts](#recharts) builds charts from React components and has 198.6M downloads a month. [Chart.js](#chart-js) draws to a canvas without a framework, [ECharts](#echarts) stays responsive with large datasets, [ApexCharts](#apexcharts) adds interactive dashboard features, and [d3](#d3) suits fully custom charts.

### What is the best chart library for React?

[Recharts](#recharts) is built for React, has 198.6M downloads a month, and builds charts from JSX components such as LineChart and Tooltip. [highcharts](#highcharts) ships an official React integration, and [apexcharts](#apexcharts) offers a React wrapper. [echarts](#echarts) needs a third-party wrapper, such as echarts-for-react.

### Which JavaScript charting libraries are free?

[recharts](#recharts), [Chart.js](#chart-js), and [uPlot](#uplot) are free under the MIT license, [d3](#d3) and [@observablehq/plot](#observablehq-plot) under ISC, and [echarts](#echarts) under Apache-2.0. [highcharts](#highcharts) and [apexcharts](#apexcharts) charge for some commercial use. See [Popularity](#popularity) for each license.

### Is Highcharts free for commercial use?

Highcharts needs a paid commercial license for any business use, including internal tools and prototypes. Personal and educational projects use it free. See [highcharts](#highcharts).

### What is a free alternative to Highcharts?

[echarts](#echarts) is the closest free alternative, with the widest range of chart types of any open-source library under the Apache-2.0 license. [Chart.js](#chart-js) is lighter and covers common charts such as line, bar, and pie under MIT.

### Which JavaScript chart library is fastest with large datasets?

[uPlot](#uplot) is built for speed on time series, drawing 166,650 points in 25 ms from a cold start. [ECharts](#echarts) also handles large datasets, and [Chart.js](#chart-js) thins big line charts with its decimation plugin. SVG libraries such as [recharts](#recharts) and [apexcharts](#apexcharts) slow down with thousands of points.

### Recharts vs Chart.js: which is better?

[recharts](#recharts) fits React apps, building SVG charts from JSX components. [Chart.js](#chart-js) works in any web page, draws to a canvas from one config object, and thins big line charts with its decimation plugin. recharts has more downloads, at 198.6M a month against 50.0M.

## How this page was built

Data checked Nov 10, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "open source JavaScript libraries for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards",
    "numResults": 20,
    "type": "auto",
    "includeDomains": [
      "github.com"
    ]
  }
}
```

The other calls behind this page:

```
POST /search
Query: JavaScript charting library package
Within: github.com
```

```
POST /contents
Reads: https://github.com/recharts/recharts, https://recharts.github.io, https://www.npmjs.com/package/recharts
```

```
POST /answer
Query: Can the JavaScript library recharts (recharts on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library recharts (recharts on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library recharts (recharts on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library recharts (recharts on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library recharts (recharts) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses recharts for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

```
POST /contents
Reads: https://github.com/d3/d3, https://d3js.org, https://www.npmjs.com/package/d3
```

```
POST /answer
Query: Can the JavaScript library d3 (d3 on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library d3 (d3 on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library d3 (d3 on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library d3 (d3 on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library d3 (d3) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses d3 for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

```
POST /contents
Reads: https://github.com/heavyai/heavyai-charting/blob/059846e8bada2a2698f14a46fce2dac3dd934f1c/src/mixins/cap-mixin.js
```

```
POST /contents
Reads: https://github.com/epfl-vlsc/memoro/blob/49f25eca94237ebe4cb43bccae50ab2ff97b1c23/js/chunkgraph.js
```

```
POST /contents
Reads: https://github.com/chartjs/Chart.js, https://www.chartjs.org/, https://www.npmjs.com/package/chart.js
```

```
POST /answer
Query: Can the JavaScript library Chart.js (chart.js on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library Chart.js (chart.js on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library Chart.js (chart.js on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library Chart.js (chart.js on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library Chart.js (chart.js) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses chart.js for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

```
POST /contents
Reads: https://github.com/apache/echarts, https://echarts.apache.org, https://www.npmjs.com/package/echarts
```

```
POST /answer
Query: Can the JavaScript library echarts (echarts on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library echarts (echarts on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library echarts (echarts on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library echarts (echarts on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library echarts (echarts) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses echarts for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

```
POST /contents
Reads: https://github.com/highcharts/highcharts, https://www.highcharts.com, https://www.npmjs.com/package/highcharts
```

```
POST /answer
Query: Can the JavaScript library highcharts (highcharts on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library highcharts (highcharts on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library highcharts (highcharts on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library highcharts (highcharts on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library highcharts (highcharts) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses highcharts for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

```
POST /contents
Reads: https://github.com/apexcharts/apexcharts.js, https://apexcharts.com, https://www.npmjs.com/package/apexcharts
```

```
POST /answer
Query: Can the JavaScript library apexcharts (apexcharts on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library apexcharts (apexcharts on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library apexcharts (apexcharts on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library apexcharts (apexcharts on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library apexcharts (apexcharts) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses apexcharts for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

```
POST /contents
Reads: https://github.com/observablehq/plot, https://observablehq.github.io/plot/, https://www.npmjs.com/package/@observablehq/plot
```

```
POST /answer
Query: Can the JavaScript library @observablehq/plot (@observablehq/plot on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library @observablehq/plot (@observablehq/plot on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library @observablehq/plot (@observablehq/plot on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library @observablehq/plot (@observablehq/plot on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library @observablehq/plot (@observablehq/plot) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses @observablehq/plot for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

```
POST /contents
Reads: https://github.com/leeoniya/uPlot, https://www.npmjs.com/package/uplot
```

```
POST /answer
Query: Can the JavaScript library uPlot (uplot on npm) ship TypeScript type definitions? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library uPlot (uplot on npm) provide React components or an official React wrapper? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library uPlot (uplot on npm) let users zoom and pan a chart? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: Can the JavaScript library uPlot (uplot on npm) render charts with WebGL for large datasets? Answer from its own documentation.
Returns:
  - answer
  - how
  - evidence
```

```
POST /answer
Query: What output formats can the JavaScript library uPlot (uplot) render or export charts as? Answer from its own documentation.
Returns:
  - formats
  - evidence
```

```
POST /search
Query: JavaScript project that uses uplot for drawing charts and graphs in the browser: line, bar, and pie charts and dashboards, application code
Within: github.com
```

Docs: https://exa.ai/docs/reference/search
