Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yassilah/echarts-fabric
https://github.com/yassilah/echarts-fabric
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yassilah/echarts-fabric
- Owner: yassilah
- License: mit
- Created: 2021-01-11T09:46:40.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-11T09:48:40.000Z (almost 4 years ago)
- Last Synced: 2024-03-09T09:09:58.244Z (10 months ago)
- Language: TypeScript
- Size: 1.09 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# Echarts + fabric.js = ❤️
This package allows you to include charts (using Echarts) into your fabric canvases with support for all features (e.g. events, rotation, scale, etc.).
![](demo.gif)
## Installation
```
yarn add echarts-fabric
```# Usage
You can use the regular API from both those great libraries as you would normally. Each fabric.Chart object has an extra "chart" propeprty where you can set your Echarts options (see below).
If using a custom fabric instance, please use the export "install" method.
```js
import { fabric } from 'fabric'
import { install } from 'echarts-fabric'install(fabric)
```Else, simply import the plugin.
```js
import fabric from 'fabric'
import 'echarts-fabric'const instance = new fabric.Canvas('#canvas')
instance.add(new fabric.Chart({ width: 100, height: 100, chart: { ... })
```