apexcharts-skill 3.1.0 → 4.0.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 +71 -44
- package/README.md +8 -8
- package/SKILL.md +97 -70
- package/package.json +1 -1
- package/references/bar-charts.md +17 -4
- package/references/cartesian-charts.md +8 -1
- package/references/circular-charts.md +20 -7
- package/references/feature-platform.md +83 -22
- package/references/financial-charts.md +28 -12
- package/references/framework-wrappers.md +36 -6
- package/references/grid-charts.md +10 -7
- package/references/ssr.md +22 -10
- package/references/tree-shaking.md +77 -45
package/.cursorrules
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
# ApexCharts.js — AI Coding Rules
|
|
2
2
|
|
|
3
|
-
You are working with ApexCharts.js (
|
|
3
|
+
You are working with ApexCharts.js (v8), a JavaScript charting library.
|
|
4
4
|
Documentation: https://apexcharts.com/docs/
|
|
5
5
|
NPM: apexcharts
|
|
6
6
|
GitHub: https://github.com/apexcharts/apexcharts.js
|
|
7
7
|
|
|
8
|
-
v5 and v6 configs keep working
|
|
8
|
+
v5 and v6 configs keep working, with two v7.0 changes: `plotOptions.bar.borderRadiusWhenStacked` was dropped in v7.0 and is a working option again since v7.4 (`'all'`, the default, rounds both stack ends; `'last'` rounds only the far end), so do not delete it from a config; and `dataLabels.animate.enabled` now defaults to true on bar/column.
|
|
9
9
|
|
|
10
|
-
## !!
|
|
10
|
+
## !! v8.0: the default bundle does not carry every chart type or feature
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
`import ApexCharts from 'apexcharts'` (script tag `dist/apexcharts.min.js`) registers line, area, scatter, bubble, rangeArea, bar (and `column`), rangeBar, candlestick, boxPlot, histogram, funnel, pyramid, pie, donut, polarArea, radialBar, gauge, radar, heatmap and treemap, plus the Tier 1 features (exports, legend, toolbar, annotations, keyboard, morph, stats, facet, weave, marks). Everything else is Tier 2: in the package, not in the default bundle, reachable through its own import next to it. This is the most common v7 -> v8 failure (and v6 -> v7 for the nine 7.0 features).
|
|
13
13
|
|
|
14
14
|
import ApexCharts from 'apexcharts'
|
|
15
|
-
import 'apexcharts/
|
|
15
|
+
import 'apexcharts/sunburst' // a Tier 2 chart type
|
|
16
|
+
import 'apexcharts/features/drilldown' // a Tier 2 feature
|
|
16
17
|
|
|
17
|
-
Tier 2
|
|
18
|
+
Tier 2 chart types, `import 'apexcharts/<type>'` (script tag `dist/<type>.js`): `unit` (also for `waffle`), `sunburst` and `violin` (all three since 8.0), `icicle` (7.6), and `raincloud` (`apexcharts/raincloud` brings violin plus the raincloud feature; script tags `dist/violin.js`, then `dist/features/raincloud.js`).
|
|
19
|
+
Tier 2 features, `import 'apexcharts/features/<name>'` (script tag `dist/features/<name>.js`): drilldown, waterfall, dumbbell, streamgraph (since 8.0), highlight-filter (7.9), trellis, storyboard, perspectives, ink, renderer-canvas, link, measure, history, context-menu (since 7.0). Waterfall, dumbbell and streamgraph are chart types whose renderer is in the default bundle, so next to it add only the feature.
|
|
18
20
|
`apexcharts/features/all` is the Tier 1 set and pulls in none of them.
|
|
19
|
-
|
|
21
|
+
Full bundle (v8.0): `import ApexCharts from 'apexcharts/full'` (script tag `dist/apexcharts.full.min.js`) carries every chart type and feature and needs no add-on import. Gzipped at 8.0.0: default bundle 263,188 B, full bundle 381,135 B.
|
|
22
|
+
A missing import is named in the console: a Tier 2 chart type makes `render()` reject; a waterfall, dumbbell or streamgraph draws an empty plot; a Tier 2 feature degrades where it can (a trellis renders as one chart; renderer: 'canvas' falls back to SVG). Unversioned CDN URLs serve 8.0; pin `apexcharts@7` to stay on 7.
|
|
20
23
|
|
|
21
|
-
Premium (watermarked until an entitled premium/enterprise license): trellis, storyboard, link, ink, measure, context-menu, perspectives, history, and the unit/waffle and raincloud chart types. Premium and Tier 2 are
|
|
24
|
+
Premium (watermarked until an entitled premium/enterprise license): trellis, storyboard, link, ink, measure, context-menu, perspectives, history, highlight-filter, and the unit/waffle and raincloud chart types. Premium and Tier 2 are separate axes: since 8.0 every premium item is Tier 2, but renderer-canvas, drilldown, waterfall, dumbbell, streamgraph, sunburst, violin and icicle are Tier 2 and free.
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
On by default: coherent add/remove data-transition animations (they respect prefers-reduced-motion), and one-finger kinetic pan (`chart.pan.inertia`). Since v7.8, `dataLabels.avoidOverlap` nudges overlapping data labels apart (`false` to disable). Pinch-zoom and two-finger pan follow `chart.zoom.pinch: 'auto'`: on only where the toolbar reset button is present.
|
|
24
27
|
|
|
25
28
|
## Framework wrapper detection — check `package.json` first
|
|
26
29
|
|
|
@@ -38,15 +41,17 @@ Wrappers handle `destroy()` automatically on unmount, accept reactive props, and
|
|
|
38
41
|
4. **`yaxis` must be an array** when using multiple y-axes. Each entry needs `seriesName`.
|
|
39
42
|
5. **`tooltip.shared` and `tooltip.intersect` are mutually exclusive.**
|
|
40
43
|
6. **Use `null` (not `undefined`)** for missing data points.
|
|
41
|
-
7. **`chart.stacked: true`**
|
|
44
|
+
7. **`chart.stacked: true`** stacks `bar`, `area` and `line` series. In a mixed chart only the bar series stack unless `chart.stackOnlyBar: false`. `waterfall`, `dumbbell` and `streamgraph` force it off.
|
|
42
45
|
8. **Responsive breakpoints** must be in ascending order.
|
|
43
46
|
9. **For mixed/combo charts**, set `type` on each series object.
|
|
44
|
-
10. **RadialBar values
|
|
47
|
+
10. **RadialBar values sit on the `plotOptions.radialBar.min` to `max` domain** (default 0 to 100, so percentages by default). Set `min` / `max` to plot raw values; a value outside the domain is clamped.
|
|
45
48
|
11. **Color hex values must include `#`** (e.g., `'#FF5733'`).
|
|
46
|
-
12. **
|
|
47
|
-
13. **
|
|
48
|
-
14.
|
|
49
|
-
15. **`
|
|
49
|
+
12. **The default `apexcharts` bundle is not everything (v8).** Next to it, import `apexcharts/unit` (also for `waffle`), `apexcharts/sunburst`, `apexcharts/violin`, `apexcharts/icicle` or `apexcharts/raincloud` before writing that chart type, and `apexcharts/features/<name>` before a `waterfall`, `dumbbell` or `streamgraph` chart or any Tier 2 feature. `import ApexCharts from 'apexcharts/full'` (script tag `dist/apexcharts.full.min.js`) is the one entry that needs none of these.
|
|
50
|
+
13. **Tree-shaking**: `apexcharts/core` requires separate chart-type + feature imports. On it, `violin` and `raincloud` also need `apexcharts/bar`, and a raw-sample boxPlot or violin needs `apexcharts/features/stats`.
|
|
51
|
+
14. **Aliases**: `funnel`/`pyramid` render through bar, `gauge` through radialBar. Use them as `chart.type` directly (no `plotOptions.bar.isFunnel`); covered by `apexcharts/bar` and `apexcharts/radialBar`.
|
|
52
|
+
15. **`violin`** points use a density profile: `data: [{ x, y: { density: [[value, weight], ...], points?: [num] } }]`.
|
|
53
|
+
16. **`render()` is idempotent**: a repeated `render()` returns the same promise; still `destroy()` before a new instance on the same element.
|
|
54
|
+
17. **Unknown `chart.type` throws (v7.9)** and the message names the closest type. `'column'` is a synonym for `'bar'`; `''` and `null` draw a line chart.
|
|
50
55
|
|
|
51
56
|
---
|
|
52
57
|
|
|
@@ -58,23 +63,23 @@ Wrappers handle `destroy()` automatically on unmount, accept reactive props, and
|
|
|
58
63
|
|---|---|---|---|
|
|
59
64
|
| Line | `'line'` | `[{ name, data: [num\|null] }]` or `[{ name, data: [{ x, y }] }]` | `[{ data: [30, 40, null, 50] }]` |
|
|
60
65
|
| Area | `'area'` | Same as line | `[{ data: [10, 20, 30] }]` |
|
|
61
|
-
| Bar/Column | `'bar'` | Same as line. `plotOptions.bar.horizontal: false` for columns. | `[{ data: [44, 55, 41] }]` |
|
|
66
|
+
| Bar/Column | `'bar'` (or `'column'`, a synonym since v7.9) | Same as line. `plotOptions.bar.horizontal: false` for columns. | `[{ data: [44, 55, 41] }]` |
|
|
62
67
|
| Scatter | `'scatter'` | `[{ name, data: [{ x, y }] }]` | `[{ data: [{ x: 1, y: 5 }] }]` |
|
|
63
68
|
| Bubble | `'bubble'` | `[{ name, data: [{ x, y, z }] }]` — z required | `[{ data: [{ x: 1, y: 30, z: 10 }] }]` |
|
|
64
69
|
| Range Area | `'rangeArea'` | `[{ data: [{ x, y: [low, high] }] }]` | `[{ data: [{ x: 'Jan', y: [5, 15] }] }]` |
|
|
65
70
|
| Range Bar | `'rangeBar'` | `[{ data: [{ x, y: [start, end] }] }]` | `[{ data: [{ x: 'Task', y: [1, 5] }] }]` |
|
|
66
71
|
| Candlestick | `'candlestick'` | `[{ data: [{ x, y: [O,H,L,C] }] }]` — 4 values | `[{ data: [{ x: new Date(), y: [51,56,48,53] }] }]` |
|
|
67
72
|
| Box Plot | `'boxPlot'` | `[{ data: [{ x, y: [min,Q1,med,Q3,max] }] }]` — 5 values | `[{ data: [{ x: 'A', y: [10,20,30,40,50] }] }]` |
|
|
68
|
-
| Violin *(v6)* | `'violin'` | `[{ name, data: [{ x, y: { density: [[value,weight],...], points?: [num] } }] }]` | `[{ data: [{ x: 'A', y: { density: [[20,0.1],[30,0.2]], points: [21,29] } }] }]` |
|
|
73
|
+
| Violin *(v6, Tier 2 since v8)* | `'violin'` | `[{ name, data: [{ x, y: { density: [[value,weight],...], points?: [num] } }] }]`. Needs `import 'apexcharts/violin'` | `[{ data: [{ x: 'A', y: { density: [[20,0.1],[30,0.2]], points: [21,29] } }] }]` |
|
|
69
74
|
| Heatmap | `'heatmap'` | `[{ name, data: [{ x, y: number }] }]` — y is intensity | `[{ name: 'Mon', data: [{ x: '10am', y: 45 }] }]` |
|
|
70
75
|
| Treemap | `'treemap'` | `[{ data: [{ x, y: number }] }]` — y is area value | `[{ data: [{ x: 'Item', y: 100 }] }]` |
|
|
71
76
|
| Radar | `'radar'` | `[{ name, data: [num] }]` + `xaxis.categories` | `[{ data: [80, 50, 30] }]` |
|
|
72
77
|
| Funnel *(v6)* | `'funnel'` | `[{ name, data: [num] }]` + `xaxis.categories`; order largest→smallest | `[{ data: [1380, 990, 548, 200] }]` |
|
|
73
78
|
| Pyramid *(v6)* | `'pyramid'` | Same as funnel; order smallest→largest | `[{ data: [200, 548, 990, 1380] }]` |
|
|
74
|
-
| Waterfall *(v7.1)* | `'waterfall'` | `[{ name, data: [{ x, y }] }]` where y is the signed DELTA; a running-total row carries `isSubtotal` or `isTotal` and NO y | `[{ data: [{ x: 'Rev', y: 8786 }, { x: 'Cost', y: -2786 }, { x: 'Gross', isSubtotal: true }] }]` |
|
|
75
|
-
| Dumbbell *(v7.1)* | `'dumbbell'` | ONE SERIES PER MEASURE sharing x categories; not [low, high] pairs | `[{ name: '2020', data: [{ x: 'BE', y: 92 }] }, { name: '2025', data: [{ x: 'BE', y: 118 }] }]` |
|
|
76
|
-
| Streamgraph *(v7.1)* | `'streamgraph'` | Same as area; do NOT set chart.stacked (the chart owns baseline + order) | `[{ name: 'Drama', data: [{ x: '2024-01-01', y: 32 }] }]` |
|
|
77
|
-
| Raincloud *(v7.1, premium, TIER 2)* | `'raincloud'` | `[{ name, data: [{ x, points: [num] }] }]`: raw sample; configured via `plotOptions.violin` | `[{ data: [{ x: 'Control', points: [3.1, 4.7, 2.9] }] }]` |
|
|
79
|
+
| Waterfall *(v7.1, Tier 2 since v8)* | `'waterfall'` | `[{ name, data: [{ x, y }] }]` where y is the signed DELTA; a running-total row carries `isSubtotal` or `isTotal` and NO y. Needs `import 'apexcharts/features/waterfall'` | `[{ data: [{ x: 'Rev', y: 8786 }, { x: 'Cost', y: -2786 }, { x: 'Gross', isSubtotal: true }] }]` |
|
|
80
|
+
| Dumbbell *(v7.1, Tier 2 since v8)* | `'dumbbell'` | ONE SERIES PER MEASURE sharing x categories; not [low, high] pairs. Needs `import 'apexcharts/features/dumbbell'` | `[{ name: '2020', data: [{ x: 'BE', y: 92 }] }, { name: '2025', data: [{ x: 'BE', y: 118 }] }]` |
|
|
81
|
+
| Streamgraph *(v7.1, Tier 2 since v8)* | `'streamgraph'` | Same as area; do NOT set chart.stacked (the chart owns baseline + order). Needs `import 'apexcharts/features/streamgraph'` | `[{ name: 'Drama', data: [{ x: '2024-01-01', y: 32 }] }]` |
|
|
82
|
+
| Raincloud *(v7.1, premium, TIER 2)* | `'raincloud'` | `[{ name, data: [{ x, points: [num] }] }]`: raw sample; configured via `plotOptions.violin`. Needs `import 'apexcharts/raincloud'` | `[{ data: [{ x: 'Control', points: [3.1, 4.7, 2.9] }] }]` |
|
|
78
83
|
|
|
79
84
|
### Non-Axis Charts (flat number array — NOT object format)
|
|
80
85
|
|
|
@@ -82,11 +87,23 @@ Wrappers handle `destroy()` automatically on unmount, accept reactive props, and
|
|
|
82
87
|
// Pie, Donut, Polar Area
|
|
83
88
|
{ chart: { type: 'pie' }, series: [44, 55, 13], labels: ['A', 'B', 'C'] }
|
|
84
89
|
|
|
85
|
-
// Radial Bar (values 0
|
|
90
|
+
// Radial Bar (values on the plotOptions.radialBar min/max domain, default 0 to 100)
|
|
86
91
|
{ chart: { type: 'radialBar' }, series: [76, 67, 61], labels: ['X', 'Y', 'Z'] }
|
|
87
92
|
|
|
88
93
|
// Gauge (v6): single value; domain via plotOptions.radialBar.min/max
|
|
89
94
|
{ chart: { type: 'gauge' }, series: [72], labels: ['Progress'] }
|
|
95
|
+
|
|
96
|
+
// Unit / Waffle (v6.6, premium, Tier 2 since v8): needs import 'apexcharts/unit'
|
|
97
|
+
{ chart: { type: 'waffle' }, series: [44, 55, 13], labels: ['A', 'B', 'C'] }
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Hierarchical Charts (sunburst, icicle)
|
|
101
|
+
|
|
102
|
+
One `[{ data: [...] }]` series whose data are `{ x, y, children }` nodes nested to any depth. Both are Tier 2: `import 'apexcharts/sunburst'` (v6.7, Tier 2 since v8) or `import 'apexcharts/icicle'` (v7.6) next to `apexcharts`.
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
{ chart: { type: 'sunburst' }, // or 'icicle' (same tree, bands along one axis)
|
|
106
|
+
series: [{ data: [{ x: 'Mobile', y: 55, children: [{ x: 'iOS', y: 30 }, { x: 'Android', y: 23 }] }] }] }
|
|
90
107
|
```
|
|
91
108
|
|
|
92
109
|
---
|
|
@@ -113,7 +130,8 @@ chart.destroy() // cleanup
|
|
|
113
130
|
## Import Paths
|
|
114
131
|
|
|
115
132
|
```
|
|
116
|
-
apexcharts # Default bundle:
|
|
133
|
+
apexcharts # Default bundle: the standard types (see the box above) + the Tier 1 features
|
|
134
|
+
apexcharts/full # Full bundle (v8.0): every chart type and feature; no add-on import needed
|
|
117
135
|
apexcharts/core # Bare core (must register types + features manually)
|
|
118
136
|
apexcharts/line # line, area, scatter, bubble, rangeArea
|
|
119
137
|
apexcharts/bar # bar, column, rangeBar, funnel, pyramid (aliases)
|
|
@@ -121,20 +139,24 @@ apexcharts/waterfall # waterfall (v7.1) = bar + features/waterfall
|
|
|
121
139
|
apexcharts/dumbbell # dumbbell (v7.1) = bar + features/dumbbell
|
|
122
140
|
apexcharts/streamgraph # streamgraph (v7.1) = rangeArea + features/streamgraph
|
|
123
141
|
apexcharts/candlestick # candlestick, boxPlot
|
|
124
|
-
apexcharts/violin # violin
|
|
125
|
-
apexcharts/raincloud # raincloud (v7.1, premium, TIER 2) = violin + features/raincloud
|
|
126
142
|
apexcharts/histogram # histogram (v6.9) = bar + features/stats
|
|
127
143
|
apexcharts/pie # pie, donut, polarArea
|
|
128
144
|
apexcharts/radialBar # radialBar, gauge (alias)
|
|
129
145
|
apexcharts/radar # radar
|
|
130
146
|
apexcharts/heatmap # heatmap
|
|
131
147
|
apexcharts/treemap # treemap
|
|
132
|
-
|
|
133
|
-
|
|
148
|
+
|
|
149
|
+
# TIER 2 chart types: NOT in the default bundle. Import next to `apexcharts` (or use /full).
|
|
150
|
+
apexcharts/unit # unit, waffle (v6.6, premium; Tier 2 since v8)
|
|
151
|
+
apexcharts/sunburst # sunburst (v6.7; Tier 2 since v8)
|
|
152
|
+
apexcharts/violin # violin (Tier 2 since v8); on /core also import apexcharts/bar
|
|
153
|
+
apexcharts/icicle # icicle (v7.6)
|
|
154
|
+
apexcharts/raincloud # raincloud (v7.1, premium) = violin + features/raincloud; on /core also import apexcharts/bar
|
|
155
|
+
|
|
134
156
|
apexcharts/unit-shapes # unit-chart shape kit (v6.10), named exports
|
|
135
157
|
apexcharts/pictograms # pictogram glyphs (v7.0), named exports
|
|
136
|
-
apexcharts/ssr # Server-side rendering (Node.js)
|
|
137
|
-
apexcharts/client # Explicit browser import
|
|
158
|
+
apexcharts/ssr # Server-side rendering (Node.js); also the only entry with hydrate() (browser-safe)
|
|
159
|
+
apexcharts/client # Explicit browser import; no hydrate()
|
|
138
160
|
|
|
139
161
|
# TIER 1 features: already in the default `apexcharts` bundle.
|
|
140
162
|
# Import only if you started from /core or a per-type entry.
|
|
@@ -145,16 +167,17 @@ apexcharts/features/annotations # X/Y/point annotations
|
|
|
145
167
|
apexcharts/features/keyboard # Keyboard navigation
|
|
146
168
|
apexcharts/features/stats # histogram binning, raw-sample summaries, rowSeries()
|
|
147
169
|
apexcharts/features/morph # animated chart-type morphs
|
|
148
|
-
apexcharts/features/drilldown # hierarchical drill-down
|
|
149
170
|
apexcharts/features/facet # design tokens + OS themes
|
|
150
171
|
apexcharts/features/weave # plugin platform
|
|
151
172
|
apexcharts/features/marks # custom series types (registerSeriesType)
|
|
152
|
-
apexcharts/features/waterfall # (v7.1) waterfall type
|
|
153
|
-
apexcharts/features/dumbbell # (v7.1) dumbbell type
|
|
154
|
-
apexcharts/features/streamgraph # (v7.1) streamgraph type
|
|
155
173
|
apexcharts/features/all # Tier 1 only: NOT a shortcut past Tier 2
|
|
156
174
|
|
|
157
|
-
# TIER 2 features: in
|
|
175
|
+
# TIER 2 features: NOT in the default bundle (all are in apexcharts/full).
|
|
176
|
+
apexcharts/features/drilldown # hierarchical drill-down (Tier 2 since v8)
|
|
177
|
+
apexcharts/features/waterfall # (v7.1) waterfall type (Tier 2 since v8)
|
|
178
|
+
apexcharts/features/dumbbell # (v7.1) dumbbell type (Tier 2 since v8)
|
|
179
|
+
apexcharts/features/streamgraph # (v7.1) streamgraph type (Tier 2 since v8)
|
|
180
|
+
apexcharts/features/highlight-filter # (v7.9) part-of-whole highlight, highlightFilter (premium)
|
|
158
181
|
apexcharts/features/trellis # (v7.0) small multiples (premium)
|
|
159
182
|
apexcharts/features/storyboard # scrollytelling (premium; registers perspectives)
|
|
160
183
|
apexcharts/features/perspectives # shareable view state (premium)
|
|
@@ -164,11 +187,10 @@ apexcharts/features/link # crossfilter / linked views (premium)
|
|
|
164
187
|
apexcharts/features/measure # measure / delta ruler (premium)
|
|
165
188
|
apexcharts/features/history # undo/redo (Rewind, premium)
|
|
166
189
|
apexcharts/features/context-menu # right-click context menu (premium)
|
|
167
|
-
apexcharts/features/raincloud # (v7.1) raincloud type (premium)
|
|
168
190
|
```
|
|
169
191
|
(Cadence easing and real-time streaming are core: no feature import needed.)
|
|
170
|
-
Script tags:
|
|
171
|
-
Lean core channel (v7.0): `dist/apexcharts.core.js`
|
|
192
|
+
Script tags: a default-bundle page adds `dist/<type>.js` for a Tier 2 chart type and `dist/features/<name>.js` for a Tier 2 feature (raincloud: `dist/violin.js`, then `dist/features/raincloud.js`). Add-on tags may load before or after the ApexCharts script. `dist/apexcharts.full.min.js` already contains them all.
|
|
193
|
+
Lean core channel (v7.0): `dist/apexcharts.core.js` plus per-type files such as `dist/line.js` and feature files such as `dist/features/legend.js`, for a page that needs less than the default bundle.
|
|
172
194
|
|
|
173
195
|
---
|
|
174
196
|
|
|
@@ -179,7 +201,7 @@ Lean core channel (v7.0): `dist/apexcharts.core.js` + `dist/line.js` + `dist/fea
|
|
|
179
201
|
| `xaxis.labels.formatter` | `(value, timestamp?, opts?) => string` |
|
|
180
202
|
| `yaxis.labels.formatter` | `(value, opts?) => string` |
|
|
181
203
|
| `tooltip.x.formatter` | `(value, opts?) => string` |
|
|
182
|
-
| `tooltip.y.formatter` | `(value, opts?) => string` |
|
|
204
|
+
| `tooltip.y.formatter` | `(value: number \| null, opts?) => string`; `value` is `null` at a gap, so guard: `val == null ? 'n/a' : val.toFixed(2)` |
|
|
183
205
|
| `tooltip.y.title.formatter` | `(seriesName, opts?) => string` |
|
|
184
206
|
| `dataLabels.formatter` | `(value, opts?) => string \| number` |
|
|
185
207
|
| `legend.formatter` | `(legendName, opts?) => string` |
|
|
@@ -220,15 +242,15 @@ Lean core channel (v7.0): `dist/apexcharts.core.js` + `dist/line.js` + `dist/fea
|
|
|
220
242
|
|
|
221
243
|
### 8. Stacking on unsupported types
|
|
222
244
|
❌ `chart: { type: 'scatter', stacked: true }`
|
|
223
|
-
✅ `chart: { type: 'bar', stacked: true }` (or area)
|
|
245
|
+
✅ `chart: { type: 'bar', stacked: true }` (or area, or line)
|
|
224
246
|
|
|
225
247
|
### 9. Mixed chart without per-series type
|
|
226
248
|
❌ `series: [{ name: 'A', data: [...] }, { name: 'B', data: [...] }]` — all same type
|
|
227
249
|
✅ `series: [{ name: 'A', type: 'column', data: [...] }, { name: 'B', type: 'line', data: [...] }]`
|
|
228
250
|
|
|
229
|
-
### 10. RadialBar
|
|
230
|
-
❌ `series: [340, 520]`
|
|
231
|
-
✅ `series: [76, 67]` (percentages 0
|
|
251
|
+
### 10. RadialBar values outside the min/max domain
|
|
252
|
+
❌ `series: [340, 520]` on the default 0 to 100 domain (each arc is clamped to full)
|
|
253
|
+
✅ `series: [76, 67]` (percentages), or keep the raw values and set `plotOptions: { radialBar: { min: 0, max: 600 } }`
|
|
232
254
|
|
|
233
255
|
### 11. Colors without #
|
|
234
256
|
❌ `colors: ['FF5733']`
|
|
@@ -239,8 +261,9 @@ Lean core channel (v7.0): `dist/apexcharts.core.js` + `dist/line.js` + `dist/fea
|
|
|
239
261
|
✅ `import ApexCharts from 'apexcharts/line'; import 'apexcharts/features/legend'`
|
|
240
262
|
|
|
241
263
|
### 13. SSR with wrong import
|
|
242
|
-
❌
|
|
243
|
-
✅ Server: `import ApexCharts from 'apexcharts/ssr'; await ApexCharts.renderToString(opts)`
|
|
264
|
+
❌ Client: `import ApexCharts from 'apexcharts/client'; ApexCharts.hydrateAll()`: in a browser, `apexcharts`, `apexcharts/client` and `apexcharts/full` have no `hydrate()` / `hydrateAll()`
|
|
265
|
+
✅ Server: `import ApexCharts from 'apexcharts/ssr'; await ApexCharts.renderToString(opts)`. Client: `import ApexCharts from 'apexcharts/ssr'; ApexCharts.hydrateAll()` (the SSR entry is browser-safe)
|
|
266
|
+
On Node, plain `apexcharts` also resolves to the SSR bundle (the `node` export condition); import `apexcharts/ssr` anyway, so a bundler that resolves the `browser` condition while targeting Node keeps `renderToString`.
|
|
244
267
|
|
|
245
268
|
### 14. updateOptions just to change data
|
|
246
269
|
❌ `chart.updateOptions({ series: [{ data: newData }] })`
|
|
@@ -254,6 +277,10 @@ Lean core channel (v7.0): `dist/apexcharts.core.js` + `dist/line.js` + `dist/fea
|
|
|
254
277
|
❌ `xaxis: { categories: ['A','B'] }, series: [{ data: [{ x: 'A', y: 10 }] }]` — categories ignored
|
|
255
278
|
✅ Either use categories + simple array, OR use {x,y} without categories
|
|
256
279
|
|
|
280
|
+
### 17. Tier 2 chart type or feature on the default bundle (v8)
|
|
281
|
+
❌ `import ApexCharts from 'apexcharts'; new ApexCharts(el, { chart: { type: 'sunburst' }, series }).render()`: `render()` rejects and the console names the missing import
|
|
282
|
+
✅ `import ApexCharts from 'apexcharts'; import 'apexcharts/sunburst'` (or `import ApexCharts from 'apexcharts/full'`)
|
|
283
|
+
|
|
257
284
|
---
|
|
258
285
|
|
|
259
286
|
## API Methods
|
package/README.md
CHANGED
|
@@ -11,24 +11,24 @@ AI coding skill for building [ApexCharts.js](https://apexcharts.com/) charts and
|
|
|
11
11
|
> | **ApexTree** — hierarchy / org charts | `apextree` | [`apextree-skill`](https://github.com/apexcharts/apextree-skill) |
|
|
12
12
|
> | **ApexSankey** — flow / Sankey | `apexsankey` | [`apexsankey-skill`](https://github.com/apexcharts/apexsankey-skill) |
|
|
13
13
|
> | **Apex Grid** — data grid | `apex-grid` | [`apexgrid-skill`](https://github.com/apexcharts/apexgrid-skill) |
|
|
14
|
-
| **ApexStock**: financial / OHLC | `apexstock` | [`apexstock-skill`](https://github.com/apexcharts/apexstock-skill) |
|
|
15
|
-
| **ApexMaps**: maps / geo | `apexmaps` | [`apexmaps-skill`](https://github.com/apexcharts/apexmaps-skill) |
|
|
14
|
+
> | **ApexStock**: financial / OHLC | `apexstock` | [`apexstock-skill`](https://github.com/apexcharts/apexstock-skill) |
|
|
15
|
+
> | **ApexMaps**: maps / geo | `apexmaps` | [`apexmaps-skill`](https://github.com/apexcharts/apexmaps-skill) |
|
|
16
16
|
|
|
17
17
|
## What This Does
|
|
18
18
|
|
|
19
19
|
AI models frequently generate incorrect ApexCharts code — wrong series data formats, missing `render()` calls, broken formatter signatures, etc. This skill provides structured reference files that help AI assistants generate correct ApexCharts code on the first try.
|
|
20
20
|
|
|
21
|
-
This skill targets **ApexCharts
|
|
21
|
+
This skill targets **ApexCharts v8** (v5, v6 and v7 configs keep working, apart from the breaking changes the skill documents).
|
|
22
22
|
|
|
23
|
-
> **The
|
|
23
|
+
> **The v8.0 change to know about:** the default bundle no longer carries `unit`/`waffle`, `sunburst`, `violin`, drilldown, waterfall, dumbbell or streamgraph. Import them next to `apexcharts` (`import 'apexcharts/sunburst'`, `import 'apexcharts/features/waterfall'`), or load `apexcharts/full`, which has every chart type and feature. `icicle`, `raincloud`, the highlight filter and the nine v7.0 features (trellis, storyboard, perspectives, ink, canvas renderer, link, measure, history, context menu) were already separate imports. This is the most common v7 to v8 upgrade failure, so the skill leads with it.
|
|
24
24
|
|
|
25
25
|
### Coverage
|
|
26
26
|
|
|
27
|
-
- **
|
|
27
|
+
- **30 `chart.type` values**: line, area, bar (with its `column` synonym), pie, donut, radialBar, scatter, bubble, heatmap, candlestick, boxPlot, violin, histogram, radar, polarArea, rangeBar, rangeArea, treemap, funnel, pyramid, gauge, sunburst, icicle, unit, waffle, waterfall, dumbbell, streamgraph, raincloud
|
|
28
28
|
- **Correct data formats** for every chart type
|
|
29
29
|
- **Common pitfalls** with wrong/correct code examples
|
|
30
|
-
- **Feature platform**: small multiples (Trellis), plugins (Weave), canvas renderer (Strata), custom series (Marks), undo/redo (Rewind), shareable views (Perspectives), themes (Facet), easing (Cadence), crossfilter (Link), annotation authoring (Ink), measure ruler, context menu, storyboard, streaming, drilldown, raw-sample statistics (Stats), unit-chart shape kit (`apexcharts/unit-shapes`), pictogram glyphs (`apexcharts/pictograms`)
|
|
31
|
-
- **Bundle
|
|
30
|
+
- **Feature platform**: small multiples (Trellis), plugins (Weave), canvas renderer (Strata), custom series (Marks), undo/redo (Rewind), shareable views (Perspectives), themes (Facet), easing (Cadence), crossfilter (Link), annotation authoring (Ink), measure ruler, context menu, storyboard, streaming, drilldown, part-of-whole highlight (Highlight filter), raw-sample statistics (Stats), unit-chart shape kit (`apexcharts/unit-shapes`), pictogram glyphs (`apexcharts/pictograms`)
|
|
31
|
+
- **Bundle contents** (which chart types and features the default v8 bundle carries, which are opt-in imports, and the `apexcharts/full` bundle), tree-shaking, and the lean-core script-tag channel
|
|
32
32
|
- **SSR** (server-side rendering) and hydration
|
|
33
33
|
- **Framework integration**: React, Vue 3, Angular
|
|
34
34
|
|
|
@@ -86,7 +86,7 @@ const barCharts = await readFile(referencePath('bar-charts.md'), 'utf8');
|
|
|
86
86
|
│ ├── bar-charts.md # bar, column, rangeBar, timeline/Gantt, funnel, pyramid, waterfall, dumbbell
|
|
87
87
|
│ ├── financial-charts.md # candlestick, boxPlot, violin, histogram, raincloud
|
|
88
88
|
│ ├── circular-charts.md # pie, donut, polarArea, radialBar, gauge, sunburst, unit, waffle, pictograms
|
|
89
|
-
│ ├── grid-charts.md # heatmap, treemap
|
|
89
|
+
│ ├── grid-charts.md # heatmap, treemap, icicle
|
|
90
90
|
│ ├── radar-charts.md # radar
|
|
91
91
|
│ ├── feature-platform.md # feature platform + bundle tiers (trellis, plugins, canvas, undo/redo, ...)
|
|
92
92
|
│ ├── tree-shaking.md # bundle tiers and optimization
|