adds functionality for graph checkbox