@elastic/charts

中文文档
73.3.2发布于 2026/10/23SEE LICENSE IN LICENSE.txtTypeScriptESM + CJS构建来源已验证近 30 天下载 102.9万

Elastic-Charts data visualization library

原始使用文档
文档目录11 节
  1. Installation
  2. Running Locally
  3. Node
  4. Development environment
  5. CI
  6. Goals
  7. Contributing
  8. Wiki
  9. Consumption
  10. Documentation
  11. License

elastic-charts logo
Elastic Charts

Build Status - main branch NPM version Commitizen friendly

Check out our living style guide, which contains many examples on how charts look and feel, and how to use them in your products or fork the codesandbox example here to play directly with the library.

Installation

To install the Elastic Charts into an existing project, use the yarn CLI (npm is not supported).

yarn add @elastic/charts

Important: see the consuming wiki for detailed installation requirements

Running Locally

Node

We depend upon the version of node defined in .nvmrc.

You will probably want to install a node version manager. nvm is recommended.

To install and use the correct node version with nvm:

nvm install

Development environment

You can run the dev environment locally at http://localhost:9001 by running:

yarn
yarn start

We use storybook to document API, edge-cases, and the usage of the library. A hosted version is available at https://elastic.github.io/elastic-charts/storybook.

CI

We're using the same build pipeline for building PRs and the main branch. This pipeline is triggered through webhook events hitting the buildkite-pr-bot. Configuration for the triggered pipelines can be adjusted in pull-requests.json.

Goals

The primary goal of this library is to provide reusable set of chart components that can be used throughout Elastic's web products. As a single source of truth, the framework allows our designers to make changes to our look-and-feel directly in the code. And unit test coverage for the charts components allows us to deliver a stable "API for charts".

Contributing

You can find documentation around creating and submitting new features in contributing.

Wiki

Consumption

Documentation

License

Dual-licensed under Elastic v2 and Server Side Public License, v 1 Read the FAQ for details.

版本与发布记录

@elastic/charts 共发布 453 个版本,首次发布于 2019/02/07;过去 12 个月发布了 33 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
73.3.2latest2026/10/2320 天前
73.3.12026/10/1529 天前
73.3.02026/10/091 个月前
73.2.52026/10/021 个月前
73.2.42026/10/011 个月前
73.2.32026/10/011 个月前

其他发布通道:release-13.5.x → 13.5.13,release-17.1.x → 17.1.0,release-16.1.x → 16.1.3,release-18.1.x → 18.1.2,release-19.10.x → 19.10.1,release-19.8.x → 19.8.3。

关于 @elastic/charts 的常见问题

@elastic/charts 是什么?

Elastic-Charts data visualization library

如何安装 @elastic/charts?

在项目目录运行 npm install @elastic/charts,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0)、moment(^2.29.1)、react-dom(^18.0)、moment-timezone(^0.5.32)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@elastic/charts 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@elastic/charts 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@elastic/charts 可以商用吗?

@elastic/charts 使用 SEE LICENSE IN LICENSE.txt 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@elastic/charts 的下载量有多少?

根据 npm 官方下载统计,@elastic/charts 在 2026/10/13 – 2026/11/11 这 30 天内被下载 1,028,685 次,日均约 34,290 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elastic/charts 还在维护吗?

最新版本 73.3.2 发布于 2026/10/23(20 天前);至今共发布 453 个版本,其中过去 12 个月发布了 33 个;首次发布于 2019/02/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。