Skip to content

Commit 0571a78

Browse files
committed
release: 1.11.0
1 parent 8ab0a80 commit 0571a78

File tree

8 files changed

+74
-25
lines changed

8 files changed

+74
-25
lines changed

README.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,11 @@ The default entry (`vue3-apexcharts`) bundles the full ApexCharts library. If yo
256256
```js
257257
import VueApexCharts from "vue3-apexcharts/core";
258258

259-
// Import only the chart types you need
260-
import "apexcharts/bar";
259+
// Import by the exact chart type name you use in :type or chart.type
261260
import "apexcharts/line";
261+
import "apexcharts/bar";
262+
import "apexcharts/donut";
263+
import "apexcharts/treemap";
262264

263265
// Import only the features you need
264266
import "apexcharts/features/legend";
@@ -268,9 +270,32 @@ const app = createApp(App);
268270
app.use(VueApexCharts);
269271
```
270272

271-
The core entry imports ApexCharts from `apexcharts/core`, which is the bare class with only tooltip included. You must explicitly import the chart types and optional features your app uses:
273+
The core entry imports ApexCharts from `apexcharts/core`, which is the bare class with only tooltip included. You must explicitly import the chart types and optional features your app uses.
272274

273-
**Chart types:** `apexcharts/line`, `apexcharts/bar`, `apexcharts/pie`, `apexcharts/heatmap`, `apexcharts/candlestick`, `apexcharts/radial`, etc.
275+
Each chart type has its own import that matches the type name you pass to the component — no need to know which internal module it maps to:
276+
277+
**Chart types:**
278+
279+
| Import | type string |
280+
|--------|-------------|
281+
| `apexcharts/line` | `"line"` |
282+
| `apexcharts/area` | `"area"` |
283+
| `apexcharts/scatter` | `"scatter"` |
284+
| `apexcharts/bubble` | `"bubble"` |
285+
| `apexcharts/rangeArea` | `"rangeArea"` |
286+
| `apexcharts/bar` | `"bar"` |
287+
| `apexcharts/column` | `"column"` |
288+
| `apexcharts/barStacked` | `"barStacked"` |
289+
| `apexcharts/rangeBar` | `"rangeBar"` |
290+
| `apexcharts/pie` | `"pie"` |
291+
| `apexcharts/donut` | `"donut"` |
292+
| `apexcharts/polarArea` | `"polarArea"` |
293+
| `apexcharts/radialBar` | `"radialBar"` |
294+
| `apexcharts/radar` | `"radar"` |
295+
| `apexcharts/candlestick` | `"candlestick"` |
296+
| `apexcharts/boxPlot` | `"boxPlot"` |
297+
| `apexcharts/heatmap` | `"heatmap"` |
298+
| `apexcharts/treemap` | `"treemap"` |
274299

275300
**Optional features:**
276301
| Import | Description |
@@ -283,6 +308,28 @@ The core entry imports ApexCharts from `apexcharts/core`, which is the bare clas
283308

284309
> **Note:** Tree-shaking requires ApexCharts v5.8.1+.
285310
311+
### Vite: preventing "chart type X is not registered" errors
312+
313+
Vite's dependency pre-bundler can create two separate copies of the ApexCharts module — one for `apexcharts/core` and separate ones for each sub-entry — causing registrations to be lost. If you see this error even though you have the correct imports, add your apexcharts entries to `optimizeDeps.include`:
314+
315+
```js
316+
// vite.config.js
317+
export default {
318+
optimizeDeps: {
319+
include: [
320+
'apexcharts/core',
321+
'apexcharts/line',
322+
'apexcharts/bar',
323+
// ...all apexcharts/* entries you import
324+
'apexcharts/features/legend',
325+
'apexcharts/features/toolbar',
326+
],
327+
},
328+
}
329+
```
330+
331+
This forces Vite to pre-bundle all sub-entries together so they share a single ApexCharts instance and all registrations are preserved.
332+
286333
## Server-Side Rendering (SSR)
287334

288335
Vue3-ApexCharts includes dedicated components for SSR that work with Nuxt 3 and other Vue SSR frameworks.

demo/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"apexcharts": "^5.9.0",
13+
"apexcharts": "^5.10.0",
1414
"vue": "^3.5.0",
1515
"vue-router": "^4.4.0"
1616
},
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var De = Object.defineProperty, Te = Object.defineProperties, Me = Object.getOwn
2222
r((e = e.apply(A, t)).next());
2323
});
2424
/*!
25-
* ApexCharts v5.8.2-beta.1
25+
* ApexCharts v5.10.0
2626
* (c) 2018-2026 ApexCharts
2727
*/
2828
class B {
@@ -8442,7 +8442,8 @@ function Q(A) {
84428442
const t = xe[A];
84438443
if (!t)
84448444
throw new Error(
8445-
`ApexCharts: chart type "${A}" is not registered. Import it via ApexCharts.use() or use the full apexcharts bundle.`
8445+
`ApexCharts: chart type "${A}" is not registered. Import it via ApexCharts.use() or use the full apexcharts bundle.
8446+
If you already imported the entry (e.g. 'apexcharts/${A}'), your bundler may have created two separate copies of the ApexCharts module so the registration was lost. Add all apexcharts sub-entries to your bundler's deduplication config — for Vite add them to optimizeDeps.include in vite.config.`
84468447
);
84478448
return t;
84488449
}

dist/vue3-apexcharts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ const C = [
209209
const s = w("");
210210
return W(async () => {
211211
try {
212-
const { default: r } = await import("./apexcharts.ssr.esm-142aa21d.js"), n = Object.assign({}, t.options, {
212+
const { default: r } = await import("./apexcharts.ssr.esm-fe46cd2d.js"), n = Object.assign({}, t.options, {
213213
chart: Object.assign({}, t.options.chart, {
214214
type: t.type,
215215
width: t.width,
@@ -251,7 +251,7 @@ const M = /* @__PURE__ */ oe(ae, [["render", se]]), P = A({
251251
let s = [];
252252
L(async () => {
253253
try {
254-
const { default: r } = await import("./apexcharts.ssr.esm-142aa21d.js");
254+
const { default: r } = await import("./apexcharts.ssr.esm-fe46cd2d.js");
255255
s = r.hydrateAll(t.selector, t.clientOptions);
256256
} catch (r) {
257257
console.error("Failed to hydrate ApexCharts:", r);

dist/vue3-apexcharts.umd.cjs

Lines changed: 3 additions & 2 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue3-apexcharts",
33
"type": "module",
4-
"version": "1.11.0",
4+
"version": "1.11.1",
55
"main": "./dist/vue3-apexcharts.umd.cjs",
66
"module": "./dist/vue3-apexcharts.js",
77
"private": false,
@@ -52,7 +52,7 @@
5252
"url": "git+https://github.com/apexcharts/vue3-apexcharts.git"
5353
},
5454
"peerDependencies": {
55-
"apexcharts": ">=5.9.0",
55+
"apexcharts": ">=5.10.0",
5656
"vue": ">=3.0.0"
5757
},
5858
"peerDependenciesMeta": {
@@ -66,7 +66,7 @@
6666
"@vitest/coverage-v8": "^1.6.0",
6767
"@vitest/ui": "^1.6.0",
6868
"@vue/test-utils": "^2.4.6",
69-
"apexcharts": "^5.9.0",
69+
"apexcharts": "^5.10.0",
7070
"copyfiles": "2.4.0",
7171
"happy-dom": "^14.12.0",
7272
"jsdom": "^24.1.0",

0 commit comments

Comments
 (0)