You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-4Lines changed: 51 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,9 +256,11 @@ The default entry (`vue3-apexcharts`) bundles the full ApexCharts library. If yo
256
256
```js
257
257
importVueApexChartsfrom"vue3-apexcharts/core";
258
258
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
261
260
import"apexcharts/line";
261
+
import"apexcharts/bar";
262
+
import"apexcharts/donut";
263
+
import"apexcharts/treemap";
262
264
263
265
// Import only the features you need
264
266
import"apexcharts/features/legend";
@@ -268,9 +270,32 @@ const app = createApp(App);
268
270
app.use(VueApexCharts);
269
271
```
270
272
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.
272
274
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"`|
274
299
275
300
**Optional features:**
276
301
| Import | Description |
@@ -283,6 +308,28 @@ The core entry imports ApexCharts from `apexcharts/core`, which is the bare clas
### 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
+
exportdefault {
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
+
286
333
## Server-Side Rendering (SSR)
287
334
288
335
Vue3-ApexCharts includes dedicated components for SSR that work with Nuxt 3 and other Vue SSR frameworks.
Copy file name to clipboardExpand all lines: dist/apexcharts.ssr.esm-fe46cd2d.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ var De = Object.defineProperty, Te = Object.defineProperties, Me = Object.getOwn
22
22
r((e = e.apply(A, t)).next());
23
23
});
24
24
/*!
25
-
* ApexCharts v5.8.2-beta.1
25
+
* ApexCharts v5.10.0
26
26
* (c) 2018-2026 ApexCharts
27
27
*/
28
28
class B {
@@ -8442,7 +8442,8 @@ function Q(A) {
8442
8442
const t = xe[A];
8443
8443
if (!t)
8444
8444
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.`
0 commit comments