created toggle function at chart selection field