created lava.event utility js function to keep the chart in the scope of the event handler