fix (#336) failing legend test by creating an invisible canvas