Adding functionality to charts