apexcharts-skill 1.2.1 → 2.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 +272 -0
- package/README.md +9 -5
- package/SKILL.md +102 -22
- package/index.js +1 -0
- package/install/claude-code.md +25 -0
- package/install/copilot.md +23 -0
- package/install/cursor.md +27 -0
- package/package.json +4 -2
- package/references/bar-charts.md +44 -0
- package/references/circular-charts.md +51 -1
- package/references/financial-charts.md +58 -1
- package/references/ssr.md +52 -37
- package/references/tree-shaking.md +19 -3
- package/references/v6-features.md +432 -0
package/references/bar-charts.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
- **Column** (`'bar'`) — Vertical column chart (the default for `type: 'bar'`)
|
|
6
6
|
- **Bar** (`'bar'` + `plotOptions.bar.horizontal: true`) — Horizontal bar chart
|
|
7
7
|
- **Range Bar** (`'rangeBar'`) — Bars with start/end values (used for timelines, Gantt charts)
|
|
8
|
+
- **Funnel** (`'funnel'`, **new in v6**): Stage-by-stage drop-off chart
|
|
9
|
+
- **Pyramid** (`'pyramid'`, **new in v6**): A funnel with the wide base at the bottom
|
|
8
10
|
|
|
9
11
|
## Tree-Shakeable Import
|
|
10
12
|
|
|
@@ -12,8 +14,11 @@
|
|
|
12
14
|
import ApexCharts from 'apexcharts/bar'
|
|
13
15
|
// Registers: bar, column, rangeBar
|
|
14
16
|
// Aliases: apexcharts/column, apexcharts/rangeBar
|
|
17
|
+
// Also covers funnel + pyramid (they normalize to the bar engine in v6)
|
|
15
18
|
```
|
|
16
19
|
|
|
20
|
+
**v6 note:** `funnel` and `pyramid` are first-class `chart.type` aliases that render through the bar engine. Use them directly as `chart.type`; you do **not** need `plotOptions.bar.isFunnel`. `plotOptions.funnel` carries the funnel-specific shape options.
|
|
21
|
+
|
|
17
22
|
---
|
|
18
23
|
|
|
19
24
|
## Data Formats
|
|
@@ -140,6 +145,43 @@ import ApexCharts from 'apexcharts/bar'
|
|
|
140
145
|
}
|
|
141
146
|
```
|
|
142
147
|
|
|
148
|
+
### Funnel (v6)
|
|
149
|
+
|
|
150
|
+
Values are a flat number array in the standard `[{ name, data }]` wrapper; stage labels go in `xaxis.categories`. Order values **largest → smallest**.
|
|
151
|
+
|
|
152
|
+
```js
|
|
153
|
+
{
|
|
154
|
+
chart: { type: 'funnel', height: 350 },
|
|
155
|
+
series: [{ name: 'Recruitment', data: [1380, 1100, 990, 880, 740, 548, 330, 200] }],
|
|
156
|
+
xaxis: { categories: ['Sourced', 'Screened', 'Assessed', 'HR', 'Technical', 'Verify', 'Offered', 'Hired'] },
|
|
157
|
+
plotOptions: {
|
|
158
|
+
// shape: 'rectangle' (default, centered rectangles) | 'trapezoid' (continuous sloped sides)
|
|
159
|
+
funnel: { shape: 'trapezoid', lastShape: 'flat' }, // lastShape: 'flat' | 'taper' (trapezoid only)
|
|
160
|
+
bar: { borderRadius: 0, barHeight: '80%' } // cosmetic bar props still apply
|
|
161
|
+
},
|
|
162
|
+
dataLabels: {
|
|
163
|
+
enabled: true,
|
|
164
|
+
formatter: (val, opt) => opt.w.globals.labels[opt.dataPointIndex] + ': ' + val
|
|
165
|
+
},
|
|
166
|
+
legend: { show: false }
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Pyramid (v6)
|
|
171
|
+
|
|
172
|
+
Same shape as funnel, but order values **smallest → largest** so the wide base sits at the bottom.
|
|
173
|
+
|
|
174
|
+
```js
|
|
175
|
+
{
|
|
176
|
+
chart: { type: 'pyramid', height: 350 },
|
|
177
|
+
series: [{ name: '', data: [200, 330, 548, 740, 880, 990, 1100, 1380] }],
|
|
178
|
+
xaxis: { categories: ['Sweets', 'Processed', 'Fats', 'Meat', 'Legumes', 'Dairy', 'Produce', 'Grains'] },
|
|
179
|
+
plotOptions: { bar: { distributed: true } }, // one color per stage
|
|
180
|
+
dataLabels: { enabled: true, formatter: (val, opt) => opt.w.globals.labels[opt.dataPointIndex] },
|
|
181
|
+
legend: { show: false }
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
143
185
|
---
|
|
144
186
|
|
|
145
187
|
## Key plotOptions.bar Options
|
|
@@ -242,3 +284,5 @@ series: [{
|
|
|
242
284
|
3. **Range Bar with single value instead of array** — `y` must be `[start, end]`, not a single number.
|
|
243
285
|
4. **Timeline without `xaxis.type: 'datetime'`** — date-based range bars need `xaxis: { type: 'datetime' }` to render correctly.
|
|
244
286
|
5. **`distributed: true` with multiple series** — distributed coloring applies to each data point independently. With multiple series, each point gets a unique color which is usually not desired. Use `distributed: true` only with single-series charts.
|
|
287
|
+
6. **Funnel/pyramid value ordering**: funnel expects values ordered largest-to-smallest and pyramid smallest-to-largest. The renderer does not sort for you; unsorted data produces a jagged shape. Stage labels come from `xaxis.categories`, and per-stage labels in `dataLabels.formatter` are read via `opt.w.globals.labels[opt.dataPointIndex]`.
|
|
288
|
+
7. **Reaching for `plotOptions.bar.isFunnel` in v6**: unnecessary. Set `chart.type: 'funnel'` (or `'pyramid'`) and use `plotOptions.funnel` for shape options.
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
- **Pie** (`'pie'`) — Standard pie chart
|
|
6
6
|
- **Donut** (`'donut'`) — Pie chart with hollow center
|
|
7
7
|
- **Polar Area** (`'polarArea'`) — Radial segments with equal angles, varying radius
|
|
8
|
-
- **Radial Bar** (`'radialBar'`)
|
|
8
|
+
- **Radial Bar** (`'radialBar'`): Circular progress chart (one or more concentric tracks)
|
|
9
|
+
- **Gauge** (`'gauge'`, **new in v6**): Single-value gauge with arc/needle shapes, colored bands, and ticks
|
|
9
10
|
|
|
10
11
|
## Tree-Shakeable Import
|
|
11
12
|
|
|
@@ -16,6 +17,7 @@ import ApexCharts from 'apexcharts/pie'
|
|
|
16
17
|
|
|
17
18
|
import ApexCharts from 'apexcharts/radialBar'
|
|
18
19
|
// Registers: radialBar (separate entry point)
|
|
20
|
+
// Also covers gauge (it normalizes to the radialBar engine in v6)
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
---
|
|
@@ -46,6 +48,52 @@ import ApexCharts from 'apexcharts/radialBar'
|
|
|
46
48
|
|
|
47
49
|
**Important:** RadialBar values represent percentages (0–100). Values above 100 will overflow the track.
|
|
48
50
|
|
|
51
|
+
### Gauge (v6)
|
|
52
|
+
|
|
53
|
+
A gauge is a single-value `radialBar` alias. Series is a flat one-element array; the value maps to the `min..max` domain (defaults 0-100). All configuration lives under `plotOptions.radialBar`; there is **no `plotOptions.gauge`**.
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
// Minimal gauge:
|
|
57
|
+
{
|
|
58
|
+
chart: { type: 'gauge', height: 350 },
|
|
59
|
+
series: [72],
|
|
60
|
+
labels: ['Progress']
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
// Needle gauge with colored bands and ticks:
|
|
66
|
+
{
|
|
67
|
+
chart: { type: 'gauge', height: 360 },
|
|
68
|
+
series: [68],
|
|
69
|
+
labels: ['Speed'],
|
|
70
|
+
plotOptions: {
|
|
71
|
+
radialBar: {
|
|
72
|
+
shape: 'needle', // 'arc' (default, filled value-arc) | 'needle' (rotating pointer)
|
|
73
|
+
startAngle: -135, endAngle: 135,
|
|
74
|
+
min: 0, max: 100, // value-to-angle domain
|
|
75
|
+
bands: [ // colored threshold segments in the min..max domain
|
|
76
|
+
{ from: 0, to: 30, color: '#FF4560' },
|
|
77
|
+
{ from: 30, to: 70, color: '#FEB019' },
|
|
78
|
+
{ from: 70, to: 100, color: '#00E396' }
|
|
79
|
+
],
|
|
80
|
+
bandsStyle: { strokeWidth: '50%', gap: 1 },
|
|
81
|
+
ticks: {
|
|
82
|
+
show: true,
|
|
83
|
+
major: { count: 11, length: 8, width: 2, color: '#334155', placement: 'outside' },
|
|
84
|
+
minor: { count: 1, length: 4, width: 1, color: '#94A3B8', placement: 'outside' },
|
|
85
|
+
labels: { show: true, offset: 6, fontSize: '11px' }
|
|
86
|
+
},
|
|
87
|
+
needle: { color: '#0F172A', length: '60%', baseWidth: 6, tipWidth: 1 },
|
|
88
|
+
hollow: { size: '70%' },
|
|
89
|
+
dataLabels: { name: { show: false }, value: { offsetY: 32, fontSize: '28px', fontWeight: 700 } }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
A plain radialBar is effectively a gauge with `shape: 'arc'`. A semi-circle gauge is `startAngle: -90, endAngle: 90`.
|
|
96
|
+
|
|
49
97
|
---
|
|
50
98
|
|
|
51
99
|
## Key plotOptions
|
|
@@ -216,3 +264,5 @@ plotOptions: {
|
|
|
216
264
|
4. **Donut center labels not showing** — must set `plotOptions.pie.donut.labels.show: true` explicitly.
|
|
217
265
|
5. **`total.formatter` signature** — receives `w` (the full chart config object), NOT a simple value. Access `w.globals.seriesTotals` for the array of current values.
|
|
218
266
|
6. **Polar Area confused with Radar** — polar area uses `series: [num]` (flat), radar uses `series: [{ data: [num] }]` (axis format). They look similar but have different data shapes.
|
|
267
|
+
7. **Looking for `plotOptions.gauge`**: it does not exist. Gauge is a `radialBar` alias; configure `shape`, `bands`, `ticks`, `needle`, and `min`/`max` under `plotOptions.radialBar`.
|
|
268
|
+
8. **Gauge value outside `min`/`max`**: unlike a plain radialBar (fixed 0-100), a gauge maps its value to the `min..max` domain you set. A value beyond that domain saturates at the arc ends.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
# Financial Charts Reference — ApexCharts
|
|
1
|
+
# Financial & Statistical Charts Reference — ApexCharts
|
|
2
2
|
|
|
3
3
|
## Chart Types Covered
|
|
4
4
|
|
|
5
5
|
- **Candlestick** (`'candlestick'`) — OHLC (Open, High, Low, Close) financial chart
|
|
6
6
|
- **Box Plot** (`'boxPlot'`) — Statistical distribution chart showing min, Q1, median, Q3, max
|
|
7
|
+
- **Violin** (`'violin'`, **new in v6**): Statistical distribution chart showing a density curve per category, optionally with the raw sample points overlaid as jitter
|
|
7
8
|
|
|
8
9
|
## Tree-Shakeable Import
|
|
9
10
|
|
|
@@ -11,6 +12,9 @@
|
|
|
11
12
|
import ApexCharts from 'apexcharts/candlestick'
|
|
12
13
|
// Registers: candlestick, boxPlot
|
|
13
14
|
// Alias: apexcharts/boxPlot
|
|
15
|
+
|
|
16
|
+
import ApexCharts from 'apexcharts/violin'
|
|
17
|
+
// Registers: violin (separate entry point, new in v6)
|
|
14
18
|
```
|
|
15
19
|
|
|
16
20
|
---
|
|
@@ -68,6 +72,57 @@ The `y` value must be an array of exactly 5 numbers: `[min, Q1, median, Q3, max]
|
|
|
68
72
|
}
|
|
69
73
|
```
|
|
70
74
|
|
|
75
|
+
### Violin: Density Profile (v6)
|
|
76
|
+
|
|
77
|
+
Each point is `{ x, y: { density, points } }`:
|
|
78
|
+
|
|
79
|
+
- `density` (**required**): an array of `[value, weight]` pairs describing the precomputed density/KDE profile.
|
|
80
|
+
- `points` (optional): a flat array of raw observations, rendered as jitter dots.
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
{
|
|
84
|
+
chart: { type: 'violin', height: 420 },
|
|
85
|
+
series: [{
|
|
86
|
+
name: 'Session duration',
|
|
87
|
+
data: [
|
|
88
|
+
{
|
|
89
|
+
x: 'Direct',
|
|
90
|
+
y: {
|
|
91
|
+
density: [[20, 0.02], [30, 0.08], [40, 0.18], [50, 0.10], [60, 0.03]], // [value, weight]
|
|
92
|
+
points: [22, 31, 38, 41, 47, 52, 58] // raw observations
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
x: 'Referral',
|
|
97
|
+
y: {
|
|
98
|
+
density: [[25, 0.03], [35, 0.12], [45, 0.20], [55, 0.09], [65, 0.02]],
|
|
99
|
+
points: [27, 34, 44, 48, 53, 61]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}],
|
|
104
|
+
plotOptions: {
|
|
105
|
+
violin: {
|
|
106
|
+
bandwidthScale: 1, // multiplies the density-derived half-width
|
|
107
|
+
normalize: 'individual', // 'individual' (each violin to its own peak) | 'group' (shared scale)
|
|
108
|
+
points: { show: false } // set show:true to overlay the raw points as jitter
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Orientation and per-category color come from `plotOptions.bar`** (violin reuses the bar renderer):
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
plotOptions: {
|
|
118
|
+
bar: { horizontal: true, distributed: true }, // horizontal violins, one color each
|
|
119
|
+
violin: {
|
|
120
|
+
normalize: 'group',
|
|
121
|
+
points: { show: true, shape: 'circle', size: 3, jitter: 0.9, strokeWidth: 0 }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
71
126
|
---
|
|
72
127
|
|
|
73
128
|
## Key plotOptions
|
|
@@ -155,3 +210,5 @@ plotOptions: {
|
|
|
155
210
|
3. **Using simple numeric array** — `data: [10, 20, 30]` does NOT work for candlestick/boxPlot. Each point requires an array in `y`.
|
|
156
211
|
4. **Missing `xaxis.type: 'datetime'`** — candlestick charts with date x-values need `xaxis: { type: 'datetime' }` to format dates correctly.
|
|
157
212
|
5. **Confusing candlestick with boxPlot** — candlestick is 4 values (OHLC), boxPlot is 5 values (five-number summary). They share the same entry point but have different data shapes.
|
|
213
|
+
6. **Violin with a plain numeric `y`**: violin points need `y: { density: [[value, weight], ...] }`, not a number. The `density` profile is precomputed (ApexCharts does not run a KDE for you); `points` for the raw-sample jitter overlay is optional.
|
|
214
|
+
7. **Violin orientation set on the wrong namespace**: horizontal violins and per-violin colors come from `plotOptions.bar` (`horizontal`, `distributed`), while `bandwidthScale`, `normalize`, and `points` live under `plotOptions.violin`.
|
package/references/ssr.md
CHANGED
|
@@ -22,37 +22,43 @@ import ApexCharts from 'apexcharts/client'
|
|
|
22
22
|
|
|
23
23
|
## Server-Side API
|
|
24
24
|
|
|
25
|
-
### renderToString(options)
|
|
25
|
+
### renderToString(options, ssrOptions?)
|
|
26
26
|
|
|
27
|
-
Returns a raw SVG string suitable for embedding
|
|
27
|
+
Returns a raw SVG string suitable for embedding. Pass width/height in the **second** argument (SSR has no DOM to measure).
|
|
28
28
|
|
|
29
29
|
```js
|
|
30
30
|
import ApexCharts from 'apexcharts/ssr'
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
32
|
+
// renderToString(options, { width?, height?, scale? })
|
|
33
|
+
const svgString = await ApexCharts.renderToString(
|
|
34
|
+
{
|
|
35
|
+
chart: { type: 'line' },
|
|
36
|
+
series: [{ name: 'Sales', data: [30, 40, 35, 50] }],
|
|
37
|
+
xaxis: { categories: ['Q1', 'Q2', 'Q3', 'Q4'] }
|
|
38
|
+
},
|
|
39
|
+
{ width: 600, height: 350 }
|
|
40
|
+
)
|
|
37
41
|
|
|
38
42
|
// svgString is raw <svg>...</svg> markup
|
|
39
43
|
```
|
|
40
44
|
|
|
41
|
-
### renderToHTML(options)
|
|
45
|
+
### renderToHTML(options, ssrOptions?)
|
|
42
46
|
|
|
43
47
|
Returns an HTML string with a wrapper `<div>` containing the SVG, ready for hydration:
|
|
44
48
|
|
|
45
49
|
```js
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
// renderToHTML(options, { width?, height?, scale?, className? })
|
|
51
|
+
const htmlString = await ApexCharts.renderToHTML(
|
|
52
|
+
{
|
|
53
|
+
chart: {
|
|
54
|
+
type: 'bar',
|
|
55
|
+
id: 'my-chart' // id is important for hydration targeting
|
|
56
|
+
},
|
|
57
|
+
series: [{ data: [44, 55, 41, 67] }],
|
|
58
|
+
xaxis: { categories: ['A', 'B', 'C', 'D'] }
|
|
52
59
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
60
|
+
{ width: 600, height: 350 }
|
|
61
|
+
)
|
|
56
62
|
|
|
57
63
|
// htmlString is <div id="my-chart" data-apexcharts>...<svg>...</svg></div>
|
|
58
64
|
```
|
|
@@ -63,19 +69,19 @@ const htmlString = await ApexCharts.renderToHTML({
|
|
|
63
69
|
|
|
64
70
|
After the server-rendered HTML is in the DOM, hydrate it to make it interactive:
|
|
65
71
|
|
|
66
|
-
### hydrate(element)
|
|
72
|
+
### hydrate(element, clientOptions?)
|
|
67
73
|
|
|
68
74
|
```js
|
|
69
75
|
import ApexCharts from 'apexcharts'
|
|
70
76
|
|
|
71
|
-
// Hydrate a specific chart element
|
|
77
|
+
// Hydrate a specific chart element (optionally merge client-only options)
|
|
72
78
|
const chart = ApexCharts.hydrate(document.querySelector('#my-chart'))
|
|
73
79
|
```
|
|
74
80
|
|
|
75
|
-
### hydrateAll()
|
|
81
|
+
### hydrateAll(selector?, clientOptions?)
|
|
76
82
|
|
|
77
83
|
```js
|
|
78
|
-
// Hydrate all server-rendered charts on the page
|
|
84
|
+
// Hydrate all server-rendered charts on the page (optionally scope by selector)
|
|
79
85
|
ApexCharts.hydrateAll()
|
|
80
86
|
```
|
|
81
87
|
|
|
@@ -101,11 +107,14 @@ import ApexCharts from 'apexcharts/ssr'
|
|
|
101
107
|
const app = express()
|
|
102
108
|
|
|
103
109
|
app.get('/', async (req, res) => {
|
|
104
|
-
const chartHTML = await ApexCharts.renderToHTML(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
const chartHTML = await ApexCharts.renderToHTML(
|
|
111
|
+
{
|
|
112
|
+
chart: { type: 'line', id: 'sales-chart' },
|
|
113
|
+
series: [{ name: 'Sales', data: [30, 40, 35, 50, 49, 60] }],
|
|
114
|
+
xaxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'] }
|
|
115
|
+
},
|
|
116
|
+
{ width: 600, height: 350 }
|
|
117
|
+
)
|
|
109
118
|
|
|
110
119
|
res.send(`
|
|
111
120
|
<!DOCTYPE html>
|
|
@@ -136,11 +145,14 @@ app.listen(3000)
|
|
|
136
145
|
import ApexCharts from 'apexcharts/ssr'
|
|
137
146
|
|
|
138
147
|
export default async function Page() {
|
|
139
|
-
const chartHTML = await ApexCharts.renderToHTML(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
148
|
+
const chartHTML = await ApexCharts.renderToHTML(
|
|
149
|
+
{
|
|
150
|
+
chart: { type: 'line', id: 'my-chart' },
|
|
151
|
+
series: [{ data: [10, 20, 30] }],
|
|
152
|
+
xaxis: { categories: ['A', 'B', 'C'] }
|
|
153
|
+
},
|
|
154
|
+
{ width: 600, height: 350 }
|
|
155
|
+
)
|
|
144
156
|
|
|
145
157
|
return (
|
|
146
158
|
<>
|
|
@@ -176,11 +188,14 @@ export default function HydrateCharts() {
|
|
|
176
188
|
// Server-side
|
|
177
189
|
const chartHTML = await useAsyncData('chart', async () => {
|
|
178
190
|
const ApexCharts = (await import('apexcharts/ssr')).default
|
|
179
|
-
return await ApexCharts.renderToHTML(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
191
|
+
return await ApexCharts.renderToHTML(
|
|
192
|
+
{
|
|
193
|
+
chart: { type: 'bar', id: 'my-chart' },
|
|
194
|
+
series: [{ data: [44, 55, 41] }],
|
|
195
|
+
xaxis: { categories: ['A', 'B', 'C'] }
|
|
196
|
+
},
|
|
197
|
+
{ width: 600, height: 350 }
|
|
198
|
+
)
|
|
184
199
|
})
|
|
185
200
|
|
|
186
201
|
// Client-side hydration
|
|
@@ -197,5 +212,5 @@ onMounted(async () => {
|
|
|
197
212
|
|
|
198
213
|
1. **Using `apexcharts` in Node.js without SSR methods** — the default export auto-resolves based on environment, but `renderToString` is only available via `apexcharts/ssr`.
|
|
199
214
|
2. **Forgetting to hydrate on the client** — server-rendered charts are static SVGs. Without `hydrate()`, they have no interactivity (no tooltips, zoom, click events).
|
|
200
|
-
3. **Missing
|
|
215
|
+
3. **Missing width/height**: SSR has no DOM to measure. Pass explicit dimensions in the **second** argument: `renderToString(options, { width, height })` / `renderToHTML(options, { width, height })`.
|
|
201
216
|
4. **Hydrating before DOM is ready** — call `hydrate()` after the server-rendered HTML is in the DOM (use `onMounted`, `useEffect`, or `DOMContentLoaded`).
|
|
@@ -6,7 +6,7 @@ ApexCharts supports three import strategies with different bundle sizes:
|
|
|
6
6
|
|
|
7
7
|
| Strategy | Import | Includes |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| Full bundle | `import ApexCharts from 'apexcharts'` | All
|
|
9
|
+
| Full bundle | `import ApexCharts from 'apexcharts'` | All chart types + all features |
|
|
10
10
|
| Per-type entry | `import ApexCharts from 'apexcharts/line'` | Specific chart family + core (no optional features) |
|
|
11
11
|
| Bare core | `import ApexCharts from 'apexcharts/core'` | Core class only — must manually register everything |
|
|
12
12
|
|
|
@@ -28,14 +28,17 @@ Each entry point registers a family of related chart types:
|
|
|
28
28
|
| `apexcharts/rangeBar` | same as /bar |
|
|
29
29
|
| `apexcharts/candlestick` | candlestick, boxPlot |
|
|
30
30
|
| `apexcharts/boxPlot` | same as /candlestick |
|
|
31
|
+
| `apexcharts/violin` | violin *(new in v6)* |
|
|
31
32
|
| `apexcharts/pie` | pie, donut, polarArea |
|
|
32
33
|
| `apexcharts/donut` | same as /pie |
|
|
33
34
|
| `apexcharts/polarArea` | same as /pie |
|
|
34
|
-
| `apexcharts/radialBar` | radialBar |
|
|
35
|
+
| `apexcharts/radialBar` | radialBar, **gauge** *(v6 alias)* |
|
|
35
36
|
| `apexcharts/radar` | radar |
|
|
36
37
|
| `apexcharts/heatmap` | heatmap |
|
|
37
38
|
| `apexcharts/treemap` | treemap |
|
|
38
39
|
|
|
40
|
+
**v6 first-class aliases:** `funnel` and `pyramid` render through the bar engine, so `apexcharts/bar` covers them. `gauge` renders through radialBar, so `apexcharts/radialBar` covers it. There is no separate `apexcharts/funnel`, `apexcharts/pyramid`, or `apexcharts/gauge` entry.
|
|
41
|
+
|
|
39
42
|
### Using Multiple Chart Types
|
|
40
43
|
|
|
41
44
|
```js
|
|
@@ -57,9 +60,22 @@ Features are optional modules that add functionality. When using per-type entrie
|
|
|
57
60
|
| Annotations | `import 'apexcharts/features/annotations'` | X/Y/point/text/image annotations |
|
|
58
61
|
| Exports | `import 'apexcharts/features/exports'` | `dataURI()`, `getSvgString()`, `exportToCSV()` |
|
|
59
62
|
| Keyboard | `import 'apexcharts/features/keyboard'` | Keyboard navigation (accessibility) |
|
|
63
|
+
| Morph *(v6)* | `import 'apexcharts/features/morph'` | Animated chart-type morphs |
|
|
64
|
+
| Drilldown *(v6)* | `import 'apexcharts/features/drilldown'` | Hierarchical drill-down |
|
|
65
|
+
| History / Rewind *(v6)* | `import 'apexcharts/features/history'` | Undo/redo (`chart.history`) |
|
|
66
|
+
| Perspectives *(v6)* | `import 'apexcharts/features/perspectives'` | Shareable view state |
|
|
67
|
+
| Storyboard *(v6)* | `import 'apexcharts/features/storyboard'` | Scrollytelling (includes perspectives) |
|
|
68
|
+
| Facet *(v6)* | `import 'apexcharts/features/facet'` | Design tokens + OS-aware themes |
|
|
69
|
+
| Weave *(v6)* | `import 'apexcharts/features/weave'` | Public plugin platform |
|
|
70
|
+
| Renderer / Strata *(v6)* | `import 'apexcharts/features/renderer-canvas'` | Hybrid SVG + canvas renderer |
|
|
71
|
+
| Marks *(v6)* | `import 'apexcharts/features/marks'` | Custom series types (`registerSeriesType`) |
|
|
72
|
+
| Link *(v6)* | `import 'apexcharts/features/link'` | Crossfilter / linked views |
|
|
73
|
+
| Ink *(v6)* | `import 'apexcharts/features/ink'` | On-chart annotation authoring |
|
|
74
|
+
| Measure *(v6)* | `import 'apexcharts/features/measure'` | Measure / delta ruler |
|
|
75
|
+
| Context menu *(v6)* | `import 'apexcharts/features/context-menu'` | Right-click / long-press context menu |
|
|
60
76
|
| All | `import 'apexcharts/features/all'` | All of the above |
|
|
61
77
|
|
|
62
|
-
**Important:** Tooltip is always included in core
|
|
78
|
+
**Important:** Tooltip is always included in core (it cannot be tree-shaken). Easing (Cadence) and real-time streaming are also core, so they need no feature import. See `v6-features.md` for the config and API of each v6 feature.
|
|
63
79
|
|
|
64
80
|
### What Happens If You Forget a Feature
|
|
65
81
|
|