apexcharts-skill 2.2.0 → 3.1.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/.cursorrules +57 -19
- package/README.md +14 -10
- package/SKILL.md +165 -66
- package/index.js +1 -1
- package/package.json +1 -1
- package/references/bar-charts.md +130 -5
- package/references/cartesian-charts.md +96 -1
- package/references/circular-charts.md +52 -1
- package/references/{v6-features.md → feature-platform.md} +233 -30
- package/references/financial-charts.md +68 -0
- package/references/framework-wrappers.md +1 -1
- package/references/grid-charts.md +91 -1
- package/references/ssr.md +18 -9
- package/references/tree-shaking.md +119 -28
package/SKILL.md
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: apexcharts
|
|
3
3
|
description: >
|
|
4
|
-
AI skill for building ApexCharts.js charts and data visualizations (targets
|
|
4
|
+
AI skill for building ApexCharts.js charts and data visualizations (targets v7).
|
|
5
5
|
Use when the user asks to create, configure, or troubleshoot any chart using ApexCharts
|
|
6
6
|
(line, area, bar, pie, donut, radialBar, scatter, bubble, heatmap, candlestick, boxPlot,
|
|
7
7
|
violin, histogram, radar, polarArea, rangeBar, rangeArea, treemap, funnel, pyramid, gauge,
|
|
8
|
-
sunburst, unit, waffle). Covers
|
|
9
|
-
correct data formats, lifecycle, formatters, tree-shaking, SSR, and the
|
|
10
|
-
platform (plugins, canvas renderer, custom series, undo/redo,
|
|
11
|
-
crossfilter, annotation authoring, storyboard, streaming,
|
|
8
|
+
sunburst, icicle, unit, waffle, waterfall, dumbbell, streamgraph, raincloud). Covers
|
|
9
|
+
correct data formats, lifecycle, formatters, tree-shaking, SSR, and the feature
|
|
10
|
+
platform (plugins, canvas renderer, custom series, small multiples, undo/redo,
|
|
11
|
+
shareable views, themes, crossfilter, annotation authoring, storyboard, streaming,
|
|
12
|
+
drilldown). Knows which features ship in the default v7 bundle and which are an
|
|
13
|
+
explicit import. In React /
|
|
12
14
|
Vue / Angular projects, prefer the framework wrapper packages
|
|
13
15
|
(`react-apexcharts`, `vue3-apexcharts`, `ng-apexcharts`) over the core API.
|
|
14
16
|
metadata:
|
|
15
17
|
author: ApexCharts
|
|
16
|
-
version: "
|
|
17
|
-
library_version: "6.
|
|
18
|
+
version: "3.1.0"
|
|
19
|
+
library_version: "7.6.1"
|
|
18
20
|
category: data-visualization
|
|
19
21
|
tags: [charts, visualization, javascript, typescript, svg, apexcharts]
|
|
20
22
|
docs: https://apexcharts.com/docs/
|
|
@@ -31,9 +33,40 @@ metadata:
|
|
|
31
33
|
>
|
|
32
34
|
> Wrappers handle `destroy()` automatically on unmount, accept reactive props, and forward events as idiomatic framework events. Use the core API directly only when no framework is detected, or when the user explicitly asks for vanilla. See `references/framework-wrappers.md`.
|
|
33
35
|
|
|
34
|
-
> **Targets ApexCharts
|
|
36
|
+
> **Targets ApexCharts v7.** Read the next box before writing any feature code: v7's headline change is that the default bundle no longer contains every feature.
|
|
35
37
|
>
|
|
36
|
-
>
|
|
38
|
+
> **⚠️ v7.0 breaking change: nine features left the default bundle.** In v6, `import ApexCharts from 'apexcharts'` gave you every feature. In v7 it does not. These nine are **Tier 2**: present in the package, absent from the default bundle, and reachable only through an explicit import.
|
|
39
|
+
>
|
|
40
|
+
> ```js
|
|
41
|
+
> import ApexCharts from 'apexcharts'
|
|
42
|
+
> import 'apexcharts/features/trellis' // ESM
|
|
43
|
+
> ```
|
|
44
|
+
> ```html
|
|
45
|
+
> <script src=".../dist/apexcharts.js"></script>
|
|
46
|
+
> <script src=".../dist/features/trellis.js"></script> <!-- script tag -->
|
|
47
|
+
> ```
|
|
48
|
+
>
|
|
49
|
+
> | Tier 2 feature | Import | gzip |
|
|
50
|
+
> |---|---|---|
|
|
51
|
+
> | Trellis (small multiples) | `apexcharts/features/trellis` | 25.7 KB |
|
|
52
|
+
> | Storyboard (scrollytelling) | `apexcharts/features/storyboard` | 8.0 KB |
|
|
53
|
+
> | Perspectives (shareable views) | `apexcharts/features/perspectives` | 6.7 KB |
|
|
54
|
+
> | Ink (annotation authoring) | `apexcharts/features/ink` | 6.2 KB |
|
|
55
|
+
> | Canvas renderer (Strata) | `apexcharts/features/renderer-canvas` | 6.0 KB |
|
|
56
|
+
> | Linked views & crossfilter | `apexcharts/features/link` | 5.3 KB |
|
|
57
|
+
> | Measure ruler | `apexcharts/features/measure` | 4.6 KB |
|
|
58
|
+
> | Rewind (undo / redo) | `apexcharts/features/history` | 3.2 KB |
|
|
59
|
+
> | Context menu | `apexcharts/features/context-menu` | 2.3 KB |
|
|
60
|
+
>
|
|
61
|
+
> The `raincloud` chart type (7.1) is Tier 2 on the same terms: `import 'apexcharts/raincloud'`. Storyboard registers Perspectives, so importing both costs no more than Storyboard alone. **Nothing fails silently**: each warns in the console when its config is present but the module is not, and degrades where it can (a trellis renders as one chart; `renderer: 'canvas'` falls back to SVG). Default bundle: 291,654 B gzipped in 6.10, 252,005 B in 7.0, 264,326 B in 7.1, about 270 KB in 7.6.
|
|
62
|
+
>
|
|
63
|
+
> Everything else stays in the default bundle: **all chart types except `raincloud` and `icicle`**, axes, tooltips, legend, toolbar, exports, annotations, keyboard navigation, stats, morph, drilldown, themes (Facet), plugins (Weave) and custom series (Marks). See `references/tree-shaking.md` for the full tier table and `references/feature-platform.md` for each feature's API.
|
|
64
|
+
>
|
|
65
|
+
> **Other v7.0 breaking changes.** (1) `plotOptions.bar.borderRadiusWhenStacked` was dropped as dead config in v7.0 and is a **working option again in v7.4**: `'all'` (the default) rounds both stack ends, `'last'` rounds only the far end and leaves the baseline square. Do not delete it from a config. (2) `dataLabels.animate.enabled` now defaults to `true` (bar/column only): labels ride to their new position on a data update instead of snapping. Set `dataLabels: { animate: { enabled: false } }` for the old behavior. Everything else from v5 and v6 keeps working unchanged.
|
|
66
|
+
>
|
|
67
|
+
> **Behaviors that are on by default** (both respect `prefers-reduced-motion`): data updates that add/remove points animate coherently, and one-finger kinetic pan is enabled (`chart.pan.inertia`). The two-finger gestures, pinch-zoom and two-finger pan, sit behind `chart.zoom.pinch`, which defaults to `'auto'`: **on only where the toolbar reset button is present**, so an unintended zoom is always undoable. `chart.zoom.allowMouseWheelZoom` is gated the same way. Set `pinch: true` to force the gestures on a toolbar-less chart, or see `chart.zoom.resetControl` (v7.4) for the other way to satisfy the gate.
|
|
68
|
+
>
|
|
69
|
+
> **Premium features and licensing.** Eight features are premium: `trellis` (small multiples, 7.0), `storyboard`, `link` (crossfilter / linked views), `ink` (annotation authoring), `measure`, `context-menu`, `perspectives` (shareable views), and `history` (undo/redo). Two chart types are premium: `unit` / `waffle`, and `raincloud` (7.1). These still function fully, but render an `APEXCHARTS` trial watermark until an entitled license is set via `ApexCharts.setLicense(key)` (static) or per-chart `chart.license`. They require a `premium` or `enterprise` plan; a `pro` key or the free tier keeps the watermark. Every other chart type and free module is never gated. Note that premium and Tier 2 are independent axes: `waterfall`, `dumbbell` and `streamgraph` are free *and* in the default bundle, while `trellis` is both premium *and* an explicit import. See the Licensing section in `references/feature-platform.md`.
|
|
37
70
|
|
|
38
71
|
## 1. Critical Rules
|
|
39
72
|
|
|
@@ -48,11 +81,15 @@ metadata:
|
|
|
48
81
|
9. **For mixed/combo charts**, set `type` on each individual series object, not just on `chart.type`.
|
|
49
82
|
10. **RadialBar values must be 0–100** (they represent percentages).
|
|
50
83
|
11. **Color hex values must include the `#` prefix** (e.g., `'#FF5733'`, not `'FF5733'`).
|
|
51
|
-
12. **
|
|
52
|
-
13. **
|
|
53
|
-
14.
|
|
54
|
-
15. **`
|
|
55
|
-
16. **`
|
|
84
|
+
12. **Nine features are NOT in the v7 default bundle.** Before writing config for `trellis`, `storyboard`, `perspectives`, `ink`, `renderer: 'canvas'`, `link`, `measure`, `history` or the context menu, add its `apexcharts/features/*` import. Same for the `raincloud` and `icicle` chart types, which are not in the default bundle either. Full-bundle users need this too, not just tree-shakers. See the box above.
|
|
85
|
+
13. **Tree-shaking**: importing `apexcharts/core` gives you a bare class, and you must also import chart-type entries and feature entries separately.
|
|
86
|
+
14. **First-class aliases**: `funnel` and `pyramid` render through the bar engine; `gauge` renders through radialBar. Use them as `chart.type` directly (no `plotOptions.bar.isFunnel` needed). They are covered by the `apexcharts/bar` and `apexcharts/radialBar` tree-shaking entries respectively.
|
|
87
|
+
15. **`violin` (statistical)** uses a per-point density profile: `data: [{ x, y: { density: [[value, weight], ...], points?: [number] } }]`, not a plain number. Since v6.9 a datum may instead supply only raw observations (`points: [number]`, no `y`) and the library derives the density via KDE (needs `apexcharts/features/stats` when tree-shaking).
|
|
88
|
+
16. **`render()` is idempotent**: calling `render()` twice on the same instance returns the same promise instead of building a duplicate chart. You still must `destroy()` before creating a *new* instance on the same element.
|
|
89
|
+
17. **`histogram` (v6.9)** series carry **raw observations** (one number per event), not pre-aggregated counts; the chart chooses bin edges and counts them. Binning ships behind the stats feature: use the `apexcharts/histogram` entry, or `import 'apexcharts/features/stats'` alongside `apexcharts/bar` (the full `apexcharts` bundle already includes it).
|
|
90
|
+
18. **`waterfall` (v7.1) accumulates for you.** The series carries the **deltas**, not the running total. A row that should show the running total carries `isSubtotal` or `isTotal` and **no `y`**; the library measures it. Do not pre-compute cumulative values.
|
|
91
|
+
19. **`dumbbell` (v7.1) takes one series per measure**, each with the same `x` categories: `[{ name: '2020', data: [{ x, y }] }, { name: '2025', data: [{ x, y }] }]`. Do **not** zip the values into `y: [low, high]` pairs; that is the older `plotOptions.bar.isDumbbell` range-bar form, which still works but is a different chart.
|
|
92
|
+
20. **`raincloud` (v7.1) takes the raw sample**, one datum per category: `data: [{ x, points: [number] }]`. It is a premium Tier 2 type, so it needs `import 'apexcharts/raincloud'` on top of the default bundle.
|
|
56
93
|
|
|
57
94
|
---
|
|
58
95
|
|
|
@@ -80,6 +117,10 @@ This is the most critical reference. Using the wrong data format is the #1 cause
|
|
|
80
117
|
| Radar | `'radar'` | `[{ name, data: [number] }]` + `xaxis: { categories: [...] }` | `series: [{ name: 'Skill', data: [80, 50, 30, 40, 100] }]` |
|
|
81
118
|
| Funnel *(v6)* | `'funnel'` | `[{ name, data: [number] }]` + `xaxis: { categories: [...] }`. Order values **largest→smallest**. | `series: [{ data: [1380, 990, 548, 200] }]` |
|
|
82
119
|
| Pyramid *(v6)* | `'pyramid'` | Same as funnel; order values **smallest→largest** (wide base at bottom). | `series: [{ data: [200, 548, 990, 1380] }]` |
|
|
120
|
+
| Waterfall *(v7.1)* | `'waterfall'` | `[{ name, data: [{ x, y }] }]` where **`y` is the signed delta**, not a running total. A running-total row carries `isSubtotal` (sum since the last cut) or `isTotal` (sum from zero) and **omits `y`**. | `series: [{ data: [{ x: 'Revenue', y: 8786 }, { x: 'Costs', y: -2786 }, { x: 'Gross', isSubtotal: true }] }]` |
|
|
121
|
+
| Dumbbell *(v7.1)* | `'dumbbell'` | **One series per measure**, sharing x categories: `[{ name, data: [{ x, y }] }, ...]`. Not `[low, high]` pairs. | `series: [{ name: '2020', data: [{ x: 'Backend', y: 92 }] }, { name: '2025', data: [{ x: 'Backend', y: 118 }] }]` |
|
|
122
|
+
| Streamgraph *(v7.1)* | `'streamgraph'` | Same as area: `[{ name, data: [{ x, y }] }]`. Stacking, baseline and band order are the chart's job, so do **not** set `chart.stacked`. | `series: [{ name: 'Drama', data: [{ x: '2024-01-01', y: 32 }] }]` |
|
|
123
|
+
| Raincloud *(v7.1, premium, Tier 2)* | `'raincloud'` | `[{ name, data: [{ x, points: [number] }] }]`: the **raw sample** per category; the density, box and rain are derived. Needs `import 'apexcharts/raincloud'`. | `series: [{ name: 'Weight gain', data: [{ x: 'Control', points: [3.1, 4.7, 2.9] }] }]` |
|
|
83
124
|
|
|
84
125
|
### Non-Axis Charts (pie, donut, radialBar, polarArea, gauge, unit, waffle)
|
|
85
126
|
|
|
@@ -98,7 +139,9 @@ These use a **flat number array** for `series`, NOT the object format:
|
|
|
98
139
|
|
|
99
140
|
**Unit / Waffle *(v6.6, premium)*** render one mark per unit of value (dot clusters, pictograms, waffles, beeswarms). Same flat-array + `labels` shape as pie; layout is chosen through `plotOptions.unit.layout`. A per-mark object form (`series: [{ name, data: [{ value, x, z, name, fillColor, id }] }]`) gives each mark its own color, position, size, and tooltip. `waffle` is a preset alias of `unit` (grid layout). Both render an `APEXCHARTS` watermark until an entitled license is set. See `references/circular-charts.md`.
|
|
100
141
|
|
|
101
|
-
### Hierarchical Charts (sunburst)
|
|
142
|
+
### Hierarchical Charts (sunburst, icicle)
|
|
143
|
+
|
|
144
|
+
Both take the same tree, and the choice between them is a layout one: a sunburst spends the plot radially, an icicle spends it along a straight axis.
|
|
102
145
|
|
|
103
146
|
**Sunburst *(v6.7, free)*** draws tree-structured data as concentric rings (a nested pie / donut). It uses the axis-style `[{ data: [...] }]` wrapper, but each datum is an `{ x, y, children }` node nested to any depth:
|
|
104
147
|
|
|
@@ -119,12 +162,26 @@ These use a **flat number array** for `series`, NOT the object format:
|
|
|
119
162
|
|
|
120
163
|
Configure the centre hole, corner rounding, and inter-arc gap through `plotOptions.sunburst` (see `references/circular-charts.md`).
|
|
121
164
|
|
|
165
|
+
**Icicle *(v7.6, free, opt-in import)*** is the same partition in cartesian coordinates: one band per depth level, each child sized inside its parent's extent. Same data shape as the sunburst, and it also reads an existing `drilldown` config as plain data (no drilldown runtime needed). Labels stay horizontal at every depth and same-depth siblings line up across branches, which is what makes it the better pick for deep trees, call stacks and path funnels.
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
import ApexCharts from 'apexcharts/icicle' // NOT in the default bundle
|
|
169
|
+
|
|
170
|
+
{
|
|
171
|
+
chart: { type: 'icicle' },
|
|
172
|
+
series: [{ data: [ /* the same { x, y, children } tree as above */ ] }],
|
|
173
|
+
plotOptions: { icicle: { direction: 'up' } } // flame-graph orientation
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
A branch may omit its own `y` and be the sum of its children *(fixed in v7.6 for both partition types)*. Configure depth direction, band thickness, leaf behaviour and zoom through `plotOptions.icicle` (see `references/grid-charts.md`).
|
|
178
|
+
|
|
122
179
|
---
|
|
123
180
|
|
|
124
181
|
## 3. Package / Module Map
|
|
125
182
|
|
|
126
183
|
```
|
|
127
|
-
#
|
|
184
|
+
# Default bundle (every chart type except raincloud and icicle, plus the Tier 1 features)
|
|
128
185
|
import ApexCharts from 'apexcharts'
|
|
129
186
|
|
|
130
187
|
# Bare core (no chart types, no optional features — must register manually)
|
|
@@ -139,53 +196,69 @@ import ApexCharts from 'apexcharts/rangeArea' # same as /line
|
|
|
139
196
|
import ApexCharts from 'apexcharts/bar' # bar, column, rangeBar
|
|
140
197
|
import ApexCharts from 'apexcharts/column' # same as /bar
|
|
141
198
|
import ApexCharts from 'apexcharts/rangeBar' # same as /bar
|
|
199
|
+
import ApexCharts from 'apexcharts/waterfall' # waterfall (v7.1): bar engine + the waterfall feature
|
|
200
|
+
import ApexCharts from 'apexcharts/dumbbell' # dumbbell (v7.1): bar engine + the dumbbell feature
|
|
201
|
+
import ApexCharts from 'apexcharts/streamgraph' # streamgraph (v7.1): rangeArea engine + the streamgraph feature
|
|
142
202
|
import ApexCharts from 'apexcharts/candlestick' # candlestick, boxPlot
|
|
143
203
|
import ApexCharts from 'apexcharts/boxPlot' # same as /candlestick
|
|
144
|
-
import ApexCharts from 'apexcharts/violin' # violin
|
|
204
|
+
import ApexCharts from 'apexcharts/violin' # violin
|
|
205
|
+
import ApexCharts from 'apexcharts/raincloud' # raincloud (v7.1, premium): violin engine + the raincloud feature
|
|
145
206
|
import ApexCharts from 'apexcharts/histogram' # histogram (v6.9): bar engine + the stats feature
|
|
146
207
|
import ApexCharts from 'apexcharts/pie' # pie, donut, polarArea
|
|
147
208
|
import ApexCharts from 'apexcharts/donut' # same as /pie
|
|
148
209
|
import ApexCharts from 'apexcharts/polarArea' # same as /pie
|
|
149
|
-
import ApexCharts from 'apexcharts/radialBar' # radialBar + gauge
|
|
210
|
+
import ApexCharts from 'apexcharts/radialBar' # radialBar + gauge
|
|
150
211
|
import ApexCharts from 'apexcharts/radar' # radar only
|
|
151
212
|
import ApexCharts from 'apexcharts/heatmap' # heatmap only
|
|
152
213
|
import ApexCharts from 'apexcharts/treemap' # treemap only
|
|
153
214
|
import ApexCharts from 'apexcharts/sunburst' # sunburst (v6.7, hierarchical)
|
|
215
|
+
import ApexCharts from 'apexcharts/icicle' # icicle (v7.6, hierarchical): opt-in, NOT in the default bundle
|
|
154
216
|
import ApexCharts from 'apexcharts/unit' # unit + waffle (v6.6, premium)
|
|
155
|
-
# funnel + pyramid
|
|
217
|
+
# funnel + pyramid render through the bar engine; use apexcharts/bar
|
|
156
218
|
|
|
157
219
|
# Unit-chart shape kit (v6.10): named exports, tree-shaken per shape (~4 KB gzipped each)
|
|
158
220
|
import { heart, outlined, glyphs, preview } from 'apexcharts/unit-shapes'
|
|
159
221
|
|
|
160
|
-
#
|
|
222
|
+
# Pictogram glyphs (v7.0): one drawn mark per unit, independent of the layout
|
|
223
|
+
import { person, registerMarks } from 'apexcharts/pictograms'
|
|
224
|
+
|
|
225
|
+
# TIER 1 features: already in the default `apexcharts` bundle.
|
|
226
|
+
# Import these only when you started from /core or a per-type entry.
|
|
161
227
|
import 'apexcharts/features/exports' # PNG/SVG/CSV export methods
|
|
162
228
|
import 'apexcharts/features/legend' # Interactive legend component
|
|
163
229
|
import 'apexcharts/features/toolbar' # Toolbar (zoom, pan, download buttons)
|
|
164
230
|
import 'apexcharts/features/annotations' # X/Y/point/text/image annotations
|
|
165
231
|
import 'apexcharts/features/keyboard' # Keyboard navigation (accessibility)
|
|
166
232
|
import 'apexcharts/features/stats' # Statistics (v6.9): histogram binning, boxPlot/violin raw samples, rowSeries()
|
|
167
|
-
# v6 feature platform (all opt-in, all tree-shakeable)
|
|
168
233
|
import 'apexcharts/features/morph' # Animated chart-type morphs
|
|
169
234
|
import 'apexcharts/features/drilldown' # Hierarchical drill-down
|
|
170
|
-
import 'apexcharts/features/history' # Undo/redo (Rewind)
|
|
171
|
-
import 'apexcharts/features/perspectives' # Shareable view state
|
|
172
|
-
import 'apexcharts/features/storyboard' # Scrollytelling (includes perspectives)
|
|
173
235
|
import 'apexcharts/features/facet' # Design tokens + OS-aware themes
|
|
174
236
|
import 'apexcharts/features/weave' # Public plugin platform
|
|
175
|
-
import 'apexcharts/features/renderer-canvas' # Hybrid SVG + canvas renderer (Strata)
|
|
176
237
|
import 'apexcharts/features/marks' # Custom series types (registerSeriesType)
|
|
177
|
-
import 'apexcharts/features/
|
|
178
|
-
import 'apexcharts/features/
|
|
179
|
-
import 'apexcharts/features/
|
|
180
|
-
|
|
181
|
-
|
|
238
|
+
import 'apexcharts/features/waterfall' # (v7.1) waterfall chart type
|
|
239
|
+
import 'apexcharts/features/dumbbell' # (v7.1) dumbbell chart type
|
|
240
|
+
import 'apexcharts/features/streamgraph' # (v7.1) streamgraph chart type
|
|
241
|
+
|
|
242
|
+
# TIER 2 features: NOT in the default bundle. Required even on the full bundle.
|
|
243
|
+
import 'apexcharts/features/trellis' # (v7.0) Small multiples (premium)
|
|
244
|
+
import 'apexcharts/features/storyboard' # Scrollytelling (premium; registers perspectives)
|
|
245
|
+
import 'apexcharts/features/perspectives' # Shareable view state (premium)
|
|
246
|
+
import 'apexcharts/features/ink' # On-chart annotation authoring (premium)
|
|
247
|
+
import 'apexcharts/features/renderer-canvas' # Hybrid SVG + canvas renderer (Strata)
|
|
248
|
+
import 'apexcharts/features/link' # Crossfilter / linked views (premium)
|
|
249
|
+
import 'apexcharts/features/measure' # Measure / delta ruler (premium)
|
|
250
|
+
import 'apexcharts/features/history' # Undo/redo (Rewind, premium)
|
|
251
|
+
import 'apexcharts/features/context-menu' # Right-click / long-press context menu (premium)
|
|
252
|
+
import 'apexcharts/features/raincloud' # (v7.1) raincloud chart type (premium)
|
|
253
|
+
|
|
254
|
+
import 'apexcharts/features/all' # Tier 1 only. Does NOT pull in Tier 2.
|
|
182
255
|
|
|
183
256
|
# SSR (server-side rendering)
|
|
184
257
|
import ApexCharts from 'apexcharts/ssr' # Node.js: renderToString, renderToHTML
|
|
185
258
|
import ApexCharts from 'apexcharts/client' # Browser: explicit client import for hydration
|
|
186
259
|
```
|
|
187
260
|
|
|
188
|
-
**Note:**
|
|
261
|
+
**Note (v7):** `apexcharts` gives you every chart type except `raincloud` and `icicle`, plus the Tier 1 features. The nine Tier 2 features, `raincloud` and `icicle` need their own import **whatever entry point you started from**. `apexcharts/features/all` is the Tier 1 set, so it is not a shortcut past this. Tree-shaking entries (`/core`, `/line`, etc.) are for reducing bundle size below the default.
|
|
189
262
|
|
|
190
263
|
**Note (v6.9):** ApexCharts is no longer dependency-free: it depends on `apex-commons` at runtime. npm resolves it automatically and the browser (script-tag) bundles inline it, so no action is needed; it only matters for tooling that assumed zero dependencies.
|
|
191
264
|
|
|
@@ -360,6 +433,12 @@ Also: do NOT use `xaxis.categories` when your data already has `{ x, y }` format
|
|
|
360
433
|
{ tooltip: { shared: false, intersect: true } }
|
|
361
434
|
```
|
|
362
435
|
|
|
436
|
+
**Reaching content inside a `custom` tooltip *(v7.6)***: a tooltip closes as the pointer leaves the data point, so a link or button returned by `custom` can never be clicked. `tooltip.interactive: true` holds it open while the pointer is over it. It is off by default, and while it is on `followCursor` is **ignored** (a tooltip that trails the cursor retreats from every approach); the configured `followCursor` value is left alone and applies again the moment `interactive` goes back off.
|
|
437
|
+
|
|
438
|
+
```js
|
|
439
|
+
{ tooltip: { interactive: true, custom: ({ seriesIndex }) => `<a href="/detail/${seriesIndex}">Open</a>` } }
|
|
440
|
+
```
|
|
441
|
+
|
|
363
442
|
### Pitfall 7: Wrong formatter signatures
|
|
364
443
|
|
|
365
444
|
❌ **WRONG** — using y-axis formatter signature for tooltip:
|
|
@@ -463,7 +542,9 @@ Also: do NOT use `xaxis.categories` when your data already has `{ x, y }` format
|
|
|
463
542
|
{ responsive: [{ breakpoint: 480, options: {...} }, { breakpoint: 1024, options: {...} }] }
|
|
464
543
|
```
|
|
465
544
|
|
|
466
|
-
### Pitfall 14:
|
|
545
|
+
### Pitfall 14: Missing feature imports
|
|
546
|
+
|
|
547
|
+
Two distinct versions of this. **(a) Per-type entries carry no features:**
|
|
467
548
|
|
|
468
549
|
❌ **WRONG** — toolbar/legend/annotations silently missing:
|
|
469
550
|
```js
|
|
@@ -479,24 +560,34 @@ import 'apexcharts/features/toolbar'
|
|
|
479
560
|
import 'apexcharts/features/annotations'
|
|
480
561
|
```
|
|
481
562
|
|
|
482
|
-
|
|
563
|
+
**(b) *(v7)* The full bundle no longer carries the nine Tier 2 features.** This one catches people who never tree-shook anything, and it is the most common v6 → v7 upgrade failure.
|
|
483
564
|
|
|
484
|
-
❌ **WRONG
|
|
565
|
+
❌ **WRONG**: the config is right, the module is absent, so the chart renders as one plain chart and logs a warning:
|
|
566
|
+
```js
|
|
567
|
+
import ApexCharts from 'apexcharts'
|
|
568
|
+
new ApexCharts(el, { chart: { type: 'line' }, series, trellis: { by: 'region' } })
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
✅ **CORRECT**:
|
|
485
572
|
```js
|
|
486
|
-
// On server:
|
|
487
573
|
import ApexCharts from 'apexcharts'
|
|
488
|
-
|
|
574
|
+
import 'apexcharts/features/trellis'
|
|
489
575
|
```
|
|
490
576
|
|
|
491
|
-
|
|
577
|
+
Same for `storyboard`, `perspectives`, `ink`, `renderer: 'canvas'`, `link`, `measure`, `history`, `contextMenu`, and the `raincloud` chart type. Check the console: each one names both import routes when its config is present without it. `icicle` is the exception to the "warns and degrades" rule: an unregistered chart type **throws**, and the thrown message names both routes.
|
|
578
|
+
|
|
579
|
+
### Pitfall 15: SSR — wrong import path
|
|
580
|
+
|
|
581
|
+
`apexcharts` resolves by environment: the `"."` export's `node` condition points at the SSR bundle, so `import ApexCharts from 'apexcharts'` on a server **does** carry `renderToString` / `renderToHTML`. Import `apexcharts/ssr` explicitly anyway, so the intent survives a bundler that resolves the `browser` condition while targeting Node:
|
|
492
582
|
```js
|
|
493
583
|
// On server:
|
|
494
584
|
import ApexCharts from 'apexcharts/ssr'
|
|
495
585
|
const svg = await ApexCharts.renderToString(options)
|
|
496
586
|
|
|
497
|
-
// On client (for hydration):
|
|
587
|
+
// On client (for hydration): target the wrapper renderToHTML emitted,
|
|
588
|
+
// which carries data-apexcharts-hydrate and NO id.
|
|
498
589
|
import ApexCharts from 'apexcharts' // or 'apexcharts/client'
|
|
499
|
-
ApexCharts.hydrate(document.querySelector('
|
|
590
|
+
ApexCharts.hydrateAll() // or hydrate(document.querySelector('[data-apexcharts-hydrate]'))
|
|
500
591
|
```
|
|
501
592
|
|
|
502
593
|
### Pitfall 16: updateOptions vs updateSeries vs appendData
|
|
@@ -552,10 +643,12 @@ await chart.updateOptions({ title: { text: 'New Title' } })
|
|
|
552
643
|
| `addEventListener(name, handler)` | Subscribe to chart event. |
|
|
553
644
|
| `removeEventListener(name, handler)` | Unsubscribe from chart event. |
|
|
554
645
|
|
|
555
|
-
###
|
|
646
|
+
### Feature Instance Methods (require the matching feature import)
|
|
556
647
|
|
|
557
648
|
| Method | Feature | Description |
|
|
558
649
|
|---|---|---|
|
|
650
|
+
| `chart.getPanels() / getPanel(key)` | trellis | *(v7.0)* The grid's panels, and one panel's own ApexCharts instance by facet key. Empty / `null` on a chart that is not a trellis host. |
|
|
651
|
+
| `chart.promotePanel(key) / restorePanels()` | trellis | *(v7.0)* Expand one panel to the grid's full width, and go back. |
|
|
559
652
|
| `chart.history.undo() / redo() / jump(id) / transaction(fn)` | history | Undo/redo over the command journal. |
|
|
560
653
|
| `chart.perspectives.capture() / toURL() / apply(token)` | perspectives | Serialize / restore the exact view. |
|
|
561
654
|
| `chart.getActiveRenderer()` | renderer-canvas | Returns `'svg' \| 'canvas'` currently in use. |
|
|
@@ -582,6 +675,8 @@ await chart.updateOptions({ title: { text: 'New Title' } })
|
|
|
582
675
|
| `ApexCharts.registerUnitLayout(name, fn) / unregisterUnitLayout(name)` | *(v6.9)* Register a named unit-chart layout, referenceable via `plotOptions.unit.positions: '<name>'` with `layout: 'custom'`. |
|
|
583
676
|
| `ApexCharts.crossfilter({ id, records }) / getCrossfilter(id)` | *(v6, Link)* Create / fetch a crossfilter engine. |
|
|
584
677
|
| `ApexCharts.perspectives.fromURL(href)` | *(v6)* Decode a perspective token from a URL. |
|
|
678
|
+
| `ApexCharts.trellis(el, options)` | *(v7.0, Trellis)* Imperative entry point: creates a trellis host (options must carry `trellis.by`). Throws if the trellis feature is not imported. |
|
|
679
|
+
| `registerMarks(defs) / definePictogram(meta)` from `apexcharts/pictograms` | *(v7.0)* Register glyphs so `plotOptions.unit.pictogram.mark: 'person'` resolves. |
|
|
585
680
|
|
|
586
681
|
### SSR Static Methods (available with `apexcharts/ssr`)
|
|
587
682
|
|
|
@@ -645,27 +740,31 @@ await chart.updateOptions({ title: { text: 'New Title' } })
|
|
|
645
740
|
|
|
646
741
|
---
|
|
647
742
|
|
|
648
|
-
## 9.
|
|
743
|
+
## 9. Feature Platform
|
|
649
744
|
|
|
650
|
-
|
|
745
|
+
Every feature below is off by default in config terms. The **Tier** column is about the *bundle*: Tier 1 is already in `import ApexCharts from 'apexcharts'` and needs a `features/*` import only if you started from `/core` or a per-type entry; **Tier 2 needs its import no matter which entry point you used**. Full config shapes, APIs, and examples are in `references/feature-platform.md`.
|
|
651
746
|
|
|
652
|
-
| Feature |
|
|
653
|
-
|
|
654
|
-
| **Weave** (plugins) | `apexcharts/features/weave` | Publish reusable chart plugins against a stable `ApexCharts.registerPlugin({ name, setup })` API; activate per chart with `plugins: [{ name }]`. |
|
|
655
|
-
| **
|
|
656
|
-
| **
|
|
657
|
-
| **
|
|
658
|
-
| **
|
|
659
|
-
| **
|
|
660
|
-
| **Cadence** (easing) | core | `chart.animations.easing` accepts a named curve, cubic-bezier array, or function; `ApexCharts.registerEasing`. |
|
|
661
|
-
| **
|
|
662
|
-
| **
|
|
663
|
-
| **
|
|
664
|
-
| **
|
|
665
|
-
| **
|
|
666
|
-
| **
|
|
667
|
-
| **
|
|
668
|
-
| **
|
|
747
|
+
| Feature | Tier | Import | One-liner |
|
|
748
|
+
|---|---|---|---|
|
|
749
|
+
| **Weave** (plugins) | 1 | `apexcharts/features/weave` | Publish reusable chart plugins against a stable `ApexCharts.registerPlugin({ name, setup })` API; activate per chart with `plugins: [{ name }]`. Contract is at **v6** (v7.5): `info`/`categories`/`markDerived` (v2), `reserve` (v3), `pointer` (v4), `claim`/`drawn`/`declare`/`can` (v6). Declare the **lowest** `apiVersion` you can run on and feature-detect the rest: a host older than the version you declare skips your plugin outright. |
|
|
750
|
+
| **Marks** (custom series) | 1 | `apexcharts/features/marks` | `ApexCharts.registerSeriesType(name, { renderItem })` for first-class custom marks (lollipop, bullet). Baseline is `scales.y(0)`, **not** `api.zeroY`. |
|
|
751
|
+
| **Facet** (themes/tokens) | 1 | `apexcharts/features/facet` | `theme: { follow: 'os', name }`, `--apx-*` CSS custom props, `ApexCharts.registerTheme`. |
|
|
752
|
+
| **Drilldown** | 1 | `apexcharts/features/drilldown` | `drilldown: { enabled, series }` + a `drilldown` id on data points; `chart.drillDown()/drillUp()`. v6.9 adds line/area support, async levels (`onDrillDown` may return a Promise), a loading overlay, and the `drillDownError` event. |
|
|
753
|
+
| **Morph** | 1 | `apexcharts/features/morph` | Animated transitions between chart types. |
|
|
754
|
+
| **Stats** | 1 | `apexcharts/features/stats` | *(v6.9)* Statistics behind histogram binning, boxPlot/violin raw-sample summaries (R type 7 quartiles, KDE), and `chart.rowSeries()`. The `apexcharts/histogram` entry includes it. |
|
|
755
|
+
| **Cadence** (easing) | core | none | `chart.animations.easing` accepts a named curve, cubic-bezier array, or function; `ApexCharts.registerEasing`. |
|
|
756
|
+
| **Streaming** | core | none | `chart: { streaming: { enabled, maxPoints } }` for constant-velocity rolling-window scroll. |
|
|
757
|
+
| **Print layout** | core | none | *(v7.1)* `chart: { print: { enabled, width } }`. The paper box cannot be measured from JS (`clientWidth` and `matchMedia` both report the screen during `beforeprint`), so the chart is re-laid out at a known width for the sheet and restored after. **On by default** at `width: 700` (suits A4 / Letter portrait); a chart already narrower is left alone. `print: false` restores the pre-7.1 behavior. |
|
|
758
|
+
| **Marker batching** | core | none | *(v7.0)* `markers: { largeDatasetThreshold: n }`. Above `n` points, a series' markers are drawn as one path per marker size instead of one element per point. **Opt-in, default `0` (off)**, because merged marker paths are not pixel-identical: overlapping markers lose their individual outlines and dense clusters read flatter. Also covers the markers `showNullDataPoints` adds, which is what makes a null-heavy series slow even at `size: 0`. |
|
|
759
|
+
| **Trellis** (small multiples) | **2** | `apexcharts/features/trellis` | *(v7.0, premium)* `trellis: { by: 'region', minPanelWidth }` splits the series into a grid of real charts sharing one scale, legend, toolbar and crosshair. Also `row` × `column` for 2-D grids. |
|
|
760
|
+
| **Strata** (canvas) | **2** | `apexcharts/features/renderer-canvas` | `chart: { renderer: 'auto', rendererThreshold }` paints the dense series layer to canvas while axes/tooltips/exports stay SVG. Falls back to SVG if the module is missing. |
|
|
761
|
+
| **Rewind** (undo/redo) | **2** | `apexcharts/features/history` | *(premium)* `chart: { history: { enabled: true } }`, then `chart.history.undo()/redo()/jump()/transaction()`. |
|
|
762
|
+
| **Perspectives** (view state) | **2** | `apexcharts/features/perspectives` | *(premium)* `chart.perspectives.capture()/toURL()/apply()` to serialize and restore the exact view. |
|
|
763
|
+
| **Link** (crossfilter) | **2** | `apexcharts/features/link` | *(premium)* `chart: { group, link: { enabled, mode } }` for highlight linking; `ApexCharts.crossfilter({ id, records })` for a filter engine. |
|
|
764
|
+
| **Ink** (annotation authoring) | **2** | `apexcharts/features/ink` | *(premium)* `chart: { ink: { enabled: true } }` makes annotations draggable/resizable with a floating editor. |
|
|
765
|
+
| **Measure** (ruler) | **2** | `apexcharts/features/measure` | *(premium)* `chart: { measure: { enabled, mode } }`; hold a key and drag to read change/percent/slope. v6.1 adds a toolbar tool (`toolbar.tools.measure`, `toolbar.autoSelected: 'measure'`). |
|
|
766
|
+
| **Context menu** | **2** | `apexcharts/features/context-menu` | *(premium)* `chart: { contextMenu: { enabled, items } }` for point-specific right-click actions. |
|
|
767
|
+
| **Storyboard** (scrollytelling) | **2** | `apexcharts/features/storyboard` | *(premium)* `chart.storyboard.bind({ beats })` pairs prose sections with saved views. Registers Perspectives too. |
|
|
669
768
|
|
|
670
769
|
## 10. Reference Routing Table
|
|
671
770
|
|
|
@@ -673,13 +772,13 @@ For detailed chart-family-specific options, data format variants, and full worki
|
|
|
673
772
|
|
|
674
773
|
| Topic | Reference File |
|
|
675
774
|
|---|---|
|
|
676
|
-
| Line, Area, Scatter, Bubble, Range Area | `references/cartesian-charts.md` |
|
|
677
|
-
| Bar, Column, Range Bar, Timeline/Gantt, Funnel, Pyramid | `references/bar-charts.md` |
|
|
678
|
-
| Candlestick, Box Plot, Violin, Histogram | `references/financial-charts.md` |
|
|
679
|
-
| Pie, Donut, Polar Area, Radial Bar, Gauge, Sunburst, Unit, Waffle | `references/circular-charts.md` |
|
|
680
|
-
| Heatmap, Treemap | `references/grid-charts.md` |
|
|
775
|
+
| Line, Area, Scatter, Bubble, Range Area, Streamgraph | `references/cartesian-charts.md` |
|
|
776
|
+
| Bar, Column, Range Bar, Timeline/Gantt, Funnel, Pyramid, Waterfall, Dumbbell | `references/bar-charts.md` |
|
|
777
|
+
| Candlestick, Box Plot, Violin, Histogram, Raincloud | `references/financial-charts.md` |
|
|
778
|
+
| Pie, Donut, Polar Area, Radial Bar, Gauge, Sunburst, Unit, Waffle, Pictograms | `references/circular-charts.md` |
|
|
779
|
+
| Heatmap (incl. cell shapes), Treemap, Icicle | `references/grid-charts.md` |
|
|
681
780
|
| Radar | `references/radar-charts.md` |
|
|
682
|
-
|
|
|
683
|
-
| Tree-shaking, Bundle optimization | `references/tree-shaking.md` |
|
|
781
|
+
| Feature platform (small multiples, plugins, canvas, undo/redo, themes, crossfilter, storyboard, ...) | `references/feature-platform.md` |
|
|
782
|
+
| Bundle tiers, Tree-shaking, Bundle optimization | `references/tree-shaking.md` |
|
|
684
783
|
| Server-side rendering, Hydration | `references/ssr.md` |
|
|
685
784
|
| React, Vue, Angular integration | `references/framework-wrappers.md` |
|
package/index.js
CHANGED
|
@@ -20,13 +20,13 @@ export const referenceFiles = [
|
|
|
20
20
|
'bar-charts.md',
|
|
21
21
|
'cartesian-charts.md',
|
|
22
22
|
'circular-charts.md',
|
|
23
|
+
'feature-platform.md',
|
|
23
24
|
'financial-charts.md',
|
|
24
25
|
'framework-wrappers.md',
|
|
25
26
|
'grid-charts.md',
|
|
26
27
|
'radar-charts.md',
|
|
27
28
|
'ssr.md',
|
|
28
29
|
'tree-shaking.md',
|
|
29
|
-
'v6-features.md',
|
|
30
30
|
];
|
|
31
31
|
|
|
32
32
|
/** Resolve a reference file by its filename. Throws if not in the known list. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apexcharts-skill",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "AI coding skill for ApexCharts.js — structured reference docs that help AI assistants (Claude, Cursor, Copilot, etc.) generate correct ApexCharts code.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apexcharts",
|