ChartsTooltip API
API reference docs for the React ChartsTooltip component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
// or
import { ChartsTooltip } from '@mui/x-charts';
Name | Type | Default | Description |
---|---|---|---|
axisContent | elementType | - | Component to override the tooltip content when triger is set to 'axis'. |
classes | object | - | Override or extend the styles applied to the component. See CSS API below for more details. |
itemContent | elementType | - | Component to override the tooltip content when triger is set to 'item'. |
slotProps | object | {} | The props used for each component slot. |
slots | object | {} | Overridable component slots. See Slots API below for more details. |
trigger | 'axis' | 'item' | 'none' | 'item' | Select the kind of tooltip to display - 'item': Shows data about the item below the mouse. - 'axis': Shows values associated with the hovered x value - 'none': Does not display tooltip |
Slot name | Class name | Default component | Description |
---|---|---|---|
popper | |||
axisContent | |||
itemContent |
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Class name | Rule name | Description |
---|---|---|
.MuiChartsTooltip-cell | cell | Styles applied to the cell element. |
.MuiChartsTooltip-labelCell | labelCell | Styles applied to the labelCell element. |
.MuiChartsTooltip-mark | mark | Styles applied to the mark element. |
.MuiChartsTooltip-markCell | markCell | Styles applied to the markCell element. |
.MuiChartsTooltip-root | root | Styles applied to the root element. |
.MuiChartsTooltip-row | row | Styles applied to the row element. |
.MuiChartsTooltip-table | table | Styles applied to the table element. |
.MuiChartsTooltip-valueCell | valueCell | Styles applied to the valueCell element. |
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverrides
property in a custom theme.