removed legendvisibility within button handlers