violin
Configuration Structure
violin: {}plotOptions
bandwidthScale
1Multiplies the density-derived half-width of each violin. At 1, a curve's own peak density maps to half the category slot. Values above 1 widen the curves, below 1 narrow them.
kde
Kernel density estimation, used only when the density is derived from raw observations: a datum supplying points, or a flat number array as y. A precomputed density profile is drawn exactly as given and ignores this.
Requires the optional stats feature, which the default apexcharts bundle already includes.
bandwidth
undefinedKernel width in value units. Unset uses Silverman's rule of thumb.
This is the statistical parameter, and it changes the shape of the estimate: too small and the curve turns spiky, too large and real structure is smoothed away. bandwidthScale is unrelated, it only scales the drawn width.
resolution
64Density samples per violin.
normalize
'individual'How violin widths are scaled across the series.
Available Options:
- 'individual' (default): each violin is scaled to its own peak, so every curve fills the slot regardless of sample size.
- 'group': all violins share one scale (the densest in the series), keeping widths proportional to density across categories.
side
'both'Available since v7.1.0. Which side(s) of the category centreline the density is drawn on.
Available Options:
- 'both' (default): the classic symmetric violin.
- 'left' / 'right': a half-violin on vertical charts, with the curve on that side and a straight baseline on the other.
- 'top' / 'bottom': the same, on horizontal charts.
The raincloud chart type presets this to 'right', or 'top' when horizontal. A plain violin can use it too.
plotOptions: {
violin: {
side: 'right'
}
}
box
Available since v7.1.0. A five-number-summary box beside the density, in its own lane out of the category slot.
Drawn only when a datum carries y.summary, either supplied directly as [whiskerLow, q1, median, q3, whiskerHigh] or derived from the raw sample by the raincloud feature.
The rain/jitter layer is the outlier display, so the box draws no outlier dots of its own.
show
falseWhether to draw the summary box. The raincloud preset turns it on.
Turning it off reflows its lane, so the observations sit directly against the density baseline rather than leaving a dead strip.
width
'15%'Fraction of the category slot reserved for the box lane. A percentage string, or a number of pixels.
whiskers
'minmax'How the deriving transform places the whiskers.
Available Options:
- 'minmax' (default): at the data extremes.
- 'tukey': at 1.5 x IQR fences, clamped to the data. This is the raincloud preset, and it is safe there because the rain draws every observation, so nothing beyond the whiskers is hidden.
A hand-supplied y.summary is drawn exactly as given and ignores this.
strokeWidth
1Stroke width of the box and its whiskers, in px.
fillColor
undefinedBox fill. Defaults to the series colour.
capWidth
0.5Whisker cap length, as a fraction (0 to 1) of the box lane width.
points
Individual observations ("jitter") overlaid on the violin shape. The raw values come from the points array on each data point's y.
show
trueRender the jitter dots over each violin.
Available Options:
- true (default)
- false
shape
'circle'Marker shape for each observation.
Available Options:
- 'circle' (default)
- 'square'
size
2.5Marker radius in pixels.
jitter
0.5Horizontal scatter of the dots as a 0..1 fraction of the violin's half-width. 0 stacks every dot on the centre line.
constrainToViolin
trueClamp the jitter to the density width at each value so dots stay inside the curve outline.
Available Options:
- true (default)
- false
position
'center'Available since v7.1.0. Where the observations are scattered.
Available Options:
- 'center' (default): across the slot centreline, under the density. The classic violin jitter.
- 'left' / 'right' / 'top' / 'bottom': in their own lane on that side, which is the raincloud "rain". The raincloud preset uses
'left', or'bottom'when horizontal.
Off-centre dots ignore points.constrainToViolin: they no longer sit under the curve, so there is no width to clamp them to.
plotOptions: {
violin: {
side: 'right',
points: {
position: 'left',
jitter: 0.85
}
}
}
laneWidth
'40%'Available since v7.1.0. Fraction of the category slot given to the off-centre dot lane. A percentage string, or a number of pixels. Ignored when points.position is 'center'.
maxPoints
3000Cap on the number of dots drawn per violin. Observations beyond this are stride-thinned (evenly sampled) so dense groups stay performant.
opacity
0.9Opacity of the dots, from 0 to 1.
fillColor
'series-dark'Fill colour of the dots. Accepts 'series-dark' (a darker shade of the violin's own colour), 'series' (the violin's colour as-is), or any literal colour string such as '#fff'.
strokeColor
'#fff'Colour of the ring around each dot.
strokeWidth
1Width of the dot outline in pixels. 0 disables the outline.
colorScale
Colour each dot by its value along a ramp, overriding fillColor. Dots are bucketed into steps shades to keep rendering fast.
colors
undefinedHex colour stops, ordered low → high.
min
undefinedValue mapped to the first colour stop. Defaults to the data minimum.
max
undefinedValue mapped to the last colour stop. Defaults to the data maximum.
steps
24Number of shade buckets between min and max.