Skip to content

ChartsTooltip API

API reference docs for the React ChartsTooltip component. Learn about the props, CSS, and other APIs of this exported module.

Demos

For examples and details on the usage of this React component, visit the component demo pages:

    Import

    import ChartsTooltip from '/packages/x-charts/src/ChartsTooltip';
    // or
    import { ChartsTooltip } from '/packages/x-charts/src';
    Learn about the difference by reading this guide on minimizing bundle size.

    Props

    axisContent

    Component to override the tooltip content when triger is set to 'axis'.

    Type:

    elementType

    classes

    Override or extend the styles applied to the component.

    See CSS API below for more details.

    Type:

    object

    itemContent

    Component to override the tooltip content when triger is set to 'item'.

    Type:

    elementType

    trigger

    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

    Type:

    'axis' | 'item' | 'none'

    Default:

    'item'

    The component cannot hold a ref.

    CSS

    The following class names are useful for styling with CSS (the state classes are marked).
    To learn more, visit the component customization page.


    .MuiChartsTooltip-rootroot

    Styles applied to the root element.


    .MuiChartsTooltip-markCellmarkCell

    Styles applied to the markCell element.


    .MuiChartsTooltip-labelCelllabelCell

    Styles applied to the labelCell element.


    .MuiChartsTooltip-valueCellvalueCell

    Styles applied to the valueCell element.


    You can override the style of the component using one of these customization options: