Gathering detailed insights and metrics for echarts-for-vue
Gathering detailed insights and metrics for echarts-for-vue
Gathering detailed insights and metrics for echarts-for-vue
Gathering detailed insights and metrics for echarts-for-vue
📊 📈 ECharts wrapper component for Vue 3, 2 and TypeScript
npm install echarts-for-vue
Typescript
Module System
Node Version
NPM Version
52.7
Supply Chain
97.8
Quality
75.7
Maintenance
100
Vulnerability
99.3
License
JavaScript (54.41%)
TypeScript (31.1%)
Vue (9.01%)
HTML (5.47%)
Total Downloads
56,412
Last Day
3
Last Week
196
Last Month
785
Last Year
11,253
Apache-2.0 License
81 Stars
75 Commits
11 Forks
5 Watchers
2 Branches
1 Contributors
Updated on May 26, 2025
Minified
Minified + Gzipped
Latest Version
1.4.1
Package Id
echarts-for-vue@1.4.1
Unpacked Size
81.45 kB
Size
18.08 kB
File Count
14
NPM Version
6.14.13
Node Version
14.17.0
Cumulative downloads
Total Downloads
Last Day
-25%
3
Compared to previous day
Last Week
-1.5%
196
Compared to previous week
Last Month
-1.4%
785
Compared to previous month
Last Year
-5.1%
11,253
Compared to previous year
1
5
简体中文 | English
📊📈 ECharts wrapper component for Vue 3, 2 and TypeScript
npm i -S echarts-for-vue
1import { createApp, h } from 'vue'; 2import { plugin } from 'echarts-for-vue'; 3import * as echarts from 'echarts'; 4 5const app = createApp({ /*...*/ }); 6app.use(plugin, { echarts, h }); // use as a plugin
1<template> 2 <ECharts ref="chart" :option="option" /> 3</template> 4 5<script> 6 import { createComponent } from 'echarts-for-vue'; 7 import * as echarts from 'echarts'; 8 import { h } from 'vue'; 9 10 export default { 11 components: { 12 ECharts: createComponent({ echarts, h }), // use as a component 13 }, 14 data: () => ({ 15 option: { /*...*/ }, 16 }), 17 methods: { 18 doSomething() { 19 this.$refs.chart.inst.getWidth(); // call the method of ECharts instance 20 }, 21 }, 22 } 23</script>
1import Vue from 'vue'; 2import { plugin } from 'echarts-for-vue'; 3import * as echarts from 'echarts'; 4 5Vue.use(plugin, { echarts }); // use as a plugin
1<template> 2 <ECharts ref="chart" :option="option" /> 3</template> 4 5<script> 6 import { createComponent } from 'echarts-for-vue'; 7 import * as echarts from 'echarts'; 8 9 export default { 10 components: { 11 ECharts: createComponent({ echarts }), // use as a component 12 }, 13 data: () => ({ 14 option: { /*...*/ }, 15 }), 16 methods: { 17 doSomething() { 18 this.$refs.chart.inst.getWidth(); // call the method of ECharts instance 19 }, 20 }, 21 } 22</script>
Definition | Return | Description |
---|---|---|
createComponent (options: Options): object | Component definition object | Create a component |
plugin (app: Vue, options: Options): void | The installation method of plugin |
Property | Type | Default | Optional | Description |
---|---|---|---|---|
echarts | typeof echarts | The global object of ECharts library | ||
h | Function | ✔ | The method createElement of Vue (Required for Vue 3) | |
ResizeObserver | typeof ResizeObserver | window.ResizeObserver | ✔ | When the global ResizeObserver doesn't exist, the polyfill provides support |
name | string | "ECharts" | ✔ | The registered name of the component |
deepWatchOption | boolean | true | ✔ | deep watch prop "option" |
Name | Type | ReadOnly | Description |
---|---|---|---|
inst | ECharts | ✔ | ECharts instance |
Name | Type | Default | Reactive | Description |
---|---|---|---|---|
initTheme | object | string | ✔ | The parameter theme of echarts.init method, see | |
initOpts | object | ✔ | The parameter opts of echarts.init method, see | |
loading | boolean | false | ✔ | Shows loading animation |
loadingType | string | "default" | The parameter type of ECharts instance method showLoading , see | |
loadingOpts | EChartsLoadingOption | The parameter opts of ECharts instance method showLoading , see | ||
option | EChartOption | ✔ | The parameter option of ECharts instance method setOption , see | |
optionOpts | EChartsOptionConfig | The parameter opts of ECharts instance method setOption , see | ||
events | Arguments[] | An array element is the arguments of ECharts instance method on , see | ||
autoResize | boolean | true | ✔ | Auto resize |
Beyond the props
above, the remaining properties are passed to the root element of the component, such as style
, class
or onclick
Name | Description |
---|---|
resize | Trigger when chart is resized |
Definition | Description |
---|---|
setOption (option: EChartOption, opts?: EChartsOptionConfig): void | Call the method setOption of ECharts instance, see |
resize (): void | Resize chart (Based on the size of root element) |
addResizeListener (): void | Add "resize" listener |
removeResizeListener (): void | Remove "resize" listener |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
81 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More