Fix bug on rendering charts