VChart/packages/vchart
xile611 188435ee6d
Some checks are pending
TEST CI / build (18.x) (push) Waiting to run
Merge pull request #3443 from VisActor/fix/box-plot-state
Fix/box plot state
2024-11-21 11:50:16 +08:00
..
__tests__ fix: fix the default type of scopeType 2024-11-15 16:19:30 +08:00
dist build: release version 1.12.12 2024-11-15 15:36:15 +00:00
scripts chore: enlarge bugserver trigger intercal 2024-09-05 16:22:22 +08:00
src Merge pull request #3443 from VisActor/fix/box-plot-state 2024-11-21 11:50:16 +08:00
.eslintignore Initial commit 2023-06-05 13:42:06 +08:00
.eslintrc.js
.size-limit.json
bundler.config.js fix: fix conflicts with 1.11.6 2024-06-28 21:53:25 +08:00
CHANGELOG.json build: release version 1.12.12 2024-11-15 15:36:15 +00:00
CHANGELOG.md build: release version 1.12.12 2024-11-15 15:36:15 +00:00
jest.config.js fix: label should not update when label is set in series, related #2928 2024-07-10 17:23:17 +08:00
package.json build: release version 1.12.12 2024-11-15 15:36:15 +00:00
README.md
rollup.config.js chore: update rollup.config.js to fix es5/index.js, fix #2971 2024-07-23 17:32:10 +08:00
setup-mock.js Initial commit 2023-06-05 13:42:06 +08:00
tsconfig.eslint.json
tsconfig.json
tsconfig.test.json

VChart

VChart is a charting component library in VisActor visualization system. It wraps the charting logic based on visual grammar library VGrammar and the component encapsulation based on visual rendering engine VRender. The core capabilities are as follows:

  1. Cross-platform: Automatically adapt to desktop, H5, and multiple small program environments
  2. Storytelling: Comprehensive annotation, animation, flow control, narrative templates, and other enhanced features for visual storytelling
  3. Scenes: Deliver visual storytelling capabilities to end-users, unlock developer productivity

🔨 Usage

📦 Installation

# npm
$ npm install @visactor/vchart

# yarn
$ yarn add @visactor/vchart

📊 A Chart Example

import VChart from '@visactor/vchart';

const spec = {
  type: 'bar',
  data: [
    {
      id: 'barData',
      values: [
        { month: 'Monday', sales: 22 },
        { month: 'Tuesday', sales: 13 },
        { month: 'Wednesday', sales: 25 },
        { month: 'Thursday', sales: 29 },
        { month: 'Friday', sales: 38 }
      ]
    }
  ],
  xField: 'month',
  yField: 'sales',
  crosshair: {
    xField: { visible: true }
  }
};

// 'chart' is the id of your dom container, such as <div id="chart"></chart>
const vchart = new VChart(spec, { dom: 'chart' });
vchart.renderAsync();

⌨️ Development

First of all, please install @microsoft/rush

$ npm i --global @microsoft/rush

Then clone locally:

# clone
$ git clone git@github.com:VisActor/VChart.git
$ cd VChart
# install dependencies
$ rush update
# start vchart development server
$ rush start
# the another way to start react-vchart development server
$ rush run -p @visactor/vchart -s start
# unit test
$ rush run -p @visactor/vchart -s test