Refactoring da API de charts JS.