Show · Data Visualization
Data Visualization
Out-of-the-box multi-terminal charting library.
VisActor is an open-source visualization solution by ByteDance, and we recommend using its core chart component library called VChart for data visualization scenarios. It supports various types of charts, making it simple to use while offering powerful functionality.
Based on VChart, we have developed a customized chart library that adheres to the Semi style. The advantages are as follows:
  • 🧩 Out-of-the-box experience: It provides easy configuration and initialization, allowing you to start using it quickly.
  • 🎨 Consistent style: VChart has been customized to match the Semi design style. It is directly integrated with Semi Design Tokens. The default styles have undergone extensive verification, ensuring high readability and precision. Additionally, it supports user-defined chart styles.
  • 🌗 Responsive: VChart detects changes in the light and dark mode of the page and automatically updates the VChart charts on the page. It also synchronizes with the theme changes.

Installation and Usage

1、Installation

To install @visactor/react-vchart in a React project, you can use the following command:
Additionally, you need to install @visactor/vchart-semi-theme to adapt to the default theme of Semi or custom themes published through Semi DSM.

2、Usage

Starting from version v2.47.0, Semi introduced relevant Design Tokens to facilitate the adaptation of VChart to Semi themes or custom themes published through Semi DSM. Therefore, for version v2.47.0 and above, you only need to execute the initVChartSemiTheme method once globally for initialization. This statement is typically placed in the entry file of your React project. For example:
The initVChartSemiTheme method supports accepting an object as an option, with the following type declaration:
For versions of Semi below v2.47.0, although there are no corresponding Design Tokens, you can still utilize the default values of the built-in theme styles provided by @visactor/vchart-semi-theme. Please note that this usage does not support automatic switching between light and dark modes. Users can manually set the current chart mode as needed. Here's an example:
For more information about the theme package, please refer to @visactor/vchart-semi-theme
For drawing charts and more detailed instructions, please refer to VChart tutorial

Common Chart Types Examples

VChart is built on the visual grammar library VGrammar and the rendering engine VRender. It provides not only data presentation capabilities but also supports animated storytelling, rich interactivity, and customizable chart styles. The user-friendly configuration greatly reduces the learning curve.
VChart supports various different chart types, allowing users to visualize abstract data through simple configuration, including combination chart, line chart, area chart, bar/column chart, pie/doughnut chart, scatter plot, heat map, histogram, box plot, waterfall chart, progress bar, funnel chart, time series chart, interval column chart, interval area chart, word cloud, dashboard, treemap, Sankey diagram, rose chart, radar chart, map, circle packing, sunburst diagram, etc. For detailed chart examples, please refer to VChart Examples. Below are some showcases of VChart with Semi Design's default theme.

Bar chart

Basic bar chart

Grouped bar chart

Stacked bar chart

Percentage stacked bar chart

Line chart

Area chart

Pie Chart

Radar chart

Scatter chart

Design Guidelines

Usage Guide

In order to assist designers in selecting charts, we have conducted in-depth analyses of 11 commonly used chart types and summarized chart selection guidelines. Please refer to the Chart Selection Guidelines. for more details.

Color Specifications

@visactor/vchart-semi-theme defines color values for 20 discrete data palettes. The color values are sorted based on the principles of split complementary color schemes and alternating dark and light tones from the existing Semi color palette. For discrete data palettes, Semi Design has declared 20 tokens. If users need to customize the discrete data palettes, they can configure these tokens in the DSM when customizing the theme. The specific steps for generating color values are as follows:

Step1: Follow the split complementary color, generate the first version of the color palette

We refer to the classic color scheme theory and adopt the principle of split complementary color picking, and color picking is carried out in a group of three.
分裂取色

Step2: Base line correction, reduce ambiguity and improve contrast

  1. Avoid ambiguous colors such as red and green.
  2. To ensure discrimination and enhance color contrast, adjacent colors are adjusted to canary release according to the rhythm of "dark-light-dark-light".
基线矫正

Step3: Sensible adjustment to enhance visual aesthetics

In order to make the color system more harmonious, in addition to scientific theoretical support, aesthetic corrections need to be made in real business scenarios.
视觉美学

Step4: Expand the color palette to adapt to a wide range of scenarios

Based on the 10-color palette, we have expanded to 20-color palettes to adapt to a wider range of business scenarios.
Data Palettes
In VChart, there are various semantic colors applied to chart components, such as background color, border, slider, overlay, font, and text color. The @visactor/vchart-semi-theme package reads the token values of Semi CSS Variables on the body to automatically generate VChart chart themes. Generally, there is no need to consider this part of the specification separately. If you need to understand the detailed mapping of semantic colors, you can refer to the following two documents:

Design Token

Semi Design has declared 20 tokens for VChart, as shown in the table below.
Note
Prior to version 1.10.2 of @visactor/vchart-semi-theme, the tokens with names --semi-color-data-n (where n is 0, 2, 4, 6, 8, 10, 12, 14, 16, 18) were used as a 10-color palette. Starting from version 1.10.2 of @visactor/vchart-semi-theme, the tokens with names --semi-color-data-n (where n ranges from 0 to 9) are used as a 10-color palette.
For any questions, inquiries, or suggestions, you can join the VChart user group to provide feedback.
WeChat Official AccountLark user group