Updated code for library charts