Articles in this section
Category / Section

How to change bubble color on cursor hover in JavaScript Bubble Chart?

1 min read

You can customize the bubble color using the  pointMove event. Refer Chart Events for more information about the events available in Chart. Refer pointMove event for more information about the options available in the pointMove event.

 

In this event we can get the current mouse hover point. The Event handler argument containing properties like cancelname, series, point, series, chart, pointIndex, seriesIndex, x  and y to customize the rendered bubble. Use point property in the argument to change bubble color on cursor hover.

 

 

Code Snippet 

You can refer the bubble chart UG documentation to render the bubble chart.

The following code example shows the customization of bubble color on pointMove event.

 

[Ts]

let chart: Chart = new Chart({

   // Initiazlize the point move event

   pointMove: (args: IPointEventArgs): void => {     

      args.point.marker.fill = "#FF0000";

  }

});

 

Screenshot:

Customization of bubble color

Stackblitz Sample: https://stackblitz.com/edit/r1ms6l-dmjbyn?file=index.ts

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied