!!!###!!!title=VChart Extended Theme Packages——VisActor/VChart tutorial documents!!!###!!!!!!###!!!description=- Repository Address: [https://github.com/VisActor/vchart-theme](https://github.com/VisActor/vchart-theme)VChart provides a set of ready-to-use theme extensions as separate packages. These themes are not bundled with VChart by default; you can import and register them on demand to quickly achieve attractive, scenario-appropriate chart styles with minimal effort.In addition, VChart offers dedicated theme packages for popular UI component libraries. These are introduced below.!!!###!!!

VChart Theme Extensions

VChart provides a set of ready-to-use theme extensions as separate packages. These themes are not bundled with VChart by default; you can import and register them on demand to quickly achieve attractive, scenario-appropriate chart styles with minimal effort.

In addition, VChart offers dedicated theme packages for popular UI component libraries. These are introduced below.

Extension Package @visactor/vchart-theme

The vchart-theme package includes several extended themes, provided as ITheme objects or static JSON assets.

Demo

Visit codesandbox for a live preview.

Installation

@visactor/vchart-theme

# npm
npm install @visactor/vchart-theme

# yarn
yarn add @visactor/vchart-theme

Usage

Register and use themes included in vchart-theme:

import { allThemeMap } from '@visactor/vchart-theme';
import VChart from '@visactor/vchart';

// register themes
allThemeMap.forEach((theme, name) => {
  VChart.ThemeManager.registerTheme(name, theme);
});

// apply a theme
VChart.ThemeManager.setCurrentTheme('vScreenVolcanoBlue');

If you only need a specific theme, you can import its JSON file directly from the package:

import vScreenVolcanoBlue from '@visactor/vchart-theme/public/vScreenVolcanoBlue.json';
import VChart from '@visactor/vchart';

// register the theme
VChart.ThemeManager.registerTheme('vScreenVolcanoBlue', vScreenVolcanoBlue);

// apply the theme
VChart.ThemeManager.setCurrentTheme('vScreenVolcanoBlue');

This package mainly includes the following theme JSON assets: