Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
echarts-for-vue
Advanced tools
简体中文 | English
📊📈 ECharts wrapper component for Vue 3, 2 and TypeScript
npm i -S echarts-for-vue
import { createApp, h } from 'vue';
import { plugin } from 'echarts-for-vue';
import * as echarts from 'echarts';
const app = createApp({ /*...*/ });
app.use(plugin, { echarts, h }); // use as a plugin
<template>
<ECharts ref="chart" :option="option" />
</template>
<script>
import { createComponent } from 'echarts-for-vue';
import * as echarts from 'echarts';
import { h } from 'vue';
export default {
components: {
ECharts: createComponent({ echarts, h }), // use as a component
},
data: () => ({
option: { /*...*/ },
}),
methods: {
doSomething() {
this.$refs.chart.inst.getWidth(); // call the method of ECharts instance
},
},
}
</script>
import Vue from 'vue';
import { plugin } from 'echarts-for-vue';
import * as echarts from 'echarts';
Vue.use(plugin, { echarts }); // use as a plugin
<template>
<ECharts ref="chart" :option="option" />
</template>
<script>
import { createComponent } from 'echarts-for-vue';
import * as echarts from 'echarts';
export default {
components: {
ECharts: createComponent({ echarts }), // use as a component
},
data: () => ({
option: { /*...*/ },
}),
methods: {
doSomething() {
this.$refs.chart.inst.getWidth(); // call the method of ECharts instance
},
},
}
</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 |
FAQs
ECharts wrapper component for Vue 3, 2 and TypeScript
We found that echarts-for-vue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.