JavaScript/jQuery Funnel - Hover

User Interaction

When a user presses or hovers over funnel items, they change their style to the one specified by the item.hoverStyle object.

App.js
  • import React from 'react';
  • import Funnel, {
  • Item,
  • HoverStyle,
  • Hatching
  • } from 'devextreme-react/funnel';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Funnel ... >
  • <Item ... >
  • <HoverStyle>
  • <Hatching direction="left" />
  • </HoverStyle>
  • </Item>
  • </Funnel>
  • );
  • }
  • }
  •  
  • export default App;

If you need to disable this feature, set the hoverEnabled property to false.

App.js
  • import React from 'react';
  • import Funnel from 'devextreme-react/funnel';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Funnel hoverEnabled={false} />
  • );
  • }
  • }
  •  
  • export default App;

API

You can change a funnel item's hover state by passing true or false to the item's hover(state) method. To check whether the funnel item is currently hovered over, call its isHovered() method.

App.js
  • import React from 'react';
  •  
  • class App extends React.Component {
  • toggleItemHoverState (item) {
  • item.hover(!item.isHovered());
  • }
  • }
  •  
  • export default App;
See Also

Events

When a funnel item's hover state is being changed, the Funnel raises the hoverChanged event that you can handle with a function. If the handling function is not going to be changed during the lifetime of the UI component, assign it to the onHoverChanged property when you configure the UI component. To check whether the pointer entered or left a funnel item, call the item's isHovered() method.

App.js
  • import React from 'react';
  • import Funnel from 'devextreme-react/funnel';
  •  
  • class App extends React.Component {
  • render() {
  • return (
  • <Funnel
  • onHoverChanged={onHoverChanged}
  • />
  • );
  • }
  • }
  •  
  • function onHoverChanged (e) {
  • if (e.item.isHovered()) {
  • // Commands to execute when the pointer enters the item
  • } else {
  • // Commands to execute when the pointer leaves the item
  • }
  • }
  •  
  • export default App;
See Also