Charts - Hover

Apply visual feedback on hover with brightness, optional opacity dimming, color overrides, border styling, pie slice pop-out, and line marker scaling.

#Usage

import { ChartHover, ChartLine, ChartRadar, ChartScatter, ChartSvg } from '@primeui/vue-chart';
<ChartSvg>
    <!-- series and axes -->
    <ChartHover />
</ChartSvg>

Hover feedback is opt-in: add ChartHover to brighten the hovered element while non-hovered elements stay at normal opacity. Dimming is explicit: set dimOpacity below 1 on ChartHover, a series hover config, or the chart theme when you want the rest of the marks to fade.

#Basic

Add ChartHover to enable visual feedback when hovering over data elements. The hovered item brightens while non-hovered items stay unchanged. The default brightness is 1.1 and dimOpacity is 1.

Loading Demo...

#Brightness & Dim

Set brightness to control how much the hovered item lightens. 1.0 means no change, 1.3 means 30% brighter. Set dimOpacity below 1 to fade non-hovered items. 0 makes them invisible, 1 means no fading. Combining brightness with explicit dimming produces a stronger focus effect without changing colors.

Loading Demo...

#Pie Offset

Set offset to pop the hovered slice outward from the center along the slice angle. The chart reserves extra padding to prevent clipping. Also works on bar charts, where offset lifts the hovered bar upward.

Loading Demo...

#Border Override

Set borderColor and borderStrokeWidth to add a stroke around the hovered item. Use borderDash to apply a dashed border pattern and borderDashOffset to shift the pattern along the stroke. This provides a selection indicator that works alongside brightness and optional dimming.

Loading Demo...

#Scale

Set scale to physically resize the hovered element. Unlike brightness which only adjusts color, scale grows or shrinks the element. 1.2 makes it 20% larger. Scale and brightness can be combined for a stronger pop effect.

Loading Demo...

#Color Override

Set backgroundColor to replace the hovered item's fill color instead of adjusting brightness. When backgroundColor is set, brightness is ignored. Use this when base colors are muted and brightness alone is not visible enough.

Loading Demo...

#Click

Add ChartHover and set onClick to respond to clicks on data elements. The callback receives the clicked element's datasetId, index, label, value, and color. When onClick is not set, a click has no effect on the data element; series visibility is toggled through the legend, not by clicking the chart.

Loading Demo...

#Line Marker Scaling

On line, scatter, and radar charts the hovered point's marker enlarges. By default it grows to markerSize × 1.3. Set radiusMultiplier on ChartHover to change that multiplier globally, or hoverPointRadius on the series component to override a specific series with an absolute pixel radius. Use pointHoverBackgroundColor and pointHoverBorderColor to override marker colors on hover.

Loading Demo...

#API

#ChartHover

PropTypeDefaultDescription
brightnessnumber1.1Brightness multiplier on the hovered item. 1.0 = no change, 1.3 = 30% brighter. Ignored when backgroundColor is set
dimOpacity0–11Opt-in opacity of non-hovered items when something is hovered. 0 = invisible, 1 = no fading
offsetpx0Pop-out distance. Slides pie slices outward from center, lifts bars upward
scalenumber1Scale multiplier on the hovered item
radiusMultipliernumber1.3Marker radius multiplier on hover for line, scatter, and radar points. 1.3 grows markers 30%. Per-series hoverPointRadius (absolute px) overrides it
backgroundColorstring-Override fill color on hover. Replaces the item's color entirely instead of adjusting brightness
borderColorstring-Border stroke color on hover
borderStrokeWidthnumber-Border stroke width on hover
borderDashnumber[]-Border dash pattern on hover [dashLength, gapLength]
borderDashOffsetnumber-Offset for the dash pattern
onClick(context) => void-Click handler for data elements. When set, fires with the clicked element's context. When not set, a click has no effect; use the legend to toggle visibility

#onClick context

The object passed to the onClick callback when a data element is clicked.

FieldTypeDescription
datasetIdstringThe series identifier
indexnumberData index of the clicked element
labelstringCategory or slice label
valuenumberData value
colorstringResolved element color

#Per-Series Marker Props

Set these directly on ChartLine, ChartScatter, or ChartRadar to override hover behavior for that specific series.

PropTypeDefaultDescription
hoverPointRadiuspxmarkerSize × 1.3Marker radius when hovered. Consistent across line, scatter, and radar
pointHoverBackgroundColorstring-Marker fill color on hover
pointHoverBorderColorstring-Marker border color on hover
pointHoverBorderStrokeWidthpx-Marker border width on hover

#Hover Behavior by Chart Type

Chart TypeGranularityOffsetBrightnessDimMarker Scale
Bar / ColumnPer-barLifts bar up✓Opt-in-
Line / AreaPer-point-✓Opt-inmarkerSize × 1.3
Scatter / BubblePer-point-✓Opt-inmarkerSize × 1.3
Pie / DonutPer-slicePops outward✓Opt-in-
CandlestickPer-candle-✓Opt-in-
HeatmapPer-cell-✓Opt-in-
TreemapPer-cell-✓Opt-in-
RadarPer-dataset-✓Opt-inmarkerSize × 1.3
PolarPer-bar-✓Opt-in-