A helper function for rendering data with canvas