make chart an instance attribute