add chart functionality