add function to get chart by id