dynamically rendering chart