adds event handlers for chart