vue-echarts 8.1.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -33
- package/README.zh-Hans.md +149 -34
- package/dist/graphic.d.ts +311 -2657
- package/dist/graphic.js +472 -291
- package/dist/graphic.js.map +1 -1
- package/dist/index-BujxhN-1.d.ts +108 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +472 -493
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/update-CWPvYl2M.js +239 -0
- package/dist/update-CWPvYl2M.js.map +1 -0
- package/package.json +22 -24
- package/dist/index-CeUofvRo.d.ts +0 -218
- package/dist/runtime-O1aCsxlc.js +0 -55
- package/dist/runtime-O1aCsxlc.js.map +0 -1
package/README.md
CHANGED
|
@@ -102,6 +102,14 @@ But if you really want to import the whole ECharts bundle without having to impo
|
|
|
102
102
|
import "echarts";
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
#### Styles
|
|
106
|
+
|
|
107
|
+
When Vue ECharts is imported in a browser, it injects its base styles into the global document, so no CSS import is normally required. For a shadow root or another document, include `vue-echarts/style.css` in that styling scope; see [CSP](#csp-style-src-or-style-src-elem) for the fallback required by older browsers.
|
|
108
|
+
|
|
109
|
+
### Server-side rendering
|
|
110
|
+
|
|
111
|
+
`VChart` can be rendered and hydrated by Vue SSR frameworks. The server renders only the chart container; ECharts initializes after the component mounts in the browser. The low-level ECharts `ssr` field in `init-options` does not enable server-side chart rendering in `VChart`.
|
|
112
|
+
|
|
105
113
|
### CDN
|
|
106
114
|
|
|
107
115
|
Drop `<script>` inside your HTML file and access the component via `window.VueECharts`.
|
|
@@ -113,8 +121,8 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
|
|
|
113
121
|
|
|
114
122
|
```html
|
|
115
123
|
<script src="https://cdn.jsdelivr.net/npm/echarts@6.1.0"></script>
|
|
116
|
-
<script src="https://cdn.jsdelivr.net/npm/vue@3.5.
|
|
117
|
-
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@8.
|
|
124
|
+
<script src="https://cdn.jsdelivr.net/npm/vue@3.5.41"></script>
|
|
125
|
+
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@8.3.0"></script>
|
|
118
126
|
```
|
|
119
127
|
|
|
120
128
|
<!-- scripts:end -->
|
|
@@ -142,16 +150,27 @@ See more examples [here](https://github.com/ecomfe/vue-echarts/tree/main/demo).
|
|
|
142
150
|
|
|
143
151
|
Theme to be applied. See `echarts.init`'s `theme` parameter [here →](https://echarts.apache.org/en/api.html#echarts.init)
|
|
144
152
|
|
|
153
|
+
Pass an empty string to use ECharts' default theme while overriding an injected theme.
|
|
154
|
+
|
|
155
|
+
ECharts recreates its model when changing themes. Vue ECharts reapplies the latest automatic option, but uncontrolled interaction state (such as legend selection or data zoom) may reset. Keep state that must survive a rebuild in `option`.
|
|
156
|
+
|
|
145
157
|
Injection key: `THEME_KEY`.
|
|
146
158
|
|
|
147
159
|
- `option: object`
|
|
148
160
|
|
|
149
161
|
ECharts' universal interface. Modifying this prop triggers Vue ECharts to compute an update plan and call `setOption`. Read more [here →](https://echarts.apache.org/en/option.html)
|
|
162
|
+
Temporarily removing the prop pauses automatic updates without letting a later theme change roll the chart back to its initial option.
|
|
150
163
|
|
|
151
164
|
#### Smart update
|
|
152
|
-
|
|
165
|
+
|
|
166
|
+
Reactive updates describe the complete configuration. Vue ECharts preserves existing models where merging can apply that configuration, and rebuilds when necessary to remove stale settings. A rebuild can reset interaction state such as legend selections and data zoom.
|
|
167
|
+
|
|
168
|
+
- If you supply `update-options` (via prop or injection), Vue ECharts forwards it directly to `setOption` and skips the planner. After you remove it, the first smart source-option update rebuilds once to establish a safe structural baseline.
|
|
169
|
+
- A failed option or theme submission invalidates that baseline. The next smart update rebuilds instead of trusting a potentially partial update.
|
|
170
|
+
- Automatic option, theme, and slot changes are batched after Vue updates. `clear()` takes effect immediately and cancels already queued automatic work; later changes can populate the chart again.
|
|
153
171
|
- Manual `setOption` calls (only available when `manual-update` is `true`) behave like native ECharts, honouring only the per-call override you pass in and are not carried across re-initializations.
|
|
154
|
-
-
|
|
172
|
+
- Updates containing a graphic element `$action` keep normal merge for `graphic` so the command can target the existing element tree; safe removals of unrelated components still use `replaceMerge`. Changes requiring a full rebuild cannot be applied together with these commands. For complete snapshot semantics, describe the resulting graphic tree without `$action` commands.
|
|
173
|
+
- Otherwise, Vue ECharts analyses the change: component removals, reordering, and deletions inside anonymous components use `replaceMerge` when it can reproduce the requested order; deletions inside ID-matched components, identity ordering that `replaceMerge` cannot reproduce, newly introduced or shrinking non-component arrays, first-time ARIA configuration, and other risky changes fall back to `notMerge: true`.
|
|
155
174
|
|
|
156
175
|
- `update-options: object`
|
|
157
176
|
|
|
@@ -165,21 +184,44 @@ See more examples [here](https://github.com/ecomfe/vue-echarts/tree/main/demo).
|
|
|
165
184
|
|
|
166
185
|
- `autoresize: boolean | { throttle?: number, onResize?: () => void }` (default: `false`)
|
|
167
186
|
|
|
168
|
-
Whether the chart
|
|
187
|
+
Whether to resize the chart automatically when its rendering container changes size. Use the options object to specify a custom throttle delay (in milliseconds) and/or an extra resize callback function. Zero-sized containers are not resized; the configured throttle also applies when they recover.
|
|
169
188
|
|
|
170
189
|
- `loading: boolean` (default: `false`)
|
|
171
190
|
|
|
172
191
|
Whether the chart is in loading state.
|
|
173
192
|
|
|
193
|
+
- `loading-type: string`
|
|
194
|
+
|
|
195
|
+
Name of the registered loading effect. It is passed as the first argument to `echartsInstance.showLoading`; omit it to use the default effect.
|
|
196
|
+
|
|
174
197
|
- `loading-options: object`
|
|
175
198
|
|
|
176
|
-
Configuration item of loading animation.
|
|
199
|
+
Configuration item of loading animation. Default-effect fields are typed explicitly, and additional fields for custom effects are forwarded to `echartsInstance.showLoading`. See its `opts` parameter [here →](https://echarts.apache.org/en/api.html#echartsInstance.showLoading)
|
|
177
200
|
|
|
178
201
|
Injection key: `LOADING_OPTIONS_KEY`.
|
|
179
202
|
|
|
180
203
|
- `manual-update: boolean` (default: `false`)
|
|
181
204
|
|
|
182
|
-
Handy for performance-sensitive charts (large or high-frequency updates). When set to `true`, Vue
|
|
205
|
+
Handy for performance-sensitive charts (large or high-frequency updates). When set to `true`, Vue uses the `option` prop for the initial render but does not deeply observe it afterwards; later prop changes do nothing and you must drive updates via `setOption` on a template ref. The component-managed initial render still honors `update-options`, while later manual calls use only their per-call arguments. If `autoresize` defers that first render and you successfully call `setOption` first, the manual call takes precedence. If the chart re-initializes (for example due to `init-options` changes, flipping `manual-update`, or a remount), the manual state is discarded and the chart is rendered again from the current `option` value.
|
|
206
|
+
|
|
207
|
+
#### TypeScript
|
|
208
|
+
|
|
209
|
+
Component-specific prop types are available from the package root:
|
|
210
|
+
|
|
211
|
+
```ts
|
|
212
|
+
import type { AutoResize, LoadingOptions } from "vue-echarts";
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
For a typed template ref:
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
import VChart from "vue-echarts";
|
|
219
|
+
import { ref } from "vue";
|
|
220
|
+
|
|
221
|
+
const chart = ref<InstanceType<typeof VChart> | null>(null);
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Vue 3.5's `useTemplateRef` can infer this type automatically.
|
|
183
225
|
|
|
184
226
|
### Events
|
|
185
227
|
|
|
@@ -192,9 +234,9 @@ You can bind events with Vue's `v-on` directive.
|
|
|
192
234
|
```
|
|
193
235
|
|
|
194
236
|
> [!NOTE]
|
|
195
|
-
>
|
|
237
|
+
> ECharts and ZRender events only support the `.once` modifier; other modifiers are specific to DOM events. Listeners using the `native:` prefix support Vue's normal DOM event modifiers.
|
|
196
238
|
|
|
197
|
-
Vue ECharts
|
|
239
|
+
Vue ECharts supports the following events:
|
|
198
240
|
|
|
199
241
|
- `highlight` [→](https://echarts.apache.org/en/api.html#events.highlight)
|
|
200
242
|
- `downplay` [→](https://echarts.apache.org/en/api.html#events.downplay)
|
|
@@ -207,6 +249,13 @@ Vue ECharts support the following events:
|
|
|
207
249
|
- `legendscroll` [→](https://echarts.apache.org/en/api.html#events.legendscroll)
|
|
208
250
|
- `datazoom` [→](https://echarts.apache.org/en/api.html#events.datazoom)
|
|
209
251
|
- `datarangeselected` [→](https://echarts.apache.org/en/api.html#events.datarangeselected)
|
|
252
|
+
- `graphroam` [→](https://echarts.apache.org/en/api.html#events.graphroam)
|
|
253
|
+
- `georoam` [→](https://echarts.apache.org/en/api.html#events.georoam)
|
|
254
|
+
- `treeroam` [→](https://echarts.apache.org/en/api.html#events.treeroam)
|
|
255
|
+
- `sankeyroam` [→](https://echarts.apache.org/en/api.html#events.sankeyroam)
|
|
256
|
+
- `focusnodeadjacency`, `unfocusnodeadjacency` (legacy graph adjacency focus actions)
|
|
257
|
+
- `dragnode` [→](https://echarts.apache.org/en/api.html#events.dragnode)
|
|
258
|
+
- `treeexpandandcollapse` [→](https://echarts.apache.org/en/api.html#events.treeexpandandcollapse)
|
|
210
259
|
- `timelinechanged` [→](https://echarts.apache.org/en/api.html#events.timelinechanged)
|
|
211
260
|
- `timelineplaychanged` [→](https://echarts.apache.org/en/api.html#events.timelineplaychanged)
|
|
212
261
|
- `restore` [→](https://echarts.apache.org/en/api.html#events.restore)
|
|
@@ -215,11 +264,16 @@ Vue ECharts support the following events:
|
|
|
215
264
|
- `geoselectchanged` [→](https://echarts.apache.org/en/api.html#events.geoselectchanged)
|
|
216
265
|
- `geoselected` [→](https://echarts.apache.org/en/api.html#events.geoselected)
|
|
217
266
|
- `geounselected` [→](https://echarts.apache.org/en/api.html#events.geounselected)
|
|
267
|
+
- `axisbreakchanged` [→](https://echarts.apache.org/en/api.html#events.axisbreakchanged)
|
|
218
268
|
- `axisareaselected` [→](https://echarts.apache.org/en/api.html#events.axisareaselected)
|
|
219
269
|
- `brush` [→](https://echarts.apache.org/en/api.html#events.brush)
|
|
220
|
-
- `
|
|
270
|
+
- `brushend` [→](https://echarts.apache.org/en/api.html#events.brushEnd)
|
|
221
271
|
- `brushselected` [→](https://echarts.apache.org/en/api.html#events.brushselected)
|
|
272
|
+
- `showtip` [→](https://echarts.apache.org/en/api.html#action.tooltip.showTip)
|
|
273
|
+
- `hidetip` [→](https://echarts.apache.org/en/api.html#action.tooltip.hideTip)
|
|
274
|
+
- `updateaxispointer` [→](https://echarts.apache.org/en/api.html#action.axisPointer.updateAxisPointer)
|
|
222
275
|
- `globalcursortaken` [→](https://echarts.apache.org/en/api.html#events.globalcursortaken)
|
|
276
|
+
- `updated` (after an ECharts update completes)
|
|
223
277
|
- `rendered` [→](https://echarts.apache.org/en/api.html#events.rendered)
|
|
224
278
|
- `finished` [→](https://echarts.apache.org/en/api.html#events.finished)
|
|
225
279
|
- Mouse events
|
|
@@ -234,11 +288,22 @@ Vue ECharts support the following events:
|
|
|
234
288
|
- `contextmenu` [→](https://echarts.apache.org/en/api.html#events.Mouse%20events.contextmenu)
|
|
235
289
|
- ZRender events
|
|
236
290
|
- `zr:click`
|
|
237
|
-
- `zr:mousedown`
|
|
238
|
-
- `zr:mouseup`
|
|
239
|
-
- `zr:mousewheel`
|
|
240
291
|
- `zr:dblclick`
|
|
292
|
+
- `zr:mouseout`
|
|
293
|
+
- `zr:mouseover`
|
|
294
|
+
- `zr:mouseup`
|
|
295
|
+
- `zr:mousedown`
|
|
296
|
+
- `zr:mousemove`
|
|
241
297
|
- `zr:contextmenu`
|
|
298
|
+
- `zr:globalout`
|
|
299
|
+
- `zr:mousewheel`
|
|
300
|
+
- `zr:drag`
|
|
301
|
+
- `zr:dragstart`
|
|
302
|
+
- `zr:dragend`
|
|
303
|
+
- `zr:dragenter`
|
|
304
|
+
- `zr:dragleave`
|
|
305
|
+
- `zr:dragover`
|
|
306
|
+
- `zr:drop`
|
|
242
307
|
|
|
243
308
|
See supported events in the [ECharts API reference →](https://echarts.apache.org/en/api.html#events)
|
|
244
309
|
|
|
@@ -252,12 +317,18 @@ As Vue ECharts binds events to the ECharts instance by default, there is some ca
|
|
|
252
317
|
</template>
|
|
253
318
|
```
|
|
254
319
|
|
|
255
|
-
|
|
320
|
+
Case-sensitive custom events are supported by writing their exact name after `native:`, for example `@native:ChartReady`.
|
|
321
|
+
|
|
322
|
+
Event handlers passed via attrs are reactive by default. Updates to `onClick`, `onZr:*`, or `onNative:*` handlers take effect automatically.
|
|
323
|
+
Multiword handlers accept idiomatic camel case, such as `onDataZoom`, `onBrushEnd`, and `onZr:mouseMove`; existing forms such as `onDatazoom`, `onBrushend`, and `onZr:mousemove` remain supported.
|
|
256
324
|
|
|
257
325
|
### Provide / inject
|
|
258
326
|
|
|
259
327
|
Vue ECharts provides provide/inject API for `theme`, `init-options`, `update-options` and `loading-options` to help configuring contextual options. eg. for `theme` you can use the provide API like this:
|
|
260
328
|
|
|
329
|
+
Explicit props take precedence over injected values.
|
|
330
|
+
Reactive providers may resolve to `null` or `undefined` while a contextual value is unavailable.
|
|
331
|
+
|
|
261
332
|
<details>
|
|
262
333
|
<summary>Composition API</summary>
|
|
263
334
|
|
|
@@ -280,56 +351,87 @@ provide(THEME_KEY, () => theme.value);
|
|
|
280
351
|
<details>
|
|
281
352
|
<summary>Options API</summary>
|
|
282
353
|
|
|
354
|
+
Static value:
|
|
355
|
+
|
|
283
356
|
```js
|
|
284
|
-
import { THEME_KEY } from
|
|
285
|
-
import { computed } from 'vue'
|
|
357
|
+
import { THEME_KEY } from "vue-echarts";
|
|
286
358
|
|
|
287
359
|
export default {
|
|
288
|
-
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
360
|
+
provide: {
|
|
361
|
+
[THEME_KEY]: "dark",
|
|
362
|
+
},
|
|
363
|
+
};
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
Reactive value:
|
|
367
|
+
|
|
368
|
+
```js
|
|
369
|
+
import { THEME_KEY } from "vue-echarts";
|
|
370
|
+
import { computed } from "vue";
|
|
294
371
|
|
|
295
|
-
// Or make injections reactive
|
|
296
372
|
export default {
|
|
297
373
|
data() {
|
|
298
374
|
return {
|
|
299
|
-
theme:
|
|
300
|
-
}
|
|
375
|
+
theme: "dark",
|
|
376
|
+
};
|
|
301
377
|
},
|
|
302
378
|
provide() {
|
|
303
379
|
return {
|
|
304
|
-
[THEME_KEY]: computed(() => this.theme)
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
380
|
+
[THEME_KEY]: computed(() => this.theme),
|
|
381
|
+
};
|
|
382
|
+
},
|
|
383
|
+
};
|
|
308
384
|
```
|
|
309
385
|
|
|
310
386
|
</details>
|
|
311
387
|
|
|
388
|
+
### Properties
|
|
389
|
+
|
|
390
|
+
- `chart: ECharts | undefined`
|
|
391
|
+
|
|
392
|
+
The current underlying ECharts instance. This property is read-only and changes when the component re-initializes the chart; it becomes `undefined` after disposal. Prefer the methods below for supported operations. Direct option mutations are not tracked by the smart updater, so use `manual-update` when driving `setOption` imperatively.
|
|
393
|
+
|
|
394
|
+
- `root: HTMLElement | undefined`
|
|
395
|
+
|
|
396
|
+
The component's read-only `<x-vue-echarts>` root element, available after mounting.
|
|
397
|
+
|
|
312
398
|
### Methods
|
|
313
399
|
|
|
314
400
|
- `setOption` [→](https://echarts.apache.org/en/api.html#echartsInstance.setOption)
|
|
315
401
|
- `getWidth` [→](https://echarts.apache.org/en/api.html#echartsInstance.getWidth)
|
|
316
402
|
- `getHeight` [→](https://echarts.apache.org/en/api.html#echartsInstance.getHeight)
|
|
317
403
|
- `getDom` [→](https://echarts.apache.org/en/api.html#echartsInstance.getDom)
|
|
404
|
+
- `getZr` [→](https://echarts.apache.org/en/api.html#echartsInstance.getZr)
|
|
405
|
+
- `getId` [→](https://echarts.apache.org/en/api.html#echartsInstance.getId)
|
|
318
406
|
- `getOption` [→](https://echarts.apache.org/en/api.html#echartsInstance.getOption)
|
|
407
|
+
- `isSSR` [→](https://echarts.apache.org/en/api.html#echartsInstance.isSSR)
|
|
408
|
+
- `getDevicePixelRatio` [→](https://echarts.apache.org/en/api.html#echartsInstance.getDevicePixelRatio)
|
|
319
409
|
- `resize` [→](https://echarts.apache.org/en/api.html#echartsInstance.resize)
|
|
410
|
+
- `makeActionFromEvent` [→](https://echarts.apache.org/en/api.html#echartsInstance.makeActionFromEvent)
|
|
320
411
|
- `dispatchAction` [→](https://echarts.apache.org/en/api.html#echartsInstance.dispatchAction)
|
|
412
|
+
- `updateLabelLayout` [→](https://echarts.apache.org/en/api.html#echartsInstance.updateLabelLayout)
|
|
321
413
|
- `convertToPixel` [→](https://echarts.apache.org/en/api.html#echartsInstance.convertToPixel)
|
|
414
|
+
- `convertToLayout` [→](https://echarts.apache.org/en/api.html#echartsInstance.convertToLayout)
|
|
322
415
|
- `convertFromPixel` [→](https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel)
|
|
323
416
|
- `containPixel` [→](https://echarts.apache.org/en/api.html#echartsInstance.containPixel)
|
|
417
|
+
- `getVisual` [→](https://echarts.apache.org/en/api.html#echartsInstance.getVisual)
|
|
418
|
+
- `renderToCanvas` [→](https://echarts.apache.org/en/api.html#echartsInstance.renderToCanvas)
|
|
419
|
+
- `renderToSVGString` [→](https://echarts.apache.org/en/api.html#echartsInstance.renderToSVGString)
|
|
420
|
+
- `getSvgDataURL` [→](https://echarts.apache.org/en/api.html#echartsInstance.getSvgDataURL)
|
|
324
421
|
- `getDataURL` [→](https://echarts.apache.org/en/api.html#echartsInstance.getDataURL)
|
|
325
422
|
- `getConnectedDataURL` [→](https://echarts.apache.org/en/api.html#echartsInstance.getConnectedDataURL)
|
|
423
|
+
- `appendData` [→](https://echarts.apache.org/en/api.html#echartsInstance.appendData)
|
|
326
424
|
- `clear` [→](https://echarts.apache.org/en/api.html#echartsInstance.clear)
|
|
425
|
+
- `isDisposed` [→](https://echarts.apache.org/en/api.html#echartsInstance.isDisposed)
|
|
327
426
|
- `dispose` [→](https://echarts.apache.org/en/api.html#echartsInstance.dispose)
|
|
328
427
|
|
|
428
|
+
`dispose` is terminal for the current component instance. Use it instead of calling `dispose` on
|
|
429
|
+
the raw `chart` instance; remount the component to initialize a new chart.
|
|
430
|
+
|
|
329
431
|
> [!NOTE]
|
|
330
432
|
> The following ECharts instance methods aren't exposed because their functionality is already provided by component [props](#props):
|
|
331
433
|
>
|
|
332
|
-
> - [`showLoading`](https://echarts.apache.org/en/api.html#echartsInstance.showLoading) / [`hideLoading`](https://echarts.apache.org/en/api.html#echartsInstance.hideLoading): use the `loading` and `loading-options` props instead.
|
|
434
|
+
> - [`showLoading`](https://echarts.apache.org/en/api.html#echartsInstance.showLoading) / [`hideLoading`](https://echarts.apache.org/en/api.html#echartsInstance.hideLoading): use the `loading`, `loading-type` and `loading-options` props instead.
|
|
333
435
|
> - [`setTheme`](https://echarts.apache.org/en/api.html#echartsInstance.setTheme): use the `theme` prop instead.
|
|
334
436
|
|
|
335
437
|
### Slots
|
|
@@ -345,16 +447,21 @@ Vue ECharts supports three slot categories:
|
|
|
345
447
|
These naming rules apply to callback slots only. The graphic slot name is always `#graphic`.
|
|
346
448
|
|
|
347
449
|
- Slot names begin with `tooltip`/`dataView`, followed by hyphen-separated path segments to the target.
|
|
348
|
-
-
|
|
450
|
+
- If `tooltip` or `toolbox` is an array, place its numeric component index immediately after the slot prefix; any remaining segments still locate the owning option.
|
|
451
|
+
- Each non-empty segment corresponds to an `option` property name or an array index (for arrays, use the numeric index).
|
|
452
|
+
- Array segments are patched only when the corresponding array entries already exist; callback slots do not create missing component or data arrays.
|
|
453
|
+
- The reserved JavaScript path segment `__proto__` is rejected.
|
|
349
454
|
- The constructed slot name maps directly to the nested callback it overrides.
|
|
350
455
|
|
|
351
456
|
**Example mappings**:
|
|
352
457
|
|
|
353
458
|
- `tooltip` → `option.tooltip.formatter`
|
|
459
|
+
- `tooltip-0` → `option.tooltip[0].formatter`
|
|
354
460
|
- `tooltip-baseOption` → `option.baseOption.tooltip.formatter`
|
|
355
461
|
- `tooltip-xAxis-1` → `option.xAxis[1].tooltip.formatter`
|
|
356
462
|
- `tooltip-series-2-data-4` → `option.series[2].data[4].tooltip.formatter`
|
|
357
463
|
- `dataView` → `option.toolbox.feature.dataView.optionToContent`
|
|
464
|
+
- `dataView-1` → `option.toolbox[1].feature.dataView.optionToContent`
|
|
358
465
|
- `dataView-media-1-option` → `option.media[1].option.toolbox.feature.dataView.optionToContent`
|
|
359
466
|
|
|
360
467
|
The slot props correspond to the first parameter of the callback function.
|
|
@@ -407,6 +514,8 @@ The slot props correspond to the first parameter of the callback function.
|
|
|
407
514
|
|
|
408
515
|
> [!NOTE]
|
|
409
516
|
> Slots take precedence over the corresponding callback defined in `props.option`.
|
|
517
|
+
> Removing a callback slot explicitly clears its injected function without rebuilding the chart.
|
|
518
|
+
> After adding or removing a callback slot in `manual-update` mode, call `chartRef.setOption(...)` to submit the latest slot set.
|
|
410
519
|
|
|
411
520
|
#### Graphic slot <sup><a href="#slots"><img src="https://img.shields.io/badge/new-A855F7" alt="new" align="middle" height="16"></a></sup>
|
|
412
521
|
|
|
@@ -419,6 +528,7 @@ Available components:
|
|
|
419
528
|
- `GGroup`
|
|
420
529
|
- `GRect`
|
|
421
530
|
- `GCircle`
|
|
531
|
+
- `GEllipse`
|
|
422
532
|
- `GText`
|
|
423
533
|
- `GLine`
|
|
424
534
|
- `GPolyline`
|
|
@@ -428,7 +538,6 @@ Available components:
|
|
|
428
538
|
- `GRing`
|
|
429
539
|
- `GArc`
|
|
430
540
|
- `GBezierCurve`
|
|
431
|
-
- `GCompoundPath`
|
|
432
541
|
|
|
433
542
|
Read more at [ECharts `option.graphic` →](https://echarts.apache.org/en/option.html#graphic)
|
|
434
543
|
|
|
@@ -436,7 +545,12 @@ Read more at [ECharts `option.graphic` →](https://echarts.apache.org/en/option
|
|
|
436
545
|
>
|
|
437
546
|
> - Graphic element events additionally support `dblclick` and `contextmenu`.
|
|
438
547
|
> - Event listeners support the `.once` modifier.
|
|
548
|
+
> - Returning `true` from a graphic element listener stops the event from bubbling.
|
|
549
|
+
> - Path components accept `auto-batch` to opt into ZRender's Canvas path batching.
|
|
550
|
+
> - The `option` prop may be omitted for graphic-only charts.
|
|
439
551
|
> - `#graphic` overrides `option.graphic`. In `manual-update` mode, call `chartRef.setOption(...)` to apply changes.
|
|
552
|
+
> - Wrapper components and Fragments preserve their rendered graphic order. Compatible property changes update only changed elements, preserving unchanged elements and their running animations. Removing fields, changing types, or changing tree structure rebuilds the graphic component.
|
|
553
|
+
> - Graphic-only changes omit unrelated source options when safe. Explicit `notMerge` or `replaceMerge` targeting other components still submits the full source option.
|
|
440
554
|
|
|
441
555
|
<details>
|
|
442
556
|
<summary>Usage</summary>
|
|
@@ -469,7 +583,7 @@ function onDrag(event: ElementEvent) {
|
|
|
469
583
|
:x="10"
|
|
470
584
|
:y="8"
|
|
471
585
|
:text="`x: ${Math.round(overlay.x)} y: ${Math.round(overlay.y)}`"
|
|
472
|
-
|
|
586
|
+
fill="#fff"
|
|
473
587
|
/>
|
|
474
588
|
</GGroup>
|
|
475
589
|
</template>
|
|
@@ -485,6 +599,10 @@ Static methods can be accessed from [`echarts` itself](https://echarts.apache.or
|
|
|
485
599
|
|
|
486
600
|
## CSP: `style-src` or `style-src-elem`
|
|
487
601
|
|
|
602
|
+
Vue ECharts injects its base styles into the global document when its module is evaluated. Shadow
|
|
603
|
+
roots and other documents do not receive these styles; include `vue-echarts/style.css` in each
|
|
604
|
+
target styling scope when needed.
|
|
605
|
+
|
|
488
606
|
If you are **both** enforcing a strict CSP that prevents inline `<style>` injection and targeting browsers that don't support the [CSSStyleSheet() constructor](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/CSSStyleSheet#browser_compatibility), you need to manually include `vue-echarts/style.css`.
|
|
489
607
|
|
|
490
608
|
## Migration to v8
|