@fluentui/react-charting

中文文档
5.25.14发布于 2026/10/29MITTypeScriptESM + CJS近 30 天下载 6.6万

React web charting controls for Microsoft fluentui system.

原始使用文档
文档目录10 节
  1. Using the library
  2. Contact
  3. Resources
  4. Contributing
  5. Testing
  6. Accessibility
  7. Performance
  8. Versioning and changelog
  9. Coding Guidelines
  10. Technical details

@fluentui/react-charting

npm version Build Status

Overview

Fluent UI React (formerly Office UI Fabric React) charts is a set of modern, accessible, interactive and highly customizable visualization library representing the Microsoft design system.

The charting library is built using D3 (Data Driven Documents) and other fluent UI controls.

These charts are used across different products in Microsoft. They are ready to be used in a production environment.

This library is also supported for fluent UI v7.

Using the library

Examples and code snippets for the charting library are available on the demo site. The code snippets can be used as usage guide for all the props and chart variations. Click on 'Show code' on the demo site to access demo for each variant.

The library is published as a npm package to public npm feed. To install the package

npm install @fluentui/react-charting

To import charting components:

import { ComponentName } from '@fluentui/react-charting/lib/ComponentName';

Contact

The charting project is actively funded by a small feature team. The team responds within 1-2 business days for any queries or doubts. You can reach out to the charting team by tagging @microsoft/charting-team in discussion items.

You could also create issues under the charting tag.

Resources

Several resources are available to know more details about the charting project.

Published roadmap here

Detailed wiki (Internal to Microsoft Employees currently)

Join our discord server for realtime conversation and schedule to our regular office hours.

Official codepen account - Coming soon

Figma design guidance - Coming soon

Contributing

contributions welcome

Refer the main fluentui wiki for detailed instructions on setup and contributing to the package.

A comprehensive contributor guide is available in our internal wiki. Available to share publically on request.

Testing

Test Coverage Badge

The library has a wide variety of tests to ensure quality of the library. The tests range from component tests, unit tests, visual regression tests, accessibility tests, integration tests and manual tests. The test automations aim to ensure over 90% code coverage across the library.

Further details available in the wiki

Run yarn test from within the package to run all the tests.

Accessibility

Our charts have elaborate accessibility support. The charts are WCAG 2.1 MAS C compliant for accessibility.

More details are covered in the wiki.

Performance

Performance is a key success criteria for the charting library. Performance is measured and has been improved for the following scenarios.

S No Scenario Lighthouse Score
1. 1 LineChart of 1 series with 30,000 datapoints 79.2
2. 6 LineCharts of 1 series with 100 datapoints each 98.8
3. 18 LineCharts of 1 series with 5 datapoints 98
4. 50 Linecharts of 1 Series with 10 datapoints each 89.6
5. 1 Linechart of 2 series with 500 datapoints each 98.6
6. 10 Linecharts of 1 series with 1000 datapoints each 94.4
7. 1 Areachart with 30,000 datapoints 70
8. 6 Areacharts of 1 series with 100 datapoints each 95.4
9. 18 Areacharts of 1 series with 5 data points each 96.8

More details are covered in the wiki.

Versioning and changelog

We use SemVer for versioning. For the versions available, see the tags on this repository.

Refer to the changelog for details about changes made in each version.

Coding Guidelines

Refer fluent Coding guidelines

Technical details

Refer this document for details on color palette, theming, types of axis supported and more.

版本与发布记录

@fluentui/react-charting 共发布 785 个版本,首次发布于 2020/10/23;过去 12 个月发布了 12 个版本。

版本发布日期距今
5.25.14latest2026/10/2917 天前
5.25.132026/10/2620 天前
5.25.122026/10/011 个月前
5.25.112026/07/014 个月前
5.25.102026/05/265 个月前
5.25.92026/05/195 个月前

其他发布通道:beta → 5.0.0-beta.62,lts-7 → 4.23.27。

关于 @fluentui/react-charting 的常见问题

@fluentui/react-charting 是什么?

React web charting controls for Microsoft fluentui system.

如何安装 @fluentui/react-charting?

在项目目录运行 npm install @fluentui/react-charting,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16.8.0 <20.0.0)、react-dom(>=16.8.0 <20.0.0)、@types/react(>=16.8.0 <20.0.0)、@fluentui/react(^8.125.10)、@types/react-dom(>=16.8.0 <20.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fluentui/react-charting 支持 TypeScript 吗?

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

@fluentui/react-charting 支持 ESM 还是 CommonJS?

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

@fluentui/react-charting 可以商用吗?

@fluentui/react-charting 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fluentui/react-charting 的下载量有多少?

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

@fluentui/react-charting 还在维护吗?

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