amCharts 5
repository·master·Indexed 19 days ago
https://github.com/amcharts/amcharts5A high-performance data visualization library designed for speed and advanced charting capabilities. It includes core rendering components, a Root class for HTML element connection, a Registry for instance management, and specialized tools for memory management via Disposers. The library provides support for themes, color management, data formatters, and optional packages for geodata and PDF fonts.
What's inside amCharts 5
- To implement localization and create custom translations for your charts, follow the official tutorial on creating locales.
Use amCharts 5 fonts via CDN
masterIf you prefer not to host the font files locally, you can access the JavaScript version of these fonts via the amCharts free CDN service. The base URL is
https://www.amcharts.com/lib/5/fonts/.<script src="https://cdn.amcharts.com/lib/5/fonts/notosans-sc.js"></script>Access amCharts 5 documentation and tutorials
masterFor comprehensive guides, getting started tutorials, and a full class reference, visit the official amCharts 5 documentation website.Use amCharts 5 Geodata via CDN
masterYou can access the JavaScript versions of geodata files directly via the amCharts CDN. The base URL is
https://www.amcharts.com/lib/5/geodata/.For example, to include the
worldLow.jsmap file, use the following script tag:<script src="https://www.amcharts.com/lib/5/geodata/worldLow.js"></script>Compile amCharts 5 from source
masterIf you need to build the library from the source code, you can use
yarnto install dependencies and run the build scripts. This allows you to generate ES2015 modules, script versions, or geodata.# Install dependencies yarn install # Build ES2015 modules yarn build # Build script version yarn build:script # Build geodata yarn build:geodataInstall the amCharts 5 PDF Font Pack
masterThe PDF Font Pack provides the font files required for PDF exports using the amCharts 5 Exporting plugin. You can install it using one of two methods:
- NPM: Install the
@amcharts/amcharts5-fontspackage. - Manual: Place the contents of this package directly into your
amcharts5/fontsfolder.
npm install @amcharts/amcharts5-fonts- NPM: Install the
Install amCharts 5 via NPM
masterThe easiest way to use amCharts 5 in your project is by installing the pre-built NPM package. This provides the compiled version of the library ready for use in modern web development workflows.
npm install @amcharts/amcharts5Install the amCharts 5 Geodata package
masterThe Geodata package contains map files used with
MapChart. You must also have the main@amcharts/amcharts5library installed to use these files.Using NPM
npm install @amcharts/amcharts5 npm install @amcharts/amcharts5-geodataUsing Yarn
yarn add @amcharts/amcharts5 yarn add @amcharts/amcharts5-geodataStandalone Installation
Download the package contents and place them into your local
amcharts5/geodatafolder.Use Disposers for memory management
masteramCharts 5 uses
Disposerobjects to manage the lifecycle of various resources (like series, axes, or graphics) and ensure they are properly cleaned up to prevent memory leaks.Disposer: The base class for managing disposables.ArrayDisposer: Manages a collection of disposables.MultiDisposer: Allows grouping multiple disposers.MutableValueDisposer: Manages a single value that can be updated.CounterDisposer: Manages disposables based on a count.
Third-party libraries used in amCharts 5 optional plugins
masterCertain optional plugins in amCharts 5 introduce additional third-party dependencies. These are typically used for specific features like PDF generation, Excel export, or annotation tools. The following libraries are used in these optional modules:
|Package|Copyright (c)|License| |-------|-------------|-------| |pdfmake|bpampuch|[License](https://github.com/bpampuch/pdfmake/blob/master/LICENSE)| |SheetJS js-xlsx|SheetJS LLC|[License](https://github.com/SheetJS/js-xlsx/blob/master/LICENSE)| |marker.js 2|Alan Mendelevich|[License](https://github.com/ailon/markerjs2/blob/master/LICENSE)|Third-party libraries used in amCharts 5 Core
masterThe amCharts 5 core package relies on several third-party libraries for its fundamental functionality, including D3 modules for various visualization logic, utility libraries for math and selection, and others. If you are auditing dependencies or concerned about license compliance for the core package, these are the libraries included:
|Package|Copyright (c)|License| |-------|-------------|-------| |d3|Mike Bostock|[License](https://github.com/d3/d3/blob/master/LICENSE)| |d3-chord|Mike Bostock|[License](https://github.com/d3/d3-fchord/blob/master/LICENSE)| |d3-geo|Mike Bostock|[License](https://github.com/d3/d3-geo/blob/master/LICENSE)| |d3-geo-projection|Mike Bostock|[License](https://github.com/d3/d3-geo-projection/blob/master/LICENSE)| |d3-force|Mike Bostock|[License](https://github.com/d3/d3-force/blob/master/LICENSE)| |d3-sankey|Mike Bostock|[License](https://github.com/d3/d3-sankey/blob/master/LICENSE)| |d3-selection|Mike Bostock|[License](https://github.com/d3/d3-selection/blob/main/LICENSE)| |d3-transition|Mike Bostock|[License](https://github.com/d3/d3-transition/blob/main/LICENSE)| |d3-voronoi-treemap|LEBEAU Franck|[License](https://github.com/Kcnarf/d3-voronoi-treemap/blob/master/LICENSE)| |flatpickr|Gregory Petrosyan|[License](https://github.com/flatpickr/flatpickr/blob/master/LICENSE.md)| |polylabel|Mapbox|[License](https://github.com/mapbox/polylabel/blob/master/LICENSE)| |seedrandom|David Bau|[License](https://github.com/davidbau/seedrandom?tab=readme-ov-file#license-mit)| |svg-arc-to-cubic-bezier|Colin Meinke|[License](https://github.com/colinmeinke/svg-arc-to-cubic-bezier/blob/master/LICENSE.md)| |tslib|Microsoft|[License](https://github.com/microsoft/tslib/blob/master/LICENSE.txt)|Configure Chart Themes
masterTheThemeclass allows you to define global styles and settings that apply to all chart components created within a specific context. Themes can be applied to aRootinstance to ensure visual consistency.